summaryrefslogtreecommitdiff
path: root/misc_gui.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-07-22 09:16:34 +0000
committerDarkvater <Darkvater@openttd.org>2005-07-22 09:16:34 +0000
commitcd70c105fbc41e79df86c455e891600e3aa172dd (patch)
tree377f287714a94f712dba04bd0376256a9e691fd9 /misc_gui.c
parentaed6f08640c3865ebb48bc6bd151d747262ec9f0 (diff)
downloadopenttd-cd70c105fbc41e79df86c455e891600e3aa172dd.tar.xz
(svn r2675) - Fix: pressing enter on a load-window resulted in saving the game (Luca)
Diffstat (limited to 'misc_gui.c')
-rw-r--r--misc_gui.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/misc_gui.c b/misc_gui.c
index cbe7a71be..9a9aa8f5d 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -1315,10 +1315,14 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
HandleEditBox(w, 9);
break;
case WE_KEYPRESS:
- switch (HandleEditBoxKey(w, 9, e)) {
- case 1:
- HandleButtonClick(w, 11);
- break;
+ if (e->keypress.keycode == WKC_ESC) {
+ DeleteWindow(w);
+ return;
+ }
+
+ if (_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO) {
+ if (HandleEditBoxKey(w, 9, e) == 1) /* Press Enter */
+ HandleButtonClick(w, 11);
}
break;
case WE_TIMEOUT: