Skip to main content

Module settings

Module settings 

Source
Expand description

The player’s settings: the engine’s (how fast dialogue text is revealed, whether the game fills the screen, the color theme, the music and sound volumes, the frame cap and the layout picked) and the game’s own (Settings::game, a GameSettings). Ctx loads them with its storage, from one record under SETTINGS_KEY in the profile in use, whose form the game decides (GameSettings::to_ron); it saves them when they change (Ctx::change_settings). Key bindings are saved apart.

Structs§

Background
What a game does while its window has no focus (GameSettings::BACKGROUND): whether it pauses, and what its sound does. A game writes it from KEEP_RUNNING: Background::KEEP_RUNNING.paused().muted().
Settings
Everything an options screen sets: the engine’s settings and the game’s. The defaults are a new player’s.

Enums§

BackgroundAudio
What the game’s sound does while its window has no focus.
TextSpeed
How fast dialogue text is revealed.

Constants§

DEFAULT_VOLUME
The volume settings’ default. Tunable.
MAX_VOLUME
The loudest volume setting; 0 is silent.
SETTINGS_KEY
Storage key under which the settings are saved (Settings::to_ron).

Traits§

GameSettings
The settings a game adds to the engine’s, and the saved form of both: one record, so the game decides its form (and keeps the one it has always written).