Menu Class

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

Methods 14

Name Description
Menu

Creates a new, empty menu using the default style.

Display

Displays a menu to a client.

DisplayAt

Displays a menu to a client, starting from the given item.

AddItem

Appends a new item to the end of a menu.

InsertItem

Inserts an item into the menu before a certain position; the new item will be at the given position and all next items pushed forward.

RemoveItem

Removes an item from the menu.

RemoveAllItems

Removes all items from a menu.

GetItem

Retrieves information about a menu item.

SetTitle

Sets the menu's default title/instruction message.

GetTitle

Returns the text of a menu's title.

ToPanel

Creates a raw MenuPanel based off the menu's style. The Handle must be freed with CloseHandle().

Cancel

Cancels a menu from displaying on all clients. While the cancellation is in progress, this menu cannot be re-displayed to any clients.

DisplayVote

Broadcasts 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.

DisplayVoteToAll

Sends a vote menu to all clients. See VoteMenu() for more information.

Properties 9

Name Type Description
Paginationint

Get or set the menu's pagination.

OptionFlagsint

Get or set the menu's option flags.

ExitButtonbool

Returns whether or not the menu has an exit button. By default, menus have an exit button.

ExitBackButtonbool

Controls whether or not the menu has an "exit back" button. By default, menus do not have an exit back button.

NoVoteButtonbool

Sets whether or not the menu has a "no vote" button in slot 1. By default, menus do not have a no vote button.

VoteResultCallbackVoteHandler

Sets an advanced vote handling callback. If this callback is set, MenuAction_VoteEnd will not be called.

ItemCountint

Returns the number of items in a menu.

StyleHandle

Returns the menu style. The Handle is global and cannot be closed.

Selectionint

Returns the first item on the page of a currently selected menu.