#include <public/extensions/ITopMenus.h>
Public Member Functions | |
| virtual unsigned int | AddToMenu (const char *name, TopMenuObjectType type, ITopMenuObjectCallbacks *callbacks, IdentityToken_t *owner, const char *cmdname, FlagBits flags, unsigned int parent)=0 |
| Creates and adds an object type type to the top menu. | |
| virtual void | RemoveFromMenu (unsigned int object_id)=0 |
| Removes an object from a menu. If the object has any children, those will be removed. | |
| virtual bool | DisplayMenu (int client, unsigned int hold_time, TopMenuPosition position)=0 |
| Sends the main menu to a given client. | |
| virtual bool | LoadConfiguration (const char *file, char *error, size_t maxlength)=0 |
| Loads a configuration file for organizing the menu. This forces all known categories to be re-sorted. | |
| virtual unsigned int | FindCategory (const char *name)=0 |
| Finds a category's ID by name. | |
| virtual unsigned int | AddToMenu2 (const char *name, TopMenuObjectType type, ITopMenuObjectCallbacks *callbacks, IdentityToken_t *owner, const char *cmdname, FlagBits flags, unsigned int parent, const char *info_string)=0 |
| Creates and adds an object type type to the top menu. | |
| virtual const char * | GetObjectInfoString (unsigned int object_id)=0 |
| Returns an object's info string. | |
| virtual const char * | GetObjectName (unsigned int object_id)=0 |
| Returns an object's name string. | |
Definition at line 165 of file ITopMenus.h.
| virtual unsigned int SourceMod::ITopMenu::AddToMenu | ( | const char * | name, | |
| TopMenuObjectType | type, | |||
| ITopMenuObjectCallbacks * | callbacks, | |||
| IdentityToken_t * | owner, | |||
| const char * | cmdname, | |||
| FlagBits | flags, | |||
| unsigned int | parent | |||
| ) | [pure virtual] |
Creates and adds an object type type to the top menu.
| name | Unique, string name to give the object. | |
| type | Object type. | |
| callbacks | ITopMenuObjectCallbacks pointer. | |
| owner | IdentityToken_t owner of the object. | |
| cmdname | Command name used for override access checks. If NULL or empty, access will not be Checked. | |
| flags | Default flag(s) to use for access checks. | |
| parent | Parent object, or 0 if none. Currently, categories cannot have a parent, and items must have a category parent. |
| virtual void SourceMod::ITopMenu::RemoveFromMenu | ( | unsigned int | object_id | ) | [pure virtual] |
Removes an object from a menu. If the object has any children, those will be removed.
| object_id | Object ID returned from AddToMenu. |
| virtual bool SourceMod::ITopMenu::DisplayMenu | ( | int | client, | |
| unsigned int | hold_time, | |||
| TopMenuPosition | position | |||
| ) | [pure virtual] |
Sends the main menu to a given client.
Once the menu is drawn to a client, the drawing order is cached. If text on the menu is rendered differently for the client's next viewing, the text will render properly, but its order will not change. The menu is sorted by its configuration. Remaining items are sorted in alphabetical order using the initial display text.
| client | Client index. | |
| hold_time | Time to hold the menu on the screen for. | |
| position | TopMenuPosition enumeration value. |
| virtual bool SourceMod::ITopMenu::LoadConfiguration | ( | const char * | file, | |
| char * | error, | |||
| size_t | maxlength | |||
| ) | [pure virtual] |
Loads a configuration file for organizing the menu. This forces all known categories to be re-sorted.
Only one configuration can be active at a time. Loading a new one will cause the old sorting to disappear.
| file | File path. | |
| error | Error buffer. | |
| maxlength | Maximum length of the error buffer. |
| virtual unsigned int SourceMod::ITopMenu::FindCategory | ( | const char * | name | ) | [pure virtual] |
Finds a category's ID by name.
| name | Category's name. |
| virtual unsigned int SourceMod::ITopMenu::AddToMenu2 | ( | const char * | name, | |
| TopMenuObjectType | type, | |||
| ITopMenuObjectCallbacks * | callbacks, | |||
| IdentityToken_t * | owner, | |||
| const char * | cmdname, | |||
| FlagBits | flags, | |||
| unsigned int | parent, | |||
| const char * | info_string | |||
| ) | [pure virtual] |
Creates and adds an object type type to the top menu.
| name | Unique, string name to give the object. | |
| type | Object type. | |
| callbacks | ITopMenuObjectCallbacks pointer. | |
| owner | IdentityToken_t owner of the object. | |
| cmdname | Command name used for override access checks. If NULL or empty, access will not be Checked. | |
| flags | Default flag(s) to use for access checks. | |
| parent | Parent object, or 0 if none. Currently, categories cannot have a parent, and items must have a category parent. | |
| info_string | Optional info string to attach to the object. Only 255 bytes of the string (including null terminator) will be stored. |
| virtual const char* SourceMod::ITopMenu::GetObjectInfoString | ( | unsigned int | object_id | ) | [pure virtual] |
Returns an object's info string.
| object_id | Object ID. |
| virtual const char* SourceMod::ITopMenu::GetObjectName | ( | unsigned int | object_id | ) | [pure virtual] |
Returns an object's name string.
| object_id | Object ID. |
1.5.1