diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-03-08 02:10:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-03-08 02:10:06 +0300 |
commit | 6b3b81988ea37207eeeb2994761e307c6b6fb340 (patch) | |
tree | 7882a30bfb0e7a855e671af9a10d574c89bfd26f /src/gui/windows/charselectdialog.cpp | |
parent | 5d190c3ae47aef32c1f1fe48f36dd27cec721cf3 (diff) | |
download | manaplus-6b3b81988ea37207eeeb2994761e307c6b6fb340.tar.gz manaplus-6b3b81988ea37207eeeb2994761e307c6b6fb340.tar.bz2 manaplus-6b3b81988ea37207eeeb2994761e307c6b6fb340.tar.xz manaplus-6b3b81988ea37207eeeb2994761e307c6b6fb340.zip |
Dont allow select/delete character if any pincode modes active.
Diffstat (limited to 'src/gui/windows/charselectdialog.cpp')
-rw-r--r-- | src/gui/windows/charselectdialog.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 817ecd908..d48a1a162 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -24,6 +24,7 @@ #include "client.h" #include "configuration.h" +#include "pincodemanager.h" #include "listeners/charrenamelistener.h" @@ -195,9 +196,12 @@ void CharSelectDialog::action(const ActionEvent &event) selected = mCharacterView->getSelected(); const std::string &eventId = event.getId(); + const bool blocked = pincodeManager.isBlocked(); if (selected >= 0) { + if (blocked) + return; if (eventId == "use") { use(selected); @@ -273,14 +277,20 @@ void CharSelectDialog::action(const ActionEvent &event) } else if (eventId == "change_password") { + if (blocked) + return; client->setState(State::CHANGEPASSWORD); } else if (eventId == "change_email") { + if (blocked) + return; client->setState(State::CHANGEEMAIL); } else if (eventId == "try delete character") { + if (blocked) + return; if ((mDeleteDialog != nullptr) && mDeleteIndex != -1) { if (serverFeatures->haveEmailOnDelete()) @@ -331,6 +341,7 @@ void CharSelectDialog::use(const int selected) void CharSelectDialog::keyPressed(KeyEvent &event) { const InputActionT actionId = event.getActionId(); + const bool blocked = pincodeManager.isBlocked(); PRAGMA45(GCC diagnostic push) PRAGMA45(GCC diagnostic ignored "-Wswitch-enum") switch (actionId) @@ -403,6 +414,8 @@ void CharSelectDialog::keyPressed(KeyEvent &event) case InputAction::GUI_DELETE: { + if (blocked) + return; event.consume(); const int idx = mCharacterView->getSelected(); if (idx >= 0 && (mCharacterEntries[idx] != nullptr) @@ -415,6 +428,8 @@ void CharSelectDialog::keyPressed(KeyEvent &event) case InputAction::GUI_SELECT: { + if (blocked) + return; event.consume(); use(mCharacterView->getSelected()); break; |