Changeset - r19942:03f7761b717f
[Not reviewed]
master
0 1 0
zuu - 11 years ago 2013-01-08 21:08:18
zuu@openttd.org
(svn r24898) -Fix: Don't unpause the game when closing the highscore window if it was already paused before the highscore screen was shown.
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/highscore_gui.cpp
Show inline comments
 
@@ -148,10 +148,13 @@ struct EndGameWindow : EndGameHighScoreB
 
};
 

	
 
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)
 
	{
 
		/* 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 */
 
		if (_game_mode != GM_MENU) HideVitalWindows();
 
@@ -166,7 +169,7 @@ struct HighScoreWindow : EndGameHighScor
 
	{
 
		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()
0 comments (0 inline, 0 general)