Skip to content
CI edited this page Feb 10, 2026 · 12 revisions

SettingObject

Table containing the following entries:

key value type required
kind setting type SettingType yes
name label for the setting string yes
desc description for the setting string no
default default value for the setting any yes
get getter for the current value function yes
set setter for the new value function yes
disabled whether the setting should be disabled boolean/function no
hidden whether the setting should be hidden boolean/function no
  • The getter passes layoutName as the sole argument and expects a value in return.
  • The setter passes (layoutName, newValue, fromReset) and expects no returns.
  • The description is shown in a tooltip.
  • The disabled and hidden options, if added as functions, must return a boolean

Depending on the setting type there are additional required and optional entries:

Dropdown

key value type required
values indexed table containing DropdownOptions or a function that returns a compatible table table/function no
multiple whether the dropdown should allow selecing multiple options boolean no
generator Dropdown SetupMenu "generator" (callback) function no
height max height of the menu integer no
  • Either values or generator is required, the former for simple menues and the latter for complex ones.
    • They are not exclusive, but generator takes precedence (e.g. values will be available but not used).
  • generator signature is (dropdown, rootDescription, settingObject) - settingObject being the addition to the default arguments.
  • getters and setters are not handled using generator, and must be handled by the layout

DropdownOption

Table containing the following entries:

key value type required
text text rendered in the dropdown string yes
value value the text represents, defaults to the text if not provided any no

Slider

key value type required default
minValue lower bound for the slider number no 0
maxValue upper bound for the slider number no 1
valueStep step increment between each value number no 1
formatter formatter for the display value function no
  • The formatter passes value as the sole argument and expects a number value in return.

ColorPicker

key value type required default
hasOpacity whether or not to enable opacity boolean no false

The default field and the getter expects a ColorMixin object, and the setter will pass one as its value.
Even if hasOpacity is set to false (which is the default value) the ColorMixin object will contain an alpha value, this is the default behavior of the ColorMixin.

Divider

key value type required default
hideLabel whether or not to hide the label boolean no false

Expander

key value type required default
hideArrow whether or not to hide the arrow boolean no false
expandedLabel text to display when expanded string no
collapsedLabel text to display when collapsed string no

For expandedLabel or collapsedLabel to work both have to be defined. Otherwise the setting name will be used.

ButtonObject

Table containing the following entries:

key value type required
text text rendered on the button string yes
click callback when button is clicked function yes

SettingType

Table containing available setting types.

One of:

  • Dropdown
  • Checkbox
  • Slider
  • Divider
  • ColorPicker
  • Expander

Clone this wiki locally