Skip to main content

Crate bevy_settings

Crate bevy_settings 

Source
Expand description

Framework for saving and loading user settings files in Bevy applications.

The core of the framework is SettingsPlugin, which loads and synchronizes settings with the filesystem or browser local storage, depending on platform.

Settings are loaded into resources that implement SettingsGroup, which is best implemented using the derive macro SettingsGroup. In addition, the resource must have the #[reflect(SettingsGroup, Default)] annotation in order to be saved and loaded by the plugin.

Once all these conditions are met, and when SettingsPlugin is added, systems can query for settings using Res and ResMut like any other resource.

Refer to SettingsPlugin for detailed usage information.

Structs§

ReflectSettingsGroup
Reflected data from a SettingsGroup.
SaveSettingsDeferred
A Command which saves changed settings after a delay. This is debounced: issuing this command multiple times resets the delay timer each time. This is meant to be used for settings which change at a high frequency, such as dragging a slider which controls the game’s audio volume. The default delay is 1.0 seconds.
SettingsPlugin
Plugin to orchestrate loading and saving settings.

Enums§

SaveSettings
A Command which saves settings to disk. Actual file system operations happen in another thread.
SaveSettingsSync
A Command which saves settings to disk. This blocks the command queue until saving is complete.

Traits§

SettingsGroup
Trait which identifies a type as corresponding to a section with a settings file.

Derive Macros§

SettingsGroup
Implement SettingsGroup.