Skip to content

option


is_valid

bool option.is_valid()

Returns true if the option reference is still valid
Example Usage
local valid = opt:is_valid()

get_label

string option.get_label()

Returns the label of the option
Example Usage
local label = opt:get_label()

Note

Unavailable on internal options


set_label

void option.set_label(string label)

Sets the label of the option
Example Usage
opt:set_label("Example")

Note

Unavailable on internal options


get_type

string option.get_type()

Returns the type of the option
Example Usage
local type = opt:get_type()

get_toggle

bool option.get_toggle()

Returns the current state of the toggle associated with the option where applicable
Example Usage
local state = opt:get_toggle()

set_toggle

void option.set_toggle(bool state, bool? save_to_state = false)

Sets the current state associated with the option where applicable
Example Usage
opt:set_toggle(false) -- sets the state to false

Note

The argument 'save_to_state' is only available on internal options


get_value

float|int|nil option.get_value()

Returns the current value associated with the option where applicable
Example Usage
local value = opt:get_value()

set_value

void option.set_value(float|int value, bool? save_to_state = false)

Sets the current value associated with the option where applicable
Example Usage
opt:set_value(1.0) -- sets the value to 1.0

Note

The argument 'save_to_state' is only available on internal options


get_text

string option.get_text()

Returns the current text associated with the option where applicable
Example Usage
local text = opt:get_text()

set_text

void option.set_text(string text, bool? save_to_state = false)

Sets the current text associated with the option where applicable
Example Usage
opt:set_text("Example") -- sets the text to "Example"

Note

The argument 'save_to_state' is only available on internal options


get_colour

float, float, float, float option.get_colour()

Returns the current colour associated with the option where applicable
Example Usage
local r, g, b, a = opt:get_colour()

set_colour

void option.set_colour(float red, float green, float blue, float alpha, bool? save_to_state = false)

Sets the current colour associated with the option where applicable
Example Usage
opt:set_colour(1.0, 1.0, 1.0, 1.0) -- sets the colour to 1.0, 1.0, 1.0, 1.0

Note

The argument 'save_to_state' is only available on internal options


get_item

string option.get_item()

Returns the current item associated with the option where applicable
Example Usage
local item = opt:get_item()

set_item

void option.set_item(string item, bool? save_to_state = false)

Sets the current item associated with the option where applicable
Example Usage
opt:set_item("Example") -- sets the current item to "Example" if present in the list

Note

The argument 'save_to_state' is only available on internal options


add_hint

void option.add_hint(string hint)

Adds the provided hint to the option
Example Usage
opt:add_hint("Example")

Note

Unavailable on internal options


del_hint

void option.del_hint(string hint)

Removes the provided hint from the option
Example Usage
opt:del_hint("Example")

Note

Unavailable on internal options