SourceMod SDK  1.7
SourceMod::IMenuHandler Class Reference

Contains callbacks for menu actions. More...

#include <public/IMenuManager.h>

Public Member Functions

virtual unsigned int GetMenuAPIVersion2 ()
 Returns the menu api verison. More...
 
virtual void OnMenuStart (IBaseMenu *menu)
 A display/selection cycle has started. More...
 
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. More...
 
virtual void OnMenuSelect (IBaseMenu *menu, int client, unsigned int item)
 Called when an item is selected. More...
 
virtual void OnMenuCancel (IBaseMenu *menu, int client, MenuCancelReason reason)
 An active menu display was dropped from a client. More...
 
virtual void OnMenuEnd (IBaseMenu *menu, MenuEndReason reason)
 A display/selection cycle has ended. More...
 
virtual void OnMenuDestroy (IBaseMenu *menu)
 Called when the menu object is destroyed. More...
 
virtual void OnMenuDrawItem (IBaseMenu *menu, int client, unsigned int item, unsigned int &style)
 Called when requesting how to render an item. More...
 
virtual unsigned int OnMenuDisplayItem (IBaseMenu *menu, int client, IMenuPanel *panel, unsigned int item, const ItemDrawInfo &dr)
 Called when drawing item text. More...
 
virtual void OnMenuVoteStart (IBaseMenu *menu)
 Called when a vote has been started and displayed to clients. This is called after OnMenuStart() and OnMenuDisplay(), but before OnMenuSelect(). More...
 
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 a style implementation. More...
 
virtual void OnMenuVoteCancel (IBaseMenu *menu, VoteCancelReason reason)
 Called when a vote is cancelled. If this is called, then OnMenuVoteResults() will not be called. In both cases, OnMenuEnd will always be called. More...
 
virtual bool OnSetHandlerOption (const char *option, const void *data)
 Call to set private handler stuff. More...
 
virtual void OnMenuSelect2 (IBaseMenu *menu, int client, unsigned int item, unsigned int item_on_page)
 Called when an item is selected. More...
 

Detailed Description

Contains callbacks for menu actions.

Member Function Documentation

virtual unsigned int SourceMod::IMenuHandler::GetMenuAPIVersion2 ( )
inlinevirtual

Returns the menu api verison.

Returns
Menu API version.
virtual void SourceMod::IMenuHandler::OnMenuCancel ( IBaseMenu menu,
int  client,
MenuCancelReason  reason 
)
inlinevirtual

An active menu display was dropped from a client.

Parameters
menuMenu pointer.
clientClient that had the menu.
reasonMenu cancellation reason.
virtual void SourceMod::IMenuHandler::OnMenuDestroy ( IBaseMenu menu)
inlinevirtual

Called when the menu object is destroyed.

Parameters
menuMenu pointer.
virtual void SourceMod::IMenuHandler::OnMenuDisplay ( IBaseMenu menu,
int  client,
IMenuPanel display 
)
inlinevirtual

Called before a menu is being displayed. This is where you can set an alternate title on the menu.

Parameters
menuMenu pointer.
clientClient index.
displayIMenuPanel pointer.
virtual unsigned int SourceMod::IMenuHandler::OnMenuDisplayItem ( IBaseMenu menu,
int  client,
IMenuPanel panel,
unsigned int  item,
const ItemDrawInfo dr 
)
inlinevirtual

Called when drawing item text.

Parameters
menuMenu pointer.
clientClient index receiving the menu.
panelPanel being used to draw the menu.
itemItem number in the menu.
drItem draw information.
Returns
0 to let the render algorithm decide how to draw, otherwise, the return value from panel->DrawItem should be returned.
virtual void SourceMod::IMenuHandler::OnMenuDrawItem ( IBaseMenu menu,
int  client,
unsigned int  item,
unsigned int &  style 
)
inlinevirtual

Called when requesting how to render an item.

Parameters
menuMenu pointer.
clientClient index receiving the menu.
itemItem number in the menu.
styleITEMSTYLE flags, by reference for modification.
virtual void SourceMod::IMenuHandler::OnMenuEnd ( IBaseMenu menu,
MenuEndReason  reason 
)
inlinevirtual

A display/selection cycle has ended.

Parameters
menuMenu pointer.
reasonMenuEndReason reason.
virtual void SourceMod::IMenuHandler::OnMenuSelect ( IBaseMenu menu,
int  client,
unsigned int  item 
)
inlinevirtual

Called when an item is selected.

Parameters
menuMenu pointer.
clientClient that selected the item.
itemItem number.
virtual void SourceMod::IMenuHandler::OnMenuSelect2 ( IBaseMenu menu,
int  client,
unsigned int  item,
unsigned int  item_on_page 
)
inlinevirtual

Called when an item is selected.

Note: This callback was added in v13. It is called after OnMenuSelect().

Parameters
menuMenu pointer.
clientClient that selected the item.
itemItem number.
item_on_pageThe first item on the page the player was last viewing.
virtual void SourceMod::IMenuHandler::OnMenuStart ( IBaseMenu menu)
inlinevirtual

A display/selection cycle has started.

Parameters
menuMenu pointer.
virtual void SourceMod::IMenuHandler::OnMenuVoteCancel ( IBaseMenu menu,
VoteCancelReason  reason 
)
inlinevirtual

Called when a vote is cancelled. If this is called, then OnMenuVoteResults() will not be called. In both cases, OnMenuEnd will always be called.

Parameters
menuMenu pointer.
reasonVoteCancelReason reason.
virtual void SourceMod::IMenuHandler::OnMenuVoteResults ( IBaseMenu menu,
const menu_vote_result_t results 
)
inlinevirtual

Called when a vote ends. This is automatically called by the wrapper, and never needs to called from a style implementation.

This function does not replace OnMenuEnd(), nor does it have the same meaning as OnMenuEnd(), meaning you should not destroy a menu while it is in this function.

Parameters
menuMenu pointer.
resultsMenu vote results.
virtual void SourceMod::IMenuHandler::OnMenuVoteStart ( IBaseMenu menu)
inlinevirtual

Called when a vote has been started and displayed to clients. This is called after OnMenuStart() and OnMenuDisplay(), but before OnMenuSelect().

Parameters
menuMenu pointer.
virtual bool SourceMod::IMenuHandler::OnSetHandlerOption ( const char *  option,
const void *  data 
)
inlinevirtual

Call to set private handler stuff.

Parameters
optionOption name.
dataPrivate data.
Returns
True if set, false if invalid or unrecognized.

The documentation for this class was generated from the following file: