|
Aegis2D
Modular C++26 2D game engine for networked games
|
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. | |
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.
| 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).
| settings | Settings read with platform::read_settings() or core::Config. |
| section | Dotted path given to 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.
| settings | Settings to update, then saved with core::Config::save(). |
| section | Dotted path of the object holding the choice; empty for the root. |
| bool aegis2d::render::EffectSettings::flashes = true |
Whether full-screen flashes are shown.
| bool aegis2d::render::EffectSettings::shake = true |
Whether the screen shakes.