Returns true if the option reference is still valid
function option.is_valid(): bool
-- example usage
local valid = opt:is_valid()
Returns the label of the option
function option.get_label(): string
-- example usage
local label = opt:get_label()
Unavailable on internal options
Sets the label of the option
function option.set_label(label: string): void
-- example usage
opt:set_label("Example")
Unavailable on internal options
Returns the type of the option
function option.get_type(): string
-- example usage
local type = opt:get_type()
Returns the current state of the toggle associated with the option where applicable
function option.get_toggle(): bool
-- example usage
local state = opt:get_toggle()
Sets the current state associated with the option where applicable
function option.set_toggle(state: bool, save_to_state: bool? --[[false]]): void
-- example usage
opt:set_toggle(false) -- sets the state to false
The argument save_to_state is only available on internal options
Returns the current value associated with the option where applicable
function option.get_value(): float|int|nil
-- example usage
local value = opt:get_value()
Sets the current value associated with the option where applicable
function option.set_value(value: float|int, save_to_state: bool? --[[false]]): void
-- example usage
opt:set_value(1.0) -- sets the value to 1.0
The argument save_to_state is only available on internal options
Returns the current text associated with the option where applicable
function option.get_text(): string
-- example usage
local text = opt:get_text()
Sets the current text associated with the option where applicable
function option.set_text(text: string, save_to_state: bool? --[[false]]): void
-- example usage
opt:set_text("Example") -- sets the text to "Example"
The argument save_to_state is only available on internal options
Returns the current colour associated with the option where applicable
function option.get_colour(): float, float, float, float
-- example usage
local r, g, b, a = opt:get_colour()
Sets the current colour associated with the option where applicable
function option.set_colour(red: float, green: float, blue: float, alpha: float, save_to_state: bool? --[[false]]): void
-- 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
The argument save_to_state is only available on internal options
Returns the current item associated with the option where applicable
function option.get_item(): string
-- example usage
local item = opt:get_item()
Sets the current item associated with the option where applicable
function option.set_item(item: string, save_to_state: bool? --[[false]]): void
-- example usage
opt:set_item("Example") -- sets the current item to "Example" if present in the list
The argument save_to_state is only available on internal options
Adds the provided hint to the option
function option.add_hint(hint: string): void
-- example usage
opt:add_hint("Example")
Unavailable on internal options
Removes the provided hint from the option
function option.del_hint(hint: string): void
-- example usage
opt:del_hint("Example")
Unavailable on internal options