submenu¶
Button Callbacks¶
Type | Script Root | Player Root |
---|---|---|
on_click |
- |
int index |
Toggle Callbacks¶
Type | Script Root | Player Root |
---|---|---|
on_click |
bool state |
int index, bool state |
Slider Int Callbacks¶
Type | Script Root | Script Root (w/ Toggle) | Player Root | Player Root (w/ Toggle) |
---|---|---|---|---|
on_click |
int value |
int value, bool state |
int index, int value |
int index, int value, bool state |
on_change |
int value |
int value, bool state |
int index, int value |
int index, int value, bool state |
Slider Float Callbacks¶
Type | Script Root | Script Root (w/ Toggle) | Player Root | Player Root (w/ Toggle) |
---|---|---|---|---|
on_click |
float value |
float value, bool state |
int index, float value |
int index, float value, bool state |
on_change |
float value |
float value, bool state |
int index, float value |
int index, float value, bool state |
Submenu Callbacks¶
Type | Script Root | Player Root |
---|---|---|
on_enter |
- |
int index |
on_exit |
- |
int index |
Text Input Callbacks¶
Type | Script Root | Player Root |
---|---|---|
on_submit |
string text |
int index, string text |
List Callbacks¶
Type | Script Root | Script Root (w/ Toggle) | Player Root | Player Root (w/ Toggle) |
---|---|---|---|---|
on_click |
string item |
string item, bool state |
int index, string item |
int index, string item, bool state |
on_change |
string item |
string item, bool state |
int index, string item |
int index, string item, bool state |
is_valid¶
bool submenu.is_valid()
is_focused¶
bool submenu.is_focused()
get_label¶
string submenu.get_label()
set_label¶
void submenu.set_label(string label)
add_separator¶
option submenu.add_separator(string label)
add_button¶
option submenu.add_button(string label, string[] hints, function on_click)
Example Usage
add_toggle¶
option submenu.add_toggle(string label, string[] hints, function on_click)
Example Usage
add_slider_int¶
option submenu.add_slider_int(string label, int initial_value, int minimum, int maximum, int step, bool has_toggle, string[] hints, function on_click, function on_change)
Example Usage
add_slider_float¶
option submenu.add_slider_float(string label, float initial_value, float minimum, float maximum, float step, bool has_toggle, string[] hints, function on_click, function on_change)
Example Usage
-- w/ toggle
local opt = sub:add_slider_float("Example", 5.0, 1.0, 10.0, 1.0, true, { "Example Hint" }, function(value, state)
-- do something on click
end, nil)
-- w/o toggle
local opt = sub:add_slider_float("Example", 5.0, 1.0, 10.0, 1.0, false, { "Example Hint" }, nil, function(value)
-- do something on change
end)
add_submenu¶
submenu, option submenu.add_submenu(string label, string[] hints, function on_enter, function on_exit)
Creates and adds a submenu option to the submenu and returns a reference to the submenu and option created
Example Usage
add_text_input¶
option submenu.add_text_input(string label, string initial_text, int max_length, bool clear_before, bool clear_after, string[] hints, function on_submit)
Example Usage
add_list¶
option submenu.add_list(string label, string[] items, bool has_toggle, string[] hints, function on_click, function on_change)
Example Usage
-- w/ toggle
local opt = sub:add_list("Example", { "Item 1", "Item 2" }, true, { "Example Hint" }, function(value, state)
-- do something on click
end, nil)
-- w/o toggle
local opt = sub:add_list("Example", { "Item 1", "Item 2" }, false, { "Example Hint" }, nil, function(value)
-- do something on change
end)
add_colour¶
option submenu.add_colour(string label, bool initial_red, bool initial_green, bool initial_blue, bool initial_alpha, string[] hints)