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_RADIO_H
16 #define _INCLUDE_MENUSTYLE_RADIO_H
18 #include "sm_globals.h"
19 #include "MenuManager.h"
20 #include "MenuStyle_Base.h"
21 #include "sourcemm_api.h"
22 #include <IPlayerHelpers.h>
23 #include <IUserMessages.h>
24 #include "sm_fastlink.h"
27 using namespace SourceMod;
35 public IUserMessageListener
39 public: //SMGlobalClass
40 void OnSourceModAllInitialized();
41 void OnSourceModLevelChange(const char *mapName);
42 void OnSourceModShutdown();
43 public: //BaseMenuStyle
44 CBaseMenuPlayer *GetMenuPlayer(int client);
45 void SendDisplay(int client, IMenuPanel *display);
47 const char *GetStyleName();
48 IMenuPanel *CreatePanel();
49 IBaseMenu *CreateMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner);
50 unsigned int GetMaxPageItems();
51 public: //IUserMessageListener
52 void OnUserMessage(int msg_id, bf_write *bf, IRecipientFilter *pFilter);
53 void OnUserMessageSent(int msg_id);
56 bool OnClientCommand(int client);
58 CRadioDisplay *MakeRadioDisplay(CRadioMenu *menu=NULL);
59 void FreeRadioDisplay(CRadioDisplay *display);
61 CBaseMenuPlayer *m_players;
62 CStack<CRadioDisplay *> m_FreeDisplays;
65 class CRadioDisplay : public IMenuPanel
67 friend class CRadioStyle;
70 CRadioDisplay(CRadioMenu *menu);
72 IMenuStyle *GetParentStyle();
74 void DrawTitle(const char *text, bool onlyIfEmpty=false);
75 unsigned int DrawItem(const ItemDrawInfo &item);
76 bool DrawRawLine(const char *rawline);
77 bool SetExtOption(MenuOption option, const void *valuePtr);
78 bool CanDrawItem(unsigned int drawFlags);
79 bool SendDisplay(int client, IMenuHandler *handler, unsigned int time);
81 void SendRawDisplay(int client, unsigned int time);
82 bool SetSelectableKeys(unsigned int keymap);
83 unsigned int GetCurrentKey();
84 bool SetCurrentKey(unsigned int key);
88 unsigned int m_NextPos;
92 class CRadioMenu : public CBaseMenu
95 CRadioMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner);
97 bool SetExtOption(MenuOption option, const void *valuePtr);
98 IMenuPanel *CreatePanel();
99 bool Display(int client, unsigned int time);
100 void Cancel_Finally();
101 void VoteDisplay(int client, unsigned int maxTime);
104 extern CRadioStyle g_RadioMenuStyle;
106 #endif //_INCLUDE_MENUSTYLE_RADIO_H