diff options
author | PilzAdam <PilzAdam@gmx.de> | 2013-01-03 19:51:52 +0100 |
---|---|---|
committer | PilzAdam <PilzAdam@gmx.de> | 2013-01-04 18:51:38 +0100 |
commit | 82fd83fd12e23ad7c61b4c7ae525be745b5236a5 (patch) | |
tree | 10ae8a3c7a1bec088944caab1ca0ea4960df78b8 /src/guiKeyChangeMenu.cpp | |
parent | b50da63852f2a2360d07cc2f1e29fc6844b15ccc (diff) | |
download | minetest-82fd83fd12e23ad7c61b4c7ae525be745b5236a5.tar.gz minetest-82fd83fd12e23ad7c61b4c7ae525be745b5236a5.tar.bz2 minetest-82fd83fd12e23ad7c61b4c7ae525be745b5236a5.zip |
Switch to fly mode if spacebar is doubleclicked
Can be turned off in the key change GUI or in minetest.conf via doubletab_space
Diffstat (limited to 'src/guiKeyChangeMenu.cpp')
-rw-r--r-- | src/guiKeyChangeMenu.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index 8f7c7245c..336b13e07 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -57,6 +57,7 @@ enum GUI_ID_KEY_RANGE_BUTTON, // other GUI_ID_CB_AUX1_DESCENDS, + GUI_ID_CB_DOUBLETAB_JUMP, }; GUIKeyChangeMenu::GUIKeyChangeMenu(gui::IGUIEnvironment* env, @@ -149,6 +150,20 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize) Environment->addCheckBox(g_settings->getBool("aux1_descends"), rect, this, GUI_ID_CB_AUX1_DESCENDS, wgettext("\"Use\" = climb down")); } + offset += v2s32(0, 25); + } + + { + s32 option_x = offset.X + 10; + s32 option_y = offset.Y; + u32 option_w = 220; + { + core::rect<s32> rect(0, 0, option_w, 30); + rect += topleft + v2s32(option_x, option_y); + Environment->addCheckBox(g_settings->getBool("doubletab_jump"), rect, this, + GUI_ID_CB_DOUBLETAB_JUMP, wgettext("Doubltab \"jump\" to toogle fly")); + } + offset += v2s32(0, 25); } { @@ -197,6 +212,11 @@ bool GUIKeyChangeMenu::acceptInput() if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) g_settings->setBool("aux1_descends", ((gui::IGUICheckBox*)e)->isChecked()); } + { + gui::IGUIElement *e = getElementFromId(GUI_ID_CB_DOUBLETAB_JUMP); + if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX) + g_settings->setBool("doubletab_jump", ((gui::IGUICheckBox*)e)->isChecked()); + } clearKeyCache(); return true; } |