App Settings
Flexible application settings system built around hierarchical keys and staged value changes.
Designed for settings menus, configuration management and global project settings.
Supports validation, readonly settings, apply callbacks and efficient per-frame batched signals for detecting changes.
Features
- Hierarchical setting keys (
graphics/fullscreen,audio/volume) - Staged mode for settings menus (queue changes before committing them)
- Optional readonly mode to prevent modification
- Custom validation callbacks
- Apply callbacks for triggering side effects (e.g. updating resolution)
- Immediate and per-frame batched change signals
- Metadata support for building automatic settings UIs
- Serialize and load settings using
ConfigFile - Designed to be used as a global autoload
Usage
Create an autoload that extends AppSettings ("res://addons/kenyoni/app_settings/app_settings.gd") (for example GameSettings).
This allows settings to be accessed globally and ensures the batched signals are emitted correctly.
Registering Settings
GameSettings.add_setting(
Setting.new(&"graphics/fullscreen", false)
.set_description("Enable fullscreen mode")
.set_apply_fn(func(s): DisplayServer.window_set_mode(...))
.set_validate_fn(func(_s, v): return v is bool)
)
Loading Settings
GameSettings.from_config(config)
GameSettings.apply_all()
Staged Changes (Settings Menus)
GameSettings.get_setting(&"audio/volume").set_staged(true)
GameSettings.set_value(&"audio/volume", 0.8)
# apply queued changes
GameSettings.apply_staged_values()
# or discard them
GameSettings.discard_staged_values()
Saving Settings
GameSettings.to_config().save("user://settings.cfg")
Documentation & Examples
Full documentation and examples:
https://kenyoni-software.github.io/godot-addons/addons/app_settings
Changelog for version 1.0.1
No changelog provided for this version.