Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::render::EffectSettings Struct Reference

The player's choice about screen flashes and shake. More...

#include <aegis2d/render/screen_effects.hpp>

Public Member Functions

void save (core::Config &settings, std::string_view section) const
 Writes the choice into the player's settings.
 
void load (const core::Config &settings, std::string_view section)
 Reads the choice written by save().
 

Public Attributes

bool flashes = true
 Whether full-screen flashes are shown.
 
bool shake = true
 Whether the screen shakes.
 

Detailed Description

The player's choice about screen flashes and shake.

Flashes can trigger seizures in players with photosensitive epilepsy, and shake can cause motion sickness: a settings menu offers to turn them off, and the choice is kept in the player's settings.

Member Function Documentation

◆ load()

void aegis2d::render::EffectSettings::load ( const core::Config &  settings,
std::string_view  section 
)

Reads the choice written by save().

A value missing from the settings, or which is not a boolean, keeps its value (logged as a warning when it is not a boolean).

Parameters
settingsSettings read with platform::read_settings() or core::Config.
sectionDotted path given to save().

◆ save()

void aegis2d::render::EffectSettings::save ( core::Config &  settings,
std::string_view  section 
) const

Writes the choice into the player's settings.

{"accessibility": {"flashes": false, "shake": false}} for the section "accessibility"; other settings are left as they are.

Parameters
settingsSettings to update, then saved with core::Config::save().
sectionDotted path of the object holding the choice; empty for the root.

Member Data Documentation

◆ flashes

bool aegis2d::render::EffectSettings::flashes = true

Whether full-screen flashes are shown.

◆ shake

bool aegis2d::render::EffectSettings::shake = true

Whether the screen shakes.


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