SourceMod SDK  1.7
SourceMod::IMenuManager Class Referenceabstract

Manages menu creation and displaying. More...

#include <public/IMenuManager.h>

Inheritance diagram for SourceMod::IMenuManager:
SourceMod::SMInterface

Public Member Functions

virtual const char * GetInterfaceName ()
 Must return a string defining the interface's unique name.
 
virtual unsigned int GetInterfaceVersion ()
 Must return an integer defining the interface's version.
 
virtual bool IsVersionCompatible (unsigned int version)
 Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning. More...
 
virtual IMenuStyleFindStyleByName (const char *name)=0
 Finds a style by name. More...
 
virtual IMenuStyleGetDefaultStyle ()=0
 Returns the default draw style Core is using. More...
 
virtual IMenuPanelRenderMenu (int client, menu_states_t &states, ItemOrder order)=0
 Given a set of menu states, converts it to an IMenuPanel object. More...
 
virtual void CancelMenu (IBaseMenu *menu)=0
 Cancels a menu. Calls IBaseMenu::Cancel() after doing some preparatory work. This should always be used instead of directly calling Cancel(). More...
 
virtual bool StartVote (IBaseMenu *menu, unsigned int num_clients, int clients[], unsigned int max_time, unsigned int flags=0)=0
 Displays a menu as a vote. More...
 
virtual bool IsVoteInProgress ()=0
 Returns whether or not a vote is in progress. More...
 
virtual void CancelVoting ()=0
 Cancels the vote in progress. This calls IBaseMenu::Cancel().
 
virtual unsigned int GetRemainingVoteDelay ()=0
 Returns the remaining vote delay from the last menu. This delay is a suggestion for all public votes, and is not enforced. More...
 
virtual bool IsClientInVotePool (int client)=0
 Returns whether a client is in the "allowed to vote" pool determined by the initial call to StartVote(). More...
 
virtual bool RedrawClientVoteMenu (int client)=0
 Redraws the current vote menu to a client in the voting pool. More...
 
virtual bool RedrawClientVoteMenu2 (int client, bool revotes)=0
 Redraws the current vote menu to a client in the voting pool. More...
 

Detailed Description

Manages menu creation and displaying.

Member Function Documentation

virtual void SourceMod::IMenuManager::CancelMenu ( IBaseMenu menu)
pure virtual

Cancels a menu. Calls IBaseMenu::Cancel() after doing some preparatory work. This should always be used instead of directly calling Cancel().

Parameters
menuIBaseMenu pointer.
virtual IMenuStyle* SourceMod::IMenuManager::FindStyleByName ( const char *  name)
pure virtual

Finds a style by name.

Parameters
nameName of the style (case insensitive).
Returns
IMenuStyle pointer, or NULL if not found.
virtual IMenuStyle* SourceMod::IMenuManager::GetDefaultStyle ( )
pure virtual

Returns the default draw style Core is using.

Returns
Menu style pointer.
virtual unsigned int SourceMod::IMenuManager::GetRemainingVoteDelay ( )
pure virtual

Returns the remaining vote delay from the last menu. This delay is a suggestion for all public votes, and is not enforced.

Returns
Number of seconds to wait.
virtual bool SourceMod::IMenuManager::IsClientInVotePool ( int  client)
pure virtual

Returns whether a client is in the "allowed to vote" pool determined by the initial call to StartVote().

Parameters
clientClient index.
Returns
True if client is allowed to vote, false on failure.
virtual bool SourceMod::IMenuManager::IsVersionCompatible ( unsigned int  version)
inlinevirtual

Must return whether the requested version number is backwards compatible. Note: This can be overridden for breaking changes or custom versioning.

Parameters
versionVersion number to compare against.
Returns
True if compatible, false otherwise.

Reimplemented from SourceMod::SMInterface.

virtual bool SourceMod::IMenuManager::IsVoteInProgress ( )
pure virtual

Returns whether or not a vote is in progress.

Returns
True if a vote is in progress, false otherwise.
virtual bool SourceMod::IMenuManager::RedrawClientVoteMenu ( int  client)
pure virtual

Redraws the current vote menu to a client in the voting pool.

Parameters
clientClient index.
Returns
True on success, false if client is not allowed to vote.
virtual bool SourceMod::IMenuManager::RedrawClientVoteMenu2 ( int  client,
bool  revotes 
)
pure virtual

Redraws the current vote menu to a client in the voting pool.

Parameters
clientClient index.
revotesTrue to allow revotes, false otherwise.
Returns
True on success, false if client is not allowed to vote.
virtual IMenuPanel* SourceMod::IMenuManager::RenderMenu ( int  client,
menu_states_t states,
ItemOrder  order 
)
pure virtual

Given a set of menu states, converts it to an IMenuPanel object.

The state parameter is both INPUT and OUTPUT. INPUT: menu, mh, firstItem, lastItem OUTPUT: display, firstItem, lastItem, slots

Parameters
clientClient index.
statesMenu states.
orderOrder to search for items.
Returns
IMenuPanel pointer, or NULL if no items could be found in the IBaseMenu pointer, or NULL if any other error occurred. Any valid pointer must be freed using IMenuPanel::DeleteThis.
virtual bool SourceMod::IMenuManager::StartVote ( IBaseMenu menu,
unsigned int  num_clients,
int  clients[],
unsigned int  max_time,
unsigned int  flags = 0 
)
pure virtual

Displays a menu as a vote.

Parameters
menuIBaseMenu pointer.
num_clientsNumber of clients to display to.
clientsClient index array.
max_timeMaximum time to hold menu for.
flagsVote flags.
Returns
True on success, false if a vote is in progress.

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