Access
All menu C++ functions are exposed to your Lua script via a single global table namedmenu. You access individual values by using the dot (.) or bracket ([]) operator on this table.
Menu Usage Example
Functions
This section lists all available C++ functions exposed within the globalmenu table. These functions allow you to register new widgets (labels, toggles, sliders, etc.), retrieve configuration values, and directly manipulate the user interface elements.
add_label
Registers a non-interactive label or section divider in the menu. Returns a boolean indicating the success of the item creation.The safe status for the widget. If
false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.add_toggle
Registers an interactive toggle switch widget in the menu. Returns a boolean indicating the success of the item creation.The unique configuration key used to get and set the toggle’s boolean value via
get_item and set_item.The safe status for the widget. If
false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.add_slider_int
Registers an interactive slider widget that allows selecting an integer value within a defined range. Returns a boolean indicating the success of the item creation.The unique configuration key used to get and set the slider’s integer value via
get_item and set_item.The safe status for the widget. If
false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.add_slider_float
Registers an interactive slider widget that allows selecting an floating-point value within a defined range. Returns a boolean indicating the success of the item creation.The unique configuration key used to get and set the slider’s floating-point value via
get_item and set_item.The safe status for the widget. If
false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.add_single_combo
Registers a single combo box widget that allows selecting a single item from a list of strings. Returns a boolean indicating the success of the item creation.The unique configuration key used to get and set the selected item’s index (as a number) via
get_item and set_item.The initial 0-based index (initial state) of the single combo box. Defaults to
0 (the first item).A Lua table (list) of strings defining the selectable options (e.g.,
{"Option A", "Option B"}). Defaults to an empty list.The safe status for the widget. If
false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.add_multi_combo
Registers a multi combo box widget that allows the user to select multiple items from a list of strings. Returns a boolean indicating the success of the item creation.The unique configuration key used to get and set the selected item indices (as a table of numbers) via
get_item and set_item.A Lua table (list) of numbers defining the initial 0-based indices (initial state) of the multi combo box (e.g.,
{0, 3, 4}). Defaults to an empty list.A Lua table (list) of strings defining the selectable options (e.g.,
{"Option A", "Option B"}). Defaults to an empty list.The safe status for the widget. If
false, the widget will be hidden when Hide Unsafe is enabled. Defaults to true.add_colorpicker
Registers a color picker widget that allows the user to choose an RGBA color. Returns a boolean indicating the success of the item creation.The unique configuration key used to get and set the colorpickers Color4 value via
get_item and set_item.The default color (initial state) for the picker. Defaults to a fully white color (1, 1, 1, 1).
If
true, the color picker will be inlayed further down below the last widget. Defaults to false.add_notification
Registers a notification widget that allows the user to optionally click a button with a callback.get_item
Get the value of a specific script configuration value.set_item
Set the value of a specific script configuration value. Returns a boolean indicating the success of the set.The new value to assign to the configuration. The value type must match the type of the configuration.