group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
PauseMenu Class Reference

Lightweight in-game pause overlay. More...

#include <PauseMenu.hpp>

Collaboration diagram for PauseMenu:
[legend]

Public Member Functions

void open ()
 Open the pause menu on its root page.
void close ()
 Close the pause menu and discard any transient settings UI state.
bool isOpen () const
 Return true when the pause overlay is visible.
bool isSettingsOpen () const
 Return true when the settings page is the active pause-menu page.
bool handleEscape (const UserSettings &settings)
 Handle Escape according to the current menu page/listening state.
bool consumeEvent (const SDL_Event &event)
 Consume SDL input events while the pause menu owns keyboard/mouse focus.
PauseMenuResult render (UserSettings &settings, std::string_view settingsPath)
 Draw the pause/settings overlay and apply user settings when requested.

Private Types

enum class  PendingConfirm { None , LeaveMatch , ExitDesktop }

Private Member Functions

void openSettings (const UserSettings &settings)
 Enter settings page with a draft copy of the current live settings.

Private Attributes

bool menuOpen = false
 True when any pause overlay page is open.
SettingsEditor settingsEditor_
 Shared tabbed settings page.
ConfirmModal confirm_
 Reusable modal for destructive pause-menu actions.
PendingConfirm pendingConfirm_ = PendingConfirm::None
 Action awaiting confirmation.

Detailed Description

Lightweight in-game pause overlay.

Member Enumeration Documentation

◆ PendingConfirm

enum class PauseMenu::PendingConfirm
strongprivate
Enumerator
None 
LeaveMatch 
ExitDesktop 

Member Function Documentation

◆ close()

void PauseMenu::close ( )

Close the pause menu and discard any transient settings UI state.

Here is the call graph for this function:

◆ consumeEvent()

bool PauseMenu::consumeEvent ( const SDL_Event & event)

Consume SDL input events while the pause menu owns keyboard/mouse focus.

◆ handleEscape()

bool PauseMenu::handleEscape ( const UserSettings & settings)

Handle Escape according to the current menu page/listening state.

Returns
True when the caller should resume gameplay; false when Escape was consumed internally.

◆ isOpen()

bool PauseMenu::isOpen ( ) const
nodiscard

Return true when the pause overlay is visible.

◆ isSettingsOpen()

bool PauseMenu::isSettingsOpen ( ) const
nodiscard

Return true when the settings page is the active pause-menu page.

◆ open()

void PauseMenu::open ( )

Open the pause menu on its root page.

Here is the call graph for this function:

◆ openSettings()

void PauseMenu::openSettings ( const UserSettings & settings)
private

Enter settings page with a draft copy of the current live settings.

Here is the caller graph for this function:

◆ render()

PauseMenuResult PauseMenu::render ( UserSettings & settings,
std::string_view settingsPath )

Draw the pause/settings overlay and apply user settings when requested.

Here is the call graph for this function:

Member Data Documentation

◆ confirm_

ConfirmModal PauseMenu::confirm_
private

Reusable modal for destructive pause-menu actions.

◆ menuOpen

bool PauseMenu::menuOpen = false
private

True when any pause overlay page is open.

◆ pendingConfirm_

PendingConfirm PauseMenu::pendingConfirm_ = PendingConfirm::None
private

Action awaiting confirmation.

◆ settingsEditor_

SettingsEditor PauseMenu::settingsEditor_
private

Shared tabbed settings page.


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