mirror of https://github.com/minetest/minetest.git
Add Invert Mouse checkbox
This commit is contained in:
parent
3b50b2766a
commit
368e1e8e8a
|
@ -62,6 +62,7 @@ enum
|
|||
// other
|
||||
GUI_ID_CB_AUX1_DESCENDS,
|
||||
GUI_ID_CB_DOUBLETAP_JUMP,
|
||||
GUI_ID_CB_INVERT_MOUSE
|
||||
};
|
||||
|
||||
GUIKeyChangeMenu::GUIKeyChangeMenu(gui::IGUIEnvironment* env,
|
||||
|
@ -185,6 +186,21 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
|
|||
offset += v2s32(0, 25);
|
||||
}
|
||||
|
||||
{
|
||||
s32 option_x = offset.X;
|
||||
s32 option_y = offset.Y + 5;
|
||||
u32 option_w = 380;
|
||||
{
|
||||
core::rect<s32> rect(0, 0, option_w, 30);
|
||||
rect += topleft + v2s32(option_x, option_y);
|
||||
const wchar_t *text = wgettext("Invert Mouse");
|
||||
Environment->addCheckBox(g_settings->getBool("invert_mouse"), rect, this,
|
||||
GUI_ID_CB_INVERT_MOUSE, text);
|
||||
delete[] text;
|
||||
}
|
||||
offset += v2s32(0, 25);
|
||||
}
|
||||
|
||||
{
|
||||
core::rect < s32 > rect(0, 0, 100, 30);
|
||||
rect += topleft + v2s32(size.X - 100 - 20, size.Y - 40);
|
||||
|
@ -238,6 +254,11 @@ bool GUIKeyChangeMenu::acceptInput()
|
|||
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
|
||||
g_settings->setBool("doubletap_jump", ((gui::IGUICheckBox*)e)->isChecked());
|
||||
}
|
||||
{
|
||||
gui::IGUIElement *e = getElementFromId(GUI_ID_CB_INVERT_MOUSE);
|
||||
if(e != NULL && e->getType() == gui::EGUIET_CHECK_BOX)
|
||||
g_settings->setBool("invert_mouse", ((gui::IGUICheckBox*)e)->isChecked());
|
||||
}
|
||||
|
||||
clearKeyCache();
|
||||
|
||||
|
|
Loading…
Reference in New Issue