aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiKeyChangeMenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/guiKeyChangeMenu.cpp')
-rw-r--r--src/gui/guiKeyChangeMenu.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/gui/guiKeyChangeMenu.cpp b/src/gui/guiKeyChangeMenu.cpp
index ca97e0b9e..f3d8e8eef 100644
--- a/src/gui/guiKeyChangeMenu.cpp
+++ b/src/gui/guiKeyChangeMenu.cpp
@@ -77,6 +77,7 @@ enum
// other
GUI_ID_CB_AUX1_DESCENDS,
GUI_ID_CB_DOUBLETAP_JUMP,
+ GUI_ID_CB_AUTOJUMP,
};
GUIKeyChangeMenu::GUIKeyChangeMenu(gui::IGUIEnvironment* env,
@@ -196,6 +197,21 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
}
{
+ s32 option_x = offset.X;
+ s32 option_y = offset.Y + 5;
+ u32 option_w = 280;
+ {
+ core::rect<s32> rect(0, 0, option_w, 30);
+ rect += topleft + v2s32(option_x, option_y);
+ const wchar_t *text = wgettext("Automatic jumping");
+ Environment->addCheckBox(g_settings->getBool("autojump"), rect, this,
+ GUI_ID_CB_AUTOJUMP, text);
+ delete[] text;
+ }
+ offset += v2s32(0, 25);
+ }
+
+ {
core::rect < s32 > rect(0, 0, 100, 30);
rect += topleft + v2s32(size.X / 2 - 105, size.Y - 40);
const wchar_t *text = wgettext("Save");
@@ -239,14 +255,19 @@ bool GUIKeyChangeMenu::acceptInput()
{
gui::IGUIElement *e = getElementFromId(GUI_ID_CB_AUX1_DESCENDS);
- if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ if(e && e->getType() == gui::EGUIET_CHECK_BOX)
g_settings->setBool("aux1_descends", ((gui::IGUICheckBox*)e)->isChecked());
}
{
gui::IGUIElement *e = getElementFromId(GUI_ID_CB_DOUBLETAP_JUMP);
- if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
+ if(e && e->getType() == gui::EGUIET_CHECK_BOX)
g_settings->setBool("doubletap_jump", ((gui::IGUICheckBox*)e)->isChecked());
}
+ {
+ gui::IGUIElement *e = getElementFromId(GUI_ID_CB_AUTOJUMP);
+ if(e && e->getType() == gui::EGUIET_CHECK_BOX)
+ g_settings->setBool("autojump", ((gui::IGUICheckBox*)e)->isChecked());
+ }
clearKeyCache();