diff options
Diffstat (limited to 'misc_gui.c')
-rw-r--r-- | misc_gui.c | 12 |
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: |