Changeset - r14133:68a81a1cb372
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-01-02 16:05:27
rubidium@openttd.org
(svn r18690) -Fix [FS#3469]: some keys that open windows that want to be located relatively to the toolbars/statusbar could cause a crash when in one of the end game screens
1 file changed with 23 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/highscore_gui.cpp
Show inline comments
 
@@ -62,6 +62,29 @@ struct EndGameHighScoreBaseWindow : Wind
 
	{
 
		delete this;
 
	}
 

	
 
	virtual EventState OnKeyPress(uint16 key, uint16 keycode)
 
	{
 
		switch (keycode) {
 
			/* Keys for telling we want to go on */
 
			case WKC_RETURN:
 
			case WKC_ESC:
 
			case WKC_SPACE:
 
				delete this;
 
				return ES_HANDLED;
 

	
 
			/* Allow CTRL-Q to work like ALT-F4 in all cases */
 
			case 'Q' | WKC_CTRL:
 
			case 'Q' | WKC_META:
 
				return ES_NOT_HANDLED;
 

	
 
			default:
 
				/* We want to handle all keys; we don't want windows in
 
				 * the background to open. Especially the ones that do
 
				 * locate themselves based on the status-/toolbars. */
 
				return ES_HANDLED;
 
		}
 
	}
 
};
 

	
 
/** End game window shown at the end of the game */
0 comments (0 inline, 0 general)