summaryrefslogtreecommitdiff
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
commit290bb2fda692f9015643858be62ff55e952f0c9d (patch)
tree377f287714a94f712dba04bd0376256a9e691fd9
parentaa29ee6eda861ceac08d226a6d7e1de5dae74749 (diff)
downloadopenttd-290bb2fda692f9015643858be62ff55e952f0c9d.tar.xz
(svn r2675) - Fix: pressing enter on a load-window resulted in saving the game (Luca)
-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: