mirror of https://github.com/OpenTTD/OpenTTD
(svn r24898) -Fix: Don't unpause the game when closing the highscore window if it was already paused before the highscore screen was shown.
parent
8f681a7a10
commit
fd8f5cff5d
|
@ -148,10 +148,13 @@ struct EndGameWindow : EndGameHighScoreBaseWindow {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HighScoreWindow : EndGameHighScoreBaseWindow {
|
struct HighScoreWindow : EndGameHighScoreBaseWindow {
|
||||||
|
bool game_paused_by_player; ///< True if the game was paused by the player when the highscore window was opened.
|
||||||
|
|
||||||
HighScoreWindow(const WindowDesc *desc, int difficulty, int8 ranking) : EndGameHighScoreBaseWindow(desc)
|
HighScoreWindow(const WindowDesc *desc, int difficulty, int8 ranking) : EndGameHighScoreBaseWindow(desc)
|
||||||
{
|
{
|
||||||
/* pause game to show the chart */
|
/* pause game to show the chart */
|
||||||
if (!_networking) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE);
|
this->game_paused_by_player = _pause_mode == PM_PAUSED_NORMAL;
|
||||||
|
if (!_networking && !this->game_paused_by_player) DoCommandP(0, PM_PAUSED_NORMAL, 1, CMD_PAUSE);
|
||||||
|
|
||||||
/* Close all always on-top windows to get a clean screen */
|
/* Close all always on-top windows to get a clean screen */
|
||||||
if (_game_mode != GM_MENU) HideVitalWindows();
|
if (_game_mode != GM_MENU) HideVitalWindows();
|
||||||
|
@ -166,7 +169,7 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow {
|
||||||
{
|
{
|
||||||
if (_game_mode != GM_MENU) ShowVitalWindows();
|
if (_game_mode != GM_MENU) ShowVitalWindows();
|
||||||
|
|
||||||
if (!_networking) DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); // unpause
|
if (!_networking && !this->game_paused_by_player) DoCommandP(0, PM_PAUSED_NORMAL, 0, CMD_PAUSE); // unpause
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnPaint()
|
virtual void OnPaint()
|
||||||
|
|
Loading…
Reference in New Issue