newmenus
Browse all symbols documented inside this include file.
Constants
| Name | Description |
|---|---|
| _newmenus_included | — |
| MEXIT_ALL | = 1 |
| MEXIT_FORCE | Menu will have an exit option, even when pagination is disabled. There have to be less than 10 items in the menu or it won't appear. The exit option will be appended to the last item with no extra slot padding. If you want it in the 10th slot you have to pad it manually with menu_addblank2 |
| MEXIT_NEVER | Menu will not have an exit option |
| MPROP_PERPAGE | Number of items per page (param1 = number, 0=no paginating, 7=default) |
| MPROP_BACKNAME | Name of the back button (param1 = string) |
| MPROP_NEXTNAME | Name of the next button (param1 = string) |
| MPROP_EXITNAME | Name of the exit button (param1 = string) |
| MPROP_TITLE | Menu title text (param1 = string) |
| MPROP_EXIT | Exit functionality (param1 = number, see MEXIT constants) |
| MPROP_NOCOLORS | Sets whether colors are not auto (param1 = number, 0=default) |
| MPROP_NUMBER_COLOR | Color indicator to use for numbers (param1 = string, "\r"=default) |
| MPROP_PAGE_CALLBACK | Function to be called on Back and Next (param1 = string) public function(id, status, menu); where status is either MENU_BACK or MENU_MORE Pass NULL_STRING to disable the callback |
| MPROP_SHOWPAGE | Whether to show the page number in menu title (param1 = bool, true = default) |
| MEXIT_NORMAL | = 0 /* DEPRECATED, do not use (has no effect) */ |
| MENUPAD_NONE | = 0 /* DEPRECATED, do not use (has no effect) */ |
| MENUPAD_PAGE | = 1 /* DEPRECATED, do not use (has no effect) */ |
| MPROP_ORDER | = 7 /* DEPRECATED, do not use (has no effect) */ |
| MPROP_PADMENU | = 9 /* DEPRECATED, do not use (has no effect) */ |
Functions
| Name | Description |
|---|---|
| menu_create | Creates a new menu object. |
| menu_makecallback | Creates a menu item callback handler. |
| menu_additem | Adds an item to a menu. |
| menu_pages | Returns the number of pages in a menu. |
| menu_items | Returns the number of items in a menu. |
| menu_display | Displays a menu to one client. This should never be called from a handler when the item is less than 0 (i.e. calling this from a cancelled menu will result in an error). Starting with 1.8.3 this allows to specify a menu timeout similar to the show_menu native. If the menu exists on the client past the timeout *any* further action will send the MENU_TIMEOUT status code to the menu handler. That includes actions which would otherwise send MENU_EXIT, such as the client selecting an item or disconnecting and calling menu_cancel or menu_destroy on a live menu. |
| menu_find_id | Given a page on a menu and a keypress on that page, returns the item id selected. If the item is less than 0, a special option was chosen (such as MENU_EXIT). |
| menu_item_getinfo | Retrieves info about a menu item. |
| menu_item_setname | Sets an item's display text. |
| menu_item_setcmd | Sets an item's info string. |
| menu_item_setcall | Sets an item's callback. |
| menu_item_setaccess | Sets an item's access. |
| menu_destroy | Destroys a menu. Player menus will be cancelled (although may still linger on the HUD), and future attempts to access the menu resource will result in an error. This must be called if you create menus dynamically, otherwise you will leak memory. For normal dynamic menus, you will destroy the menu in the handler function (remembering to handle the case of a menu being cancelled, it must still be destroyed). |
| player_menu_info | Returns information about a menu (if any) the client is currently viewing. |
| menu_addblank | Adds a blank line to a menu. |
| menu_addtext | Adds a text line to a menu. |
| menu_addblank2 | Adds a blank line to a menu, always shifting the numbering down. |
| menu_addtext2 | Adds a text line to a menu, always shifting the numbering down. |
| menu_setprop | Sets a menu property. |
| menu_cancel | Cancels a player's menu, effectively forcing the player to select MENU_EXIT. The menu will still exist on their screen but any results are invalidated, and the callback is invoked. |