|
Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
|
Scene for the settings menu. More...
#include <SettingsScene.hpp>
Public Types | |
| using | ChangeStateFn = std::function< void(GameState)> |
| Type alias for a function that changes the game state. | |
Public Member Functions | |
| SettingsScene (ecs::Registry &UiRegistry, Settings &settings, TranslationManager &translationManager, NetworkSyncSystem &network, graphics::UiFactory &uiFactory, std::function< void(GameState)> changeState) | |
| Constructor for SettingsScene. | |
| void | onEnter () override |
| Called when the scene is entered. | |
| void | onExit () override |
| Called when the scene is exited. | |
| void | handleEvent (const sf::Event &event) override |
| Handle an incoming event. | |
| void | update (float dt) override |
| Update the scene state. | |
Public Member Functions inherited from rtp::client::interfaces::IScene | |
| virtual | ~IScene (void)=default |
Private Attributes | |
| ecs::Registry & | _uiRegistry |
| Reference to the ECS registry. | |
| Settings & | _settings |
| Reference to the application settings. | |
| TranslationManager & | _translationManager |
| Reference to the translation manager. | |
| NetworkSyncSystem & | _network |
| Reference to the client network. | |
| graphics::UiFactory & | _uiFactory |
| UI Factory for creating UI components. | |
| ChangeStateFn | _changeState |
| Function to change the game state. | |
Scene for the settings menu.
This scene allows users to configure various application settings, such as audio levels, graphics options, and key bindings.
Definition at line 31 of file SettingsScene.hpp.
| using rtp::client::scenes::SettingsScene::ChangeStateFn = std::function<void(GameState)> |
Type alias for a function that changes the game state.
Definition at line 51 of file SettingsScene.hpp.
| rtp::client::scenes::SettingsScene::SettingsScene | ( | ecs::Registry & | UiRegistry, |
| Settings & | settings, | ||
| TranslationManager & | translationManager, | ||
| NetworkSyncSystem & | network, | ||
| graphics::UiFactory & | uiFactory, | ||
| std::function< void(GameState)> | changeState | ||
| ) |
Constructor for SettingsScene.
| registry | Reference to the ECS registry |
| settings | Reference to the application settings |
| network | Reference to the client network |
| window | Reference to the SFML render window |
Definition at line 20 of file SettingsScene.cpp.
|
overridevirtual |
Handle an incoming event.
| event | The event to handle. |
Implements rtp::client::interfaces::IScene.
Definition at line 238 of file SettingsScene.cpp.
References _changeState, and rtp::client::Menu.
|
overridevirtual |
Called when the scene is entered.
Implements rtp::client::interfaces::IScene.
Definition at line 35 of file SettingsScene.cpp.
References _changeState, _settings, _translationManager, _uiFactory, _uiRegistry, rtp::client::graphics::UiFactory::createButton(), rtp::client::graphics::UiFactory::createDropdown(), rtp::client::graphics::UiFactory::createSlider(), rtp::client::graphics::UiFactory::createText(), rtp::client::GamepadSettings, rtp::client::TranslationManager::get(), rtp::client::Settings::getColorBlindMode(), rtp::client::Settings::getDifficulty(), rtp::client::Settings::getLanguage(), rtp::client::Settings::getMasterVolume(), rtp::client::Settings::getMusicVolume(), rtp::client::Settings::getSfxVolume(), rtp::log::info(), rtp::client::KeyBindings, rtp::client::TranslationManager::loadLanguage(), rtp::client::Menu, rtp::client::Settings::save(), rtp::client::Settings::setColorBlindMode(), rtp::client::Settings::setDifficulty(), rtp::client::Settings::setLanguage(), rtp::client::Settings::setMasterVolume(), rtp::client::Settings::setMusicVolume(), and rtp::client::Settings::setSfxVolume().
|
overridevirtual |
Called when the scene is exited.
Implements rtp::client::interfaces::IScene.
Definition at line 232 of file SettingsScene.cpp.
References _settings, _translationManager, rtp::client::Settings::getLanguage(), and rtp::client::TranslationManager::loadLanguage().
|
overridevirtual |
Update the scene state.
| dt | Time delta since the last update. |
Implements rtp::client::interfaces::IScene.
Definition at line 247 of file SettingsScene.cpp.
|
private |
Function to change the game state.
Definition at line 81 of file SettingsScene.hpp.
Referenced by handleEvent(), and onEnter().
|
private |
Reference to the client network.
Definition at line 79 of file SettingsScene.hpp.
|
private |
Reference to the application settings.
Definition at line 77 of file SettingsScene.hpp.
|
private |
Reference to the translation manager.
Definition at line 78 of file SettingsScene.hpp.
|
private |
UI Factory for creating UI components.
Definition at line 80 of file SettingsScene.hpp.
Referenced by onEnter().
|
private |
Reference to the ECS registry.
Definition at line 76 of file SettingsScene.hpp.
Referenced by onEnter().