aboutsummaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 12bc695a6..774d8f03e 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "server.h"
#include "guiPasswordChange.h"
#include "guiVolumeChange.h"
+#include "guiKeyChangeMenu.h"
#include "guiFormSpecMenu.h"
#include "tool.h"
#include "guiChatConsole.h"
@@ -151,6 +152,11 @@ struct LocalFormspecHandler : public TextDest
return;
}
+ if (fields.find("btn_key_config") != fields.end()) {
+ g_gamecallback->keyConfig();
+ return;
+ }
+
if (fields.find("btn_exit_menu") != fields.end()) {
g_gamecallback->disconnect();
return;
@@ -1044,6 +1050,8 @@ static void show_pause_menu(GUIFormSpecMenu** cur_formspec,
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_sound;"
<< wide_to_narrow(wstrgettext("Sound Volume")) << "]";
+ os << "button_exit[4," << (ypos++) << ";3,0.5;btn_key_config;"
+ << wide_to_narrow(wstrgettext("Change Keys")) << "]";
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_menu;"
<< wide_to_narrow(wstrgettext("Exit to Menu")) << "]";
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_os;"
@@ -1877,6 +1885,14 @@ void the_game(bool &kill, bool random_input, InputHandler *input,
g_gamecallback->changevolume_requested = false;
}
+ if(g_gamecallback->keyconfig_requested)
+ {
+ (new GUIKeyChangeMenu(guienv, guiroot, -1,
+ &g_menumgr))->drop();
+ g_gamecallback->keyconfig_requested = false;
+ }
+
+
/* Process TextureSource's queue */
tsrc->processQueue();