diff options
| author | fschildt <florian.schildt@protonmail.com> | 2025-10-01 14:39:24 +0200 |
|---|---|---|
| committer | fschildt <florian.schildt@protonmail.com> | 2025-10-01 14:39:24 +0200 |
| commit | c68ff7241393c02e9544bdb283710251c9c4b27c (patch) | |
| tree | c6c8ce2cf460081681bd75922b21cb0a0353322d /src/games/minesweeper/Minesweeper.cpp | |
| parent | c775ca6133d93ed97359a6a50bd94a5563c740de (diff) | |
minesweeper: hotfix exit
Diffstat (limited to 'src/games/minesweeper/Minesweeper.cpp')
| -rw-r--r-- | src/games/minesweeper/Minesweeper.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/games/minesweeper/Minesweeper.cpp b/src/games/minesweeper/Minesweeper.cpp index 1f40b33..a1886ff 100644 --- a/src/games/minesweeper/Minesweeper.cpp +++ b/src/games/minesweeper/Minesweeper.cpp @@ -127,12 +127,15 @@ Minesweeper::Update(std::vector<SDL_Event>& events) ProcessEventDuringResume(event); } } + if (m_run_state == exit) { + return false; + } if (m_run_state == pause) { DrawBoard(); DrawPauseMenu(); } - else if (m_run_state == start_menu) { + else if (m_run_state == start) { DrawStartMenu(); } else if (m_run_state == resume) { @@ -143,8 +146,7 @@ Minesweeper::Update(std::vector<SDL_Event>& events) DrawGameOverMenu(); } - bool keep_running = m_run_state != exit; - return keep_running; + return true; } void @@ -307,7 +309,7 @@ Minesweeper::DrawPauseMenu() m_run_state = resume; } if (ImGui::Button("Restart")) { - m_run_state = start_menu; + m_run_state = start; } if (ImGui::Button("Exit")) { m_run_state = exit; @@ -318,7 +320,7 @@ Minesweeper::DrawPauseMenu() void Minesweeper::DrawStartMenu() { - ImGui::Begin("MinesweeperStartMenu"); + ImGui::Begin("MinesweeperStart"); if (ImGui::RadioButton("beginner", m_difficulty == beginner ? true : false)) { m_difficulty = beginner; } @@ -343,7 +345,7 @@ Minesweeper::DrawGameOverMenu() { ImGui::Begin("MinesweeperGameOverMenu"); if (ImGui::Button("Play Again")) { - m_run_state = start_menu; + m_run_state = start; } if (ImGui::Button("Exit")) { m_run_state = exit; |
