diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-10-31 19:39:09 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | 0f64ee5ce1548d9cda69917f27c5b1a3cb91823d (patch) | |
tree | 161f0e6ac300e604de61b8203b5a58279637f9eb /src/highscore_gui.cpp | |
parent | e740c24eb7a90bc771f5976d64d80639ee7576e5 (diff) | |
download | openttd-0f64ee5ce1548d9cda69917f27c5b1a3cb91823d.tar.xz |
Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
Diffstat (limited to 'src/highscore_gui.cpp')
-rw-r--r-- | src/highscore_gui.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index 0dfaebc3b..bf09b1b94 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -21,6 +21,7 @@ #include "strings_func.h" #include "hotkeys.h" #include "zoom_func.h" +#include "misc_cmd.h" #include "widgets/highscore_widget.h" @@ -96,7 +97,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) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + if (!_networking) Command<CMD_PAUSE>::Post(0, PM_PAUSED_NORMAL, 1, {}); this->background_img = SPR_TYCOON_IMG1_BEGIN; @@ -124,7 +125,7 @@ struct EndGameWindow : EndGameHighScoreBaseWindow { void Close() override { - if (!_networking) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); // unpause + if (!_networking) Command<CMD_PAUSE>::Post(0, PM_PAUSED_NORMAL, 0, {}); // unpause ShowHighscoreTable(this->window_number, this->rank); this->EndGameHighScoreBaseWindow::Close(); } @@ -159,7 +160,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { { /* pause game to show the chart */ this->game_paused_by_player = _pause_mode == PM_PAUSED_NORMAL; - if (!_networking && !this->game_paused_by_player) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 1); + if (!_networking && !this->game_paused_by_player) Command<CMD_PAUSE>::Post(0, PM_PAUSED_NORMAL, 1, {}); /* Close all always on-top windows to get a clean screen */ if (_game_mode != GM_MENU) HideVitalWindows(); @@ -174,7 +175,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { { if (_game_mode != GM_MENU) ShowVitalWindows(); - if (!_networking && !this->game_paused_by_player) DoCommandP(CMD_PAUSE, 0, PM_PAUSED_NORMAL, 0); // unpause + if (!_networking && !this->game_paused_by_player) Command<CMD_PAUSE>::Post(0, PM_PAUSED_NORMAL, 0, {}); // unpause this->EndGameHighScoreBaseWindow::Close(); } |