diff -r 62fc187935ea src/main_gui.cpp --- a/src/main_gui.cpp Sat Sep 19 23:45:09 2009 +0200 +++ b/src/main_gui.cpp Sun Sep 20 00:16:19 2009 +0200 @@ -34,6 +34,8 @@ #include "statusbar_gui.h" #include "tilehighlight_func.h" +#include "saveload/saveload.h" + #include "network/network.h" #include "network/network_func.h" #include "network/network_gui.h" @@ -250,7 +252,21 @@ * problem during the generating, resulting in random * assertions that are hard to trigger and debug */ if (IsGeneratingWorld()) return ES_NOT_HANDLED; - + + switch (keycode) { + case 'W' | WKC_CTRL: + case 'W' | WKC_META: + /* No point returning from the main menu to itself */ + if (_game_mode == GM_MENU) return ES_HANDLED; + if (_settings_client.gui.autosave_on_exit) { + DoExitSave(); + _switch_mode = SM_MENU; + } else { + AskExitToGameMenu(); + } + return ES_HANDLED; + } + if (keycode == WKC_BACKQUOTE) { IConsoleSwitch(); return ES_HANDLED;