Menu < Handle

Last Updated2020-08-07
Created At2014-07-05

A menu is a helper object for managing in-game menus.

Methods16
SymbolDescription
AddItemAppends a new item to the end of a menu.
CancelCancels a menu from displaying on all clients. While the cancellation is in progress, this menu cannot be re-displayed to any clients. The menu may still exist on the client's screen after this command. This simply verifies that the menu is not being used anywhere. If any vote is in progress on a menu, it will be cancelled.
DisplayDisplays a menu to a client.
DisplayAtDisplays a menu to a client, starting from the given item.
DisplayVoteBroadcasts a menu to a list of clients. The most selected item will be returned through MenuAction_End. On a tie, a random item will be returned from a list of the tied items. Note that MenuAction_VoteEnd and MenuAction_VoteStart are both default callbacks and do not need to be enabled.
DisplayVoteToAllSends a vote menu to all clients. See VoteMenu() for more information.
GetItemRetrieves information about a menu item.
GetTitleReturns the text of a menu's title.
InsertItemInserts an item into the menu before a certain position; the new item will be at the given position and all next items pushed forward.
MenuCreates a new, empty menu using the default style.
RemoveAllItemsRemoves all items from a menu.
RemoveItemRemoves an item from the menu.
SetClientMappingFills the client vote option mapping with user supplied values.
SetTitleSets the menu's default title/instruction message.
ShufflePerClientGenerates a per-client random mapping for the current vote options.
ToPanelCreates a raw MenuPanel based off the menu's style. The Handle must be freed with CloseHandle().
Properties9
SymbolTypeDescription
ExitBackButtonboolControls whether or not the menu has an "exit back" button. By default, menus do not have an exit back button. Exit Back buttons appear as "Back" on page 1 of paginated menus and have functionality defined by the user in MenuEnd_ExitBack.
ExitButtonboolReturns whether or not the menu has an exit button. By default, menus have an exit button.
ItemCountintReturns the number of items in a menu.
NoVoteButtonboolSets whether or not the menu has a "no vote" button in slot 1. By default, menus do not have a no vote button.
OptionFlagsintGet or set the menu's option flags. If a certain bit is not supported, it will be stripped before being set.
PaginationintGet or set the menu's pagination. If pagination is MENU_NO_PAGINATION, and the exit button flag is set, then the exit button flag is removed. It can be re-applied if desired.
SelectionintReturns the first item on the page of a currently selected menu. This is only valid inside a MenuAction_Select callback.
StyleHandleReturns the menu style. The Handle is global and cannot be closed.
VoteResultCallbackVoteHandlerSets an advanced vote handling callback. If this callback is set, MenuAction_VoteEnd will not be called.