3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is not open source and may not be copied without explicit
8 * written permission of AlliedModders LLC. This file may not be redistributed
9 * in whole or significant part.
10 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
15 #ifndef _INCLUDE_MENUSTYLE_VALVE_H
16 #define _INCLUDE_MENUSTYLE_VALVE_H
18 #include "sm_globals.h"
19 #include "MenuManager.h"
20 #include "MenuStyle_Base.h"
21 #include "sourcemm_api.h"
22 #include "KeyValues.h"
23 #include "sm_fastlink.h"
25 using namespace SourceMod;
27 class CValveMenuPlayer : public CBaseMenuPlayer
30 CValveMenuPlayer() : curPrioLevel(1)
37 class CValveMenuDisplay;
39 class ValveMenuStyle :
45 bool OnClientCommand(int client);
46 public: //BaseMenuStyle
47 CBaseMenuPlayer *GetMenuPlayer(int client);
48 void SendDisplay(int client, IMenuPanel *display);
49 bool DoClientMenu(int client, CBaseMenu *menu, IMenuHandler *mh, unsigned int time);
50 bool DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time);
51 public: //SMGlobalClass
52 void OnSourceModAllInitialized();
53 void OnSourceModShutdown();
54 void OnSourceModVSPReceived(IServerPluginCallbacks *iface);
56 const char *GetStyleName();
57 IMenuPanel *CreatePanel();
58 IBaseMenu *CreateMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner);
59 unsigned int GetMaxPageItems();
61 void HookCreateMessage(edict_t *pEdict, DIALOG_TYPE type, KeyValues *kv, IServerPluginCallbacks *plugin);
63 CValveMenuPlayer *m_players;
68 class CValveMenuDisplay : public IMenuPanel
72 CValveMenuDisplay(CValveMenu *pMenu);
75 IMenuStyle *GetParentStyle();
77 void DrawTitle(const char *text, bool onlyIfEmpty=false);
78 unsigned int DrawItem(const ItemDrawInfo &item);
79 bool DrawRawLine(const char *rawline);
80 bool SendDisplay(int client, IMenuHandler *handler, unsigned int time);
81 bool SetExtOption(MenuOption option, const void *valuePtr);
82 bool CanDrawItem(unsigned int drawFlags);
83 void SendRawDisplay(int client, int priority, unsigned int time);
87 unsigned int m_NextPos;
91 class CValveMenu : public CBaseMenu
93 friend class CValveMenuDisplay;
95 CValveMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner);
97 bool SetExtOption(MenuOption option, const void *valuePtr);
98 IMenuPanel *CreatePanel();
100 bool SetExitButton(bool set);
101 bool SetPagination(unsigned int itemsPerPage);
102 bool Display(int client, unsigned int time);
104 void Cancel_Finally();
107 char m_IntroMsg[128];
110 extern ValveMenuStyle g_ValveMenuStyle;
112 #endif //_INCLUDE_MENUSTYLE_VALVE_H