aboutsummaryrefslogtreecommitdiff
path: root/src/guiKeyChangeMenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/guiKeyChangeMenu.cpp')
-rw-r--r--src/guiKeyChangeMenu.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp
index ae53c56f9..5e6380930 100644
--- a/src/guiKeyChangeMenu.cpp
+++ b/src/guiKeyChangeMenu.cpp
@@ -75,12 +75,9 @@ GUIKeyChangeMenu::GUIKeyChangeMenu(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id, IMenuManager *menumgr) :
GUIModalMenu(env, parent, id, menumgr)
{
- shift_down = false;
- activeKey = -1;
- this->key_used_text = NULL;
init_keys();
- for(size_t i=0; i<key_settings.size(); i++)
- this->key_used.push_back(key_settings.at(i)->key);
+ for (size_t i = 0; i < key_settings.size(); i++)
+ key_used.push_back(key_settings.at(i)->key);
}
GUIKeyChangeMenu::~GUIKeyChangeMenu()
@@ -115,7 +112,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
{
removeChildren();
v2s32 size(745, 430);
-
+
core::rect < s32 > rect(screensize.X / 2 - size.X / 2,
screensize.Y / 2 - size.Y / 2, screensize.X / 2 + size.X / 2,
screensize.Y / 2 + size.Y / 2);
@@ -124,7 +121,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
recalculateAbsolutePosition(false);
v2s32 topleft(0, 0);
-
+
{
core::rect < s32 > rect(0, 0, 600, 40);
rect += topleft + v2s32(25, 3);
@@ -163,7 +160,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
offset += v2s32(0, 25);
}
}
-
+
{
s32 option_x = offset.X;
s32 option_y = offset.Y + 5;
@@ -209,7 +206,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON,
text);
delete[] text;
- }
+ }
}
void GUIKeyChangeMenu::drawMenu()
@@ -279,10 +276,10 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
{
if (event.EventType == EET_KEY_INPUT_EVENT && activeKey >= 0
&& event.KeyInput.PressedDown) {
-
+
bool prefer_character = shift_down;
KeyPress kp(event.KeyInput, prefer_character);
-
+
bool shift_went_down = false;
if(!shift_down &&
(event.KeyInput.Key == irr::KEY_SHIFT ||