CPP-TOOLBOX
Loading...
Searching...
No Matches
InputGraphicsSoundMenu Class Reference

Handles all user interface (UI) states related to input, graphics, and sound configuration. More...

#include <input_graphics_sound_menu.hpp>

Public Member Functions

 InputGraphicsSoundMenu (Window &window, InputState &input_state, Batcher &batcher, SoundSystem &sound_system, Configuration &configuration)
 Constructs an InputGraphicsSoundMenu and initializes all UIs and configuration handlers.
 
void process_and_queue_render_menu (Window &window, InputState &input_state, IUIRenderSuite &ui_render_suite)
 Processes and queues the rendering of all active menu UIs.
 

Public Attributes

bool enabled = true
 
UIState curr_state = UIState::MAIN_MENU
 
UI main_menu_ui
 
UI about_ui
 
UI settings_menu_ui
 
UI player_settings_ui
 
UI input_settings_ui
 
UI sound_settings_ui
 
UI graphics_settings_ui
 
UI advanced_settings_ui
 
std::map< UIState, UI & > game_state_to_ui
 

Detailed Description

Handles all user interface (UI) states related to input, graphics, and sound configuration.

This class manages multiple UI panels including main menu, settings menus, and submenus for sound, graphics, input, and player settings. It integrates input, configuration, sound, and rendering systems to create an interactive settings menu for the engine or game.

Warning
The class currently depends on InputState only for key validity checks. This should be removed once key validation is decoupled.

Constructor & Destructor Documentation

◆ InputGraphicsSoundMenu()

InputGraphicsSoundMenu::InputGraphicsSoundMenu ( Window & window,
InputState & input_state,
Batcher & batcher,
SoundSystem & sound_system,
Configuration & configuration )
inline

Constructs an InputGraphicsSoundMenu and initializes all UIs and configuration handlers.

Parameters
windowReference to the main Window.
input_stateReference to the InputState used for handling input bindings.
batcherReference to the Batcher used for UI rendering.
sound_systemReference to the SoundSystem for playing UI sounds.
configurationReference to the Configuration object managing persistent settings.
Note
This constructor also registers configuration handlers for graphics-related settings (resolution, fullscreen, wireframe) and applies configuration logic upon initialization.
Exceptions
std::invalid_argumentIf a configuration handler attempts to parse an invalid setting string.

Member Function Documentation

◆ process_and_queue_render_menu()

void InputGraphicsSoundMenu::process_and_queue_render_menu ( Window & window,
InputState & input_state,
IUIRenderSuite & ui_render_suite )
inline

Processes and queues the rendering of all active menu UIs.

Parameters
windowReference to the main window.
input_stateReference to the input state.
ui_render_suiteReference to the UI render suite implementation responsible for drawing the UI.
Note
This function will automatically render all UIs dependent on the current UI state.
Warning
Ensure that a valid IUIRenderSuite implementation (such as ui_render_suite_implementation) is provided before calling this function, a sample implementation using the toolbox_engine is here: https://github.com/cpp-toolbox/ui_render_suite_implementation

Member Data Documentation

◆ about_ui

UI InputGraphicsSoundMenu::about_ui

◆ advanced_settings_ui

UI InputGraphicsSoundMenu::advanced_settings_ui

◆ curr_state

UIState InputGraphicsSoundMenu::curr_state = UIState::MAIN_MENU

◆ enabled

bool InputGraphicsSoundMenu::enabled = true

◆ game_state_to_ui

std::map<UIState, UI &> InputGraphicsSoundMenu::game_state_to_ui
Initial value:
= {
}
UI main_menu_ui
Definition input_graphics_sound_menu.hpp:61
UI graphics_settings_ui
Definition input_graphics_sound_menu.hpp:62
UI player_settings_ui
Definition input_graphics_sound_menu.hpp:61
UI about_ui
Definition input_graphics_sound_menu.hpp:61
UI advanced_settings_ui
Definition input_graphics_sound_menu.hpp:62
UI input_settings_ui
Definition input_graphics_sound_menu.hpp:61
UI sound_settings_ui
Definition input_graphics_sound_menu.hpp:61
UI settings_menu_ui
Definition input_graphics_sound_menu.hpp:61
@ SETTINGS_MENU
Definition input_graphics_sound_menu.hpp:17
@ ABOUT
Definition input_graphics_sound_menu.hpp:24
@ SOUND_SETTINGS
Definition input_graphics_sound_menu.hpp:20
@ INPUT_SETTINGS
Definition input_graphics_sound_menu.hpp:19
@ ADVANCED_SETTINGS
Definition input_graphics_sound_menu.hpp:22
@ MAIN_MENU
Definition input_graphics_sound_menu.hpp:15
@ GRAPHICS_SETTINGS
Definition input_graphics_sound_menu.hpp:21
@ PROGRAM_SETTINGS
Definition input_graphics_sound_menu.hpp:18

◆ graphics_settings_ui

UI InputGraphicsSoundMenu::graphics_settings_ui

◆ input_settings_ui

UI InputGraphicsSoundMenu::input_settings_ui

◆ main_menu_ui

UI InputGraphicsSoundMenu::main_menu_ui

◆ player_settings_ui

UI InputGraphicsSoundMenu::player_settings_ui

◆ settings_menu_ui

UI InputGraphicsSoundMenu::settings_menu_ui

◆ sound_settings_ui

UI InputGraphicsSoundMenu::sound_settings_ui

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