Contain various methods to save and load settings
static SettingBuilder builder()
Get an instance of SettingBuilder
Return | |
SettingBuilder | An instance of SettingBuilder |
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 |
static any set(key: string, value: any)
Set the value to the key
Parameters | |
key | The key |
value | The value mapped to the key |
static void remove(key: string)
Remove a setting
Parameters | |
key | The key to remove |
static void clear()
Clear all settings
static void save()
Save the setting
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.
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 |
static void show()
Show the dialog from setDialog
© 2024 - Macrorify by KoK-CODE