|
TraGUS
Godot plugin for user settings
|
The base abstraction for a user setting. Implementors must be set up as autoloads to work properly. More...
Public Member Functions | |
| bool | GdTryUpdateValue (GodotObject sender, Variant value) |
| A gdscript-friendly adaptater of TryUpdateValue. | |
| bool | TryUpdateValue (GodotObject sender, Variant value, out Variant effectiveValue) |
| Tries to update the value of this setting. | |
| bool | Reset () |
| Tries to reset the setting to the value specified in tragus_default_settings.ini. | |
| bool | Default (out Variant value) |
Tries to retrieve the default value of this setting from tragus_default_settings.ini. | |
| Variant | GdDefault () |
A gdscript compatible adaptater of Default. It falls back to the setting DefaultFallBack() if no corresponding entry is found in tragus_default_settings.ini. | |
| delegate void | ChangedEventHandler (GodotObject sender, Variant value) |
| Emited when the value of this setting has changed. | |
| virtual Variant | DefaultFallBack () |
| A value to be used if the value can't be initialized from .ini config files. You can leave it as is, or specify a fallback behavior if needed. | |
| virtual Variant | Serialized (Variant value) |
| Allows to define some custom serialization behavior, for more complex settings type, lists, etc. If you want to ensure a specific format. | |
| virtual bool | TryDeserialize (Variant value, out Variant deserialized) |
| Allows to define some custom deserialization behavior, for more complex settings type, lists, etc. If you want to ensure a specific format. | |
| override void | _EnterTree () |
| override void | _ExitTree () |
Protected Member Functions | |
| bool | ProcessValue (Variant value, out Variant effectiveValue) |
| Defines the underlying behavior tied to this setting, provided a new value to be set. It could be for example, resizing the game's window, changing the engine's max frame rate, or other configuration more specific to your game. | |
| virtual void | PreInitialize () |
| Called right after the singleton has been initalized, and right before it is registered, or its fields are initialized. Allows for some further custom initialization. | |
Properties | |
| static UserSetting | Instance [get, private set] |
| The autoload Instance of this setting. | |
| Variant | Value [get, private set] |
| The current value of this setting. | |
| string | Section [get] |
| The .ini section associated to this setting. By convention, use snake_case. | |
| string | Key [get] |
| The .ini key associated to this setting. By convention, use snake_case. | |
The base abstraction for a user setting. Implementors must be set up as autoloads to work properly.