group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
SystemMenuOverlay.hpp
Go to the documentation of this file.
1#pragma once
2
6
7#include <SDL3/SDL_events.h>
8
9#include <string_view>
10
13{
14 bool settingsApplied = false;
15 bool exitToDesktop = false;
16};
17
20{
21public:
23 void open();
24
26 void close();
27
29 [[nodiscard]] bool isOpen() const;
30
32 void handleEscape(const UserSettings& settings);
33
35 bool consumeEvent(const SDL_Event& event);
36
38 SystemMenuOverlayResult render(UserSettings& settings, std::string_view settingsPath);
39
40private:
41 bool open_ = false;
44};
Definition ConfirmModal.hpp:22
Shared tabbed settings editor used by front-end screens and the pause menu.
Definition SettingsEditor.hpp:23
Shared Escape menu for non-gameplay screens.
Definition SystemMenuOverlay.hpp:20
SystemMenuOverlayResult render(UserSettings &settings, std::string_view settingsPath)
Draw the overlay and return any commands emitted this frame.
Definition SystemMenuOverlay.cpp:80
ConfirmModal confirm_
Definition SystemMenuOverlay.hpp:43
bool consumeEvent(const SDL_Event &event)
Consume input events while the overlay owns focus.
Definition SystemMenuOverlay.cpp:55
void handleEscape(const UserSettings &settings)
Handle Escape while the overlay is active.
Definition SystemMenuOverlay.cpp:37
bool open_
Definition SystemMenuOverlay.hpp:41
SettingsEditor settingsEditor_
Definition SystemMenuOverlay.hpp:42
void close()
Close the menu and discard transient settings state.
Definition SystemMenuOverlay.cpp:23
void open()
Open the system menu on its root page.
Definition SystemMenuOverlay.cpp:17
bool isOpen() const
True while the overlay is active.
Definition SystemMenuOverlay.cpp:32
Commands emitted by one system-menu overlay frame.
Definition SystemMenuOverlay.hpp:13
bool exitToDesktop
User confirmed exiting the application.
Definition SystemMenuOverlay.hpp:15
bool settingsApplied
Settings were applied and saved this frame.
Definition SystemMenuOverlay.hpp:14
Per-user gameplay settings loaded from SDL's pref-path TOML file.
Definition UserSettings.hpp:25