32 #ifndef _INCLUDE_SOURCEMOD_MENU_SYSTEM_H_
33 #define _INCLUDE_SOURCEMOD_MENU_SYSTEM_H_
38 #define SMINTERFACE_MENUMANAGER_NAME "IMenuManager"
39 #define SMINTERFACE_MENUMANAGER_VERSION 16
97 #define ITEMDRAW_DEFAULT (0)
98 #define ITEMDRAW_DISABLED (1<<0)
99 #define ITEMDRAW_RAWLINE (1<<1)
100 #define ITEMDRAW_NOTEXT (1<<2)
101 #define ITEMDRAW_SPACER (1<<3)
102 #define ITEMDRAW_IGNORE ((1<<1)|(1<<2))
103 #define ITEMDRAW_CONTROL (1<<4)
111 unsigned int FLAGS=0,
const char *HELPTEXT=NULL)
112 : display(DISPLAY), style(STYLE)
143 enum MenuCancelReason
145 MenuCancel_Disconnected = -1,
146 MenuCancel_Interrupted = -2,
147 MenuCancel_Exit = -3,
148 MenuCancel_NoDisplay = -4,
149 MenuCancel_Timeout = -5,
150 MenuCancel_ExitBack = -6,
158 MenuEnd_Selected = 0,
159 MenuEnd_VotingDone = -1,
160 MenuEnd_VotingCancelled = -2,
161 MenuEnd_Cancelled = -3,
163 MenuEnd_ExitBack = -5,
169 enum VoteCancelReason
171 VoteCancel_Generic = -1,
172 VoteCancel_NoVotes = -2,
175 #define MENU_NO_PAGINATION 0
176 #define MENU_TIME_FOREVER 0
178 #define MENUFLAG_BUTTON_EXIT (1<<0)
179 #define MENUFLAG_BUTTON_EXITBACK (1<<1)
180 #define MENUFLAG_NO_SOUND (1<<2)
181 #define MENUFLAG_BUTTON_NOVOTE (1<<3)
183 #define VOTEFLAG_NO_REVOTES (1<<0)
190 MenuOption_IntroMessage,
193 MenuOption_IntroColor,
205 MenuSource_External = 1,
206 MenuSource_BaseMenu = 2,
207 MenuSource_Display = 3,
229 virtual void Reset() =0;
238 virtual void DrawTitle(
const char *text,
bool onlyIfEmpty=
false) =0;
265 virtual bool SetExtOption(MenuOption option,
const void *valuePtr) =0;
274 virtual bool CanDrawItem(
unsigned int drawFlags) =0;
343 virtual bool DirectSet(
const char *str) =0;
360 return SMINTERFACE_MENUMANAGER_VERSION;
409 virtual MenuSource
GetClientMenu(
int client,
void **
object) =0;
476 virtual bool RemoveItem(
unsigned int position) =0;
547 virtual bool SetExtOption(MenuOption option,
const void *valuePtr) =0;
577 virtual void Destroy(
bool releaseHandle=
true) =0;
630 unsigned int start_item,
654 return SMINTERFACE_MENUMANAGER_VERSION;
815 unsigned int item_on_page)
832 return SMINTERFACE_MENUMANAGER_VERSION;
894 unsigned int num_clients,
896 unsigned int max_time,
897 unsigned int flags=0) =0;
947 #endif //_INCLUDE_SOURCEMOD_MENU_SYSTEM_H_
virtual void OnMenuDisplay(IBaseMenu *menu, int client, IMenuPanel *display)
Called before a menu is being displayed. This is where you can set an alternate title on the menu...
Definition: IMenuManager.h:674
Defines the interface for creating, reading, and removing Handles.
virtual void OnMenuSelect(IBaseMenu *menu, int client, unsigned int item)
Called when an item is selected.
Definition: IMenuManager.h:685
Defines the Share System, responsible for shared resources and dependencies.
const char * display
Definition: IMenuManager.h:115
Defines the base functionality required by a shared interface.
Definition: IShareSys.h:92
virtual void OnMenuDestroy(IBaseMenu *menu)
Called when the menu object is destroyed.
Definition: IMenuManager.h:715
virtual void OnMenuVoteResults(IBaseMenu *menu, const menu_vote_result_t *results)
Called when a vote ends. This is automatically called by the wrapper, and never needs to called from ...
Definition: IMenuManager.h:773
Information about item drawing.
Definition: IMenuManager.h:108
virtual void OnMenuCancel(IBaseMenu *menu, int client, MenuCancelReason reason)
An active menu display was dropped from a client.
Definition: IMenuManager.h:696
virtual void OnMenuVoteStart(IBaseMenu *menu)
Called when a vote has been started and displayed to clients. This is called after OnMenuStart() and ...
Definition: IMenuManager.h:758
virtual void OnMenuSelect2(IBaseMenu *menu, int client, unsigned int item, unsigned int item_on_page)
Called when an item is selected.
Definition: IMenuManager.h:812
virtual void OnMenuDrawItem(IBaseMenu *menu, int client, unsigned int item, unsigned int &style)
Called when requesting how to render an item.
Definition: IMenuManager.h:727
virtual void OnMenuStart(IBaseMenu *menu)
A display/selection cycle has started.
Definition: IMenuManager.h:662
unsigned int style
Definition: IMenuManager.h:116
Definition: IAdminSystem.h:63
virtual unsigned int OnMenuDisplayItem(IBaseMenu *menu, int client, IMenuPanel *panel, unsigned int item, const ItemDrawInfo &dr)
Called when drawing item text.
Definition: IMenuManager.h:742
virtual void OnMenuVoteCancel(IBaseMenu *menu, VoteCancelReason reason)
Called when a vote is cancelled. If this is called, then OnMenuVoteResults() will not be called...
Definition: IMenuManager.h:785
virtual bool OnSetHandlerOption(const char *option, const void *data)
Call to set private handler stuff.
Definition: IMenuManager.h:796
virtual unsigned int GetMenuAPIVersion2()
Returns the menu api verison.
Definition: IMenuManager.h:652
virtual void OnMenuEnd(IBaseMenu *menu, MenuEndReason reason)
A display/selection cycle has ended.
Definition: IMenuManager.h:706
Contains callbacks for menu actions.
Definition: IMenuManager.h:644