TraGUS
Godot plugin for user settings
Loading...
Searching...
No Matches
ExampleResolutionUserSetting Class Reference

This is an example of how to implement UserSetting. This setting controls the game's resolution. More...

Inheritance diagram for ExampleResolutionUserSetting:
[legend]
Collaboration diagram for ExampleResolutionUserSetting:
[legend]

Public Member Functions

override 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.
 
- Public Member Functions inherited from UserSetting
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 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

override bool ProcessValue (Variant value, out Variant effectiveValue)
 
- Protected Member Functions inherited from UserSetting
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

override string Section [get]
 
override string Key [get]
 
- Properties inherited from UserSetting
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.
 

Detailed Description

This is an example of how to implement UserSetting. This setting controls the game's resolution.

To work properly, you must add it as an autoload, and make sure it loads after the UserSettingsServer (that is, it is lower in the autoloads list).


The documentation for this class was generated from the following file: