Skip to main content

GetMenuData

on top of your client scripts add this to get the menu data setters and getters
table
The menu data

CloseAll

Close all menus

RegisterControls

Register custom keyboard, mouse, or wheel controls handled by vorp_menu’s NUI layer.This is useful when you want menu-like input handling outside of an opened menu.
table
required
Array of controls to listen for.Supported values:
  • Any browser keyboard key string from KeyboardEvent.key, for example e, ArrowUp, Enter, or Backspace
  • scrollup
  • scrolldown
  • mousepress
function
required
Callback fired with the triggered control name.
Notes:
  • Keyboard keys and mousepress repeat every frame while held until release.
  • scrollup and scrolldown fire once per wheel event.
  • mousepress ignores middle click and returns mousepress_left or mousepress_right in the callback.
  • If a menu is open, these menu keys are reserved and will not trigger custom callbacks: ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Enter, Escape, Backspace.
  • Calling RegisterControls again replaces previously registered controls in the UI layer.
  • Call Menu.UnregisterControls() when you no longer need the listeners.

UnregisterControls

Remove all controls previously registered with RegisterControls.
Menu elements are the elements that will be displayed in the menu

Functions

update elements ,add ,remove ,get elements runtime
this function will add a new element to the current menu elements by order
string
required
The label of the element
string
required
The value of the element
string
required
The description of the element
refresh menu to show new element

Events

  • close menu event
  • open menu event