ui.* from a callback errors.
Tabs and groups
Elements can be organized into tabs and groups.Elements
Every element exists onui and on every group handle.
Every element except
TextInput gets a hotkey automatically. There is no Hotkey element.
Handles
Get and Set take a colon.
At load time,
Get() returns the declared default. Restored values are applied after loading.
Lists
ListBox is an always-open scrolling list with one selected row. handle:SetItems(table) replaces the whole list from any callback — that is how you build a list that grows.
SetItems accepts only strings. Selection stays at the same index when possible, clamps when the list shrinks, and becomes -1 when empty.
Text
TextInput is a one-line field. Read it with Get, or take handle:OnSubmit(fn) to be called when the user presses enter or leaves the field.
OnSubmit returns the handle for chaining. Pass nil to remove the handler. It can be called from callbacks.
Showing and hiding
handle:SetVisible(bool) on any handle, including Label and Divider. Siblings reflow, the group shrinks. Call it from a paint callback to drive it off another element:
Built-in controls
ui.Get and ui.Set read and write the cheat’s own controls (not the ones your script created, those use the handle above).
Buttons
Buttons have no value. Useui.Click(path) to activate one.
Errors if nothing matches the path, or if the path matches a control that is not a button. Works on script buttons too, by their path in the scripts tab.
The button callback runs on the thread that called
ui.Click.
Color pickers use Color. ui.Set(path, ui.Get(path)) preserves the solid color but not the picker’s rainbow or pulse mode.