More Windows build fix.
3 * =============================================================================
5 * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
6 * =============================================================================
8 * This program is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, version 3.0, as published by the
10 * Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to link the
21 * code of this program (as well as its derivative works) to "Half-Life 2," the
22 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
23 * by the Valve Corporation. You must obey the GNU General Public License in
24 * all respects for all other code used. Additionally, AlliedModders LLC grants
25 * this exception to all derivative works. AlliedModders LLC defines further
26 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
27 * or <http://www.sourcemod.net/license.php>.
32 #ifndef _INCLUDE_MENUSTYLE_VALVE_H
33 #define _INCLUDE_MENUSTYLE_VALVE_H
35 #include "sm_globals.h"
36 #include "MenuManager.h"
37 #include "MenuStyle_Base.h"
38 #include "sourcemm_api.h"
39 #include "KeyValues.h"
40 #include "sm_fastlink.h"
41 #include <compat_wrappers.h>
43 using namespace SourceMod;
45 class CValveMenuPlayer : public CBaseMenuPlayer
48 CValveMenuPlayer() : curPrioLevel(1)
55 class CValveMenuDisplay;
57 class ValveMenuStyle :
63 bool OnClientCommand(int client, const char *cmdname, const CCommand &cmd);
64 public: //BaseMenuStyle
65 CBaseMenuPlayer *GetMenuPlayer(int client);
66 void SendDisplay(int client, IMenuPanel *display);
67 bool DoClientMenu(int client, CBaseMenu *menu, unsigned int first_item, IMenuHandler *mh, unsigned int time);
68 bool DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time);
69 public: //SMGlobalClass
70 void OnSourceModAllInitialized();
71 void OnSourceModShutdown();
73 const char *GetStyleName();
74 IMenuPanel *CreatePanel();
75 IBaseMenu *CreateMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner);
76 unsigned int GetMaxPageItems();
77 unsigned int GetApproxMemUsage();
79 void HookCreateMessage(edict_t *pEdict, DIALOG_TYPE type, KeyValues *kv, IServerPluginCallbacks *plugin);
81 CValveMenuPlayer *m_players;
86 class CValveMenuDisplay : public IMenuPanel
90 CValveMenuDisplay(CValveMenu *pMenu);
93 IMenuStyle *GetParentStyle();
95 void DrawTitle(const char *text, bool onlyIfEmpty=false);
96 unsigned int DrawItem(const ItemDrawInfo &item);
97 bool DrawRawLine(const char *rawline);
98 bool SendDisplay(int client, IMenuHandler *handler, unsigned int time);
99 bool SetExtOption(MenuOption option, const void *valuePtr);
100 bool CanDrawItem(unsigned int drawFlags);
101 void SendRawDisplay(int client, int priority, unsigned int time);
103 bool SetSelectableKeys(unsigned int keymap);
104 unsigned int GetCurrentKey();
105 bool SetCurrentKey(unsigned int key);
106 int GetAmountRemaining();
107 unsigned int GetApproxMemUsage();
110 unsigned int m_NextPos;
114 class CValveMenu : public CBaseMenu
116 friend class CValveMenuDisplay;
118 CValveMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner);
120 bool SetExtOption(MenuOption option, const void *valuePtr);
121 IMenuPanel *CreatePanel();
122 bool GetExitButton();
123 bool SetExitButton(bool set);
124 bool SetPagination(unsigned int itemsPerPage);
125 bool Display(int client, unsigned int time, IMenuHandler *alt_handler=NULL);
126 bool DisplayAtItem(int client,
128 unsigned int start_item,
129 IMenuHandler *alt_handler/* =NULL */);
130 void SetMenuOptionFlags(unsigned int flags);
131 unsigned int GetApproxMemUsage();
133 void Cancel_Finally();
136 char m_IntroMsg[128];
139 extern ValveMenuStyle g_ValveMenuStyle;
141 #endif //_INCLUDE_MENUSTYLE_VALVE_H