Codechange: Use EnumBitSet for PauseMode. (#13553)

This commit is contained in:
Peter Nelson
2025-02-14 08:30:04 +00:00
committed by GitHub
parent 3518d7e0f1
commit 6cf7a899e9
27 changed files with 113 additions and 118 deletions

View File

@@ -99,7 +99,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow {
EndGameWindow(WindowDesc &desc) : EndGameHighScoreBaseWindow(desc)
{
/* Pause in single-player to have a look at the highscore at your own leisure */
if (!_networking) Command<CMD_PAUSE>::Post(PM_PAUSED_NORMAL, true);
if (!_networking) Command<CMD_PAUSE>::Post(PauseMode::Normal, true);
this->background_img = SPR_TYCOON_IMG1_BEGIN;
@@ -127,7 +127,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow {
void Close([[maybe_unused]] int data = 0) override
{
if (!_networking) Command<CMD_PAUSE>::Post(PM_PAUSED_NORMAL, false); // unpause
if (!_networking) Command<CMD_PAUSE>::Post(PauseMode::Normal, false); // unpause
if (_game_mode != GM_MENU && !_exit_game) ShowHighscoreTable(this->window_number, this->rank);
this->EndGameHighScoreBaseWindow::Close();
}
@@ -161,8 +161,8 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow {
HighScoreWindow(WindowDesc &desc, int difficulty, int8_t ranking) : EndGameHighScoreBaseWindow(desc)
{
/* pause game to show the chart */
this->game_paused_by_player = _pause_mode == PM_PAUSED_NORMAL;
if (!_networking && !this->game_paused_by_player) Command<CMD_PAUSE>::Post(PM_PAUSED_NORMAL, true);
this->game_paused_by_player = _pause_mode == PauseMode::Normal;
if (!_networking && !this->game_paused_by_player) Command<CMD_PAUSE>::Post(PauseMode::Normal, true);
/* Close all always on-top windows to get a clean screen */
if (_game_mode != GM_MENU) HideVitalWindows();
@@ -177,7 +177,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow {
{
if (_game_mode != GM_MENU && !_exit_game) ShowVitalWindows();
if (!_networking && !this->game_paused_by_player) Command<CMD_PAUSE>::Post(PM_PAUSED_NORMAL, false); // unpause
if (!_networking && !this->game_paused_by_player) Command<CMD_PAUSE>::Post(PauseMode::Normal, false); // unpause
this->EndGameHighScoreBaseWindow::Close();
}