Setting

Contain various methods to save and load settings

Static Methods
builder
static SettingBuilder builder()

Get an instance of SettingBuilder

Return
SettingBuilder An instance of SettingBuilder
get
static any get(key: string, defaultValue: any)

Get a value mapped to the key. The return value type depend on the View you created with the builder (RadioGroup return number, CheckBox return bool etc...)

defaultValue is returned when no value is mapped to the key

Parameters
key The key
defaultValue returned when no value is mapped to the key
Return
any The value mapped to the key
set
static any set(key: string, value: any)

Set the value to the key

Parameters
key The key
value The value mapped to the key
remove
static void remove(key: string)

Remove a setting

Parameters
key The key to remove
clear
static void clear()

Clear all settings

save
static void save()

Save the setting

loadVars
static void loadVars()

Reload all the variables made using the UI with the setting's latest values. You should call this if the dialog is made in UI but called in code.

setDialog
static void setDialog(dialog: Dialog)

Set the main Dialog. Call this as the last call in Setting Builder in Edit Mode if you write your Setting in code in order for "Custom Setting" in Play Mode to work. show() will show this Dialog

Parameters
dialog The Dialog
show
static void show()

Show the dialog from setDialog

© 2024 - Macrorify by KoK-CODE