summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-01-02 16:05:27 +0000
committerrubidium <rubidium@openttd.org>2010-01-02 16:05:27 +0000
commit43a5a4bee8b2121c713782b8f5f1136cbf5e5b53 (patch)
treedce13226633621b4479dc8a113f1081e52504263
parent35c79d81efc9be5fbe1da473a359bdad2ed3fc07 (diff)
downloadopenttd-43a5a4bee8b2121c713782b8f5f1136cbf5e5b53.tar.xz
(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
-rw-r--r--src/highscore_gui.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp
index 02563533d..d4e8c4b13 100644
--- a/src/highscore_gui.cpp
+++ b/src/highscore_gui.cpp
@@ -62,6 +62,29 @@ struct EndGameHighScoreBaseWindow : Window {
{
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 */