From 798e4c6619bf19fa52658ff745ad1f28d4dcb586 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Sat, 9 Jul 2016 19:09:39 +0200 Subject: [PATCH] Remove support for input key config locking. Wasn't useful, isn't useful, and confused me to no end. Better to have this gone. --- Aquaria/AquariaMenuItem.cpp | 29 +++++++---------------------- Aquaria/AquariaMenuItem.h | 3 --- Aquaria/InGameMenu.cpp | 11 ++++------- Aquaria/InGameMenu.h | 2 +- 4 files changed, 12 insertions(+), 33 deletions(-) diff --git a/Aquaria/AquariaMenuItem.cpp b/Aquaria/AquariaMenuItem.cpp index 0a3e9cc..de4bb05 100644 --- a/Aquaria/AquariaMenuItem.cpp +++ b/Aquaria/AquariaMenuItem.cpp @@ -481,9 +481,6 @@ AquariaKeyConfig::AquariaKeyConfig(const std::string &actionInputName, InputSetT keyDown = false; - locked = 0; - - toggleEnterKey(false); } @@ -526,11 +523,6 @@ void AquariaKeyConfig::toggleEnterKey(int on) } -void AquariaKeyConfig::setLock(int lock) -{ - locked = lock; -} - void AquariaKeyConfig::onUpdate(float dt) { static bool inLoop = false; @@ -735,24 +727,17 @@ void AquariaKeyConfig::onUpdate(float dt) { keyDown = false; - if (!locked) + if (waitingForInput == this) { - if (waitingForInput == this) - { - waitingForInput = 0; - toggleEnterKey(0); - AquariaGuiElement::canDirMoveGlobal = true; - } - else - { - waitingForInput = this; - toggleEnterKey(1); - AquariaGuiElement::canDirMoveGlobal = false; - } + waitingForInput = 0; + toggleEnterKey(0); + AquariaGuiElement::canDirMoveGlobal = true; } else { - dsq->sound->playSfx("denied"); + waitingForInput = this; + toggleEnterKey(1); + AquariaGuiElement::canDirMoveGlobal = false; } } } diff --git a/Aquaria/AquariaMenuItem.h b/Aquaria/AquariaMenuItem.h index d62ecc9..dea87dd 100644 --- a/Aquaria/AquariaMenuItem.h +++ b/Aquaria/AquariaMenuItem.h @@ -170,10 +170,7 @@ public: static AquariaKeyConfig *waitingForInput; - void setLock(int lock); - protected: - int locked; void toggleEnterKey(int on); void onUpdate(float dt); diff --git a/Aquaria/InGameMenu.cpp b/Aquaria/InGameMenu.cpp index 4828b15..a150232 100644 --- a/Aquaria/InGameMenu.cpp +++ b/Aquaria/InGameMenu.cpp @@ -1490,7 +1490,7 @@ void InGameMenu::hide(bool effects, bool cancel) } -void InGameMenu::addKeyConfigLine(RenderObject *group, const std::string &label, const std::string &actionInputName, int y, int l1, int l2, int l3) +void InGameMenu::addKeyConfigLine(RenderObject *group, const std::string &label, const std::string &actionInputName, int y) { TTFText *lb = new TTFText(&dsq->fontArialSmallest); lb->setText(label); @@ -1499,17 +1499,14 @@ void InGameMenu::addKeyConfigLine(RenderObject *group, const std::string &label, AquariaKeyConfig *k1 = new AquariaKeyConfig(actionInputName, INPUTSET_KEY, 0); k1->position = Vector(350,y); - k1->setLock(l1); group->addChild(k1, PM_POINTER); AquariaKeyConfig *k2 = new AquariaKeyConfig(actionInputName, INPUTSET_KEY, 1); k2->position = Vector(475,y); - k2->setLock(l2); group->addChild(k2, PM_POINTER); AquariaKeyConfig *j1 = new AquariaKeyConfig(actionInputName, INPUTSET_JOY, 0); j1->position = Vector(600,y); - j1->setLock(l3); group->addChild(j1, PM_POINTER); k1->setDirMove(DIR_RIGHT, k2); @@ -1957,8 +1954,8 @@ void InGameMenu::create() header_joy->setAlign(ALIGN_CENTER); group_keyConfig->addChild(header_joy, PM_POINTER); - addKeyConfigLine(group_keyConfig, SB(2105), "lmb", 100+offy, 0, 0, 0); - addKeyConfigLine(group_keyConfig, SB(2106), "rmb", 120+offy, 0, 0, 0); + addKeyConfigLine(group_keyConfig, SB(2105), "lmb", 100+offy); + addKeyConfigLine(group_keyConfig, SB(2106), "rmb", 120+offy); addKeyConfigLine(group_keyConfig, SB(2107), "PrimaryAction", 140+offy); addKeyConfigLine(group_keyConfig, SB(2108), "SecondaryAction", 160+offy); addKeyConfigLine(group_keyConfig, SB(2109), "SwimUp", 180+offy); @@ -1968,7 +1965,7 @@ void InGameMenu::create() addKeyConfigLine(group_keyConfig, SB(2113), "Roll", 260+offy); addKeyConfigLine(group_keyConfig, SB(2114), "Revert", 280+offy); addKeyConfigLine(group_keyConfig, SB(2115), "WorldMap", 300+offy); - addKeyConfigLine(group_keyConfig, SB(2116), "Escape", 320+offy, 1, 0, 0); + addKeyConfigLine(group_keyConfig, SB(2116), "Escape", 320+offy); AquariaKeyConfig* s1x = addAxesConfigLine(group_keyConfig, SB(2117), "s1ax", 340+offy, 0); AquariaKeyConfig* s1y = addAxesConfigLine(group_keyConfig, SB(2118), "s1ay", 340+offy, 130); diff --git a/Aquaria/InGameMenu.h b/Aquaria/InGameMenu.h index 7b14863..ac31542 100644 --- a/Aquaria/InGameMenu.h +++ b/Aquaria/InGameMenu.h @@ -188,7 +188,7 @@ private: void onKeyConfig(); - void addKeyConfigLine(RenderObject *group, const std::string &label, const std::string &actionInputName, int y, int l1=0, int l2=0, int l3=0); + void addKeyConfigLine(RenderObject *group, const std::string &label, const std::string &actionInputName, int y); AquariaKeyConfig *addAxesConfigLine(RenderObject *group, const std::string &label, const std::string &actionInputName, int y, int offx);