Register
string
required
Registering it again replaces it.
string
required
table[]
required
1 to 100 items.
UgPosition
Defaults to
settings.menuPosition.function
(index, scrollIndex, args) on the select key.function
(index, scrollIndex, args) when the selection moves.function
(index, scrollIndex, args).function
(index, checked, args).function
Closed without a closing selection.
boolean
default:"true"
The back key closes.
boolean
default:"false"
Blocks movement and combat while open.
label, description (shown while selected), icon, values (side-scroll labels), defaultIndex, checked (makes a checkbox, not with values), progress, close (default true) and args. scrollIndex is nil for items without values.
Keys
ug-lib owns the keys: up, down, left, right, select and back, withsettings.menuKeys as defaults. Players MAY rebind them. They do nothing while a modal is open.
- Select on a checkbox toggles it. Select on an item with
close = falsecallsonSelectand stays open. Otherwise the menu closes afteronSelect. - One menu at a time: a new menu from any resource replaces the open one, and the old one’s
onCloseruns. SetItemchangeslabel,description,icon,values,checkedorprogressof an item. An open menu updates in place and keeps its selection.
Example
client.lua