diff options
author | jak1 <mike.wollmann@gmail.com> | 2021-06-06 14:19:05 +0200 |
---|---|---|
committer | jak1 <mike.wollmann@gmail.com> | 2021-06-06 14:21:38 +0200 |
commit | 534de91101fca098a8cc3878295cf4ce529810b7 (patch) | |
tree | 271febb65fb55c70c5135ad9f7a9e2f6dfe46aa5 /src/gui | |
parent | 971db6eb1db5fcf4e463b3a92ad2d73ad375193f (diff) | |
download | manaverse-534de91101fca098a8cc3878295cf4ce529810b7.tar.gz manaverse-534de91101fca098a8cc3878295cf4ce529810b7.tar.bz2 manaverse-534de91101fca098a8cc3878295cf4ce529810b7.tar.xz manaverse-534de91101fca098a8cc3878295cf4ce529810b7.zip |
disable logout option in unique sessions (-S)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/charselectdialog.cpp | 15 | ||||
-rw-r--r-- | src/gui/windows/quitdialog.cpp | 8 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index b9f1f8bc8..741b41d65 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -25,6 +25,7 @@ #include "client.h" #include "configuration.h" #include "pincodemanager.h" +#include "settings.h" #include "listeners/charrenamelistener.h" @@ -93,14 +94,17 @@ CharSelectDialog::CharSelectDialog(LoginData &data) : mSmallScreen(mainGraphics->getWidth() < 470 || mainGraphics->getHeight() < 370) { - setCloseButton(true); + setCloseButton(!settings.options.uniqueSession); setFocusable(true); ContainerPlacer placer(nullptr, nullptr); placer = getPlacer(0, 0); - placer(0, 0, mSwitchLoginButton, 1, 1); - + // disable logout using -S + if (!settings.options.uniqueSession) + { + placer(0, 0, mSwitchLoginButton, 1, 1); + } int n = 1; placer(n, 0, mChangePasswordButton, 1, 1); n ++; @@ -371,8 +375,9 @@ void CharSelectDialog::keyPressed(KeyEvent &event) { case InputAction::GUI_CANCEL: event.consume(); - action(ActionEvent(mSwitchLoginButton, - mSwitchLoginButton->getActionEventId())); + if (!settings.options.uniqueSession) + action(ActionEvent(mSwitchLoginButton, + mSwitchLoginButton->getActionEventId())); break; case InputAction::GUI_RIGHT: diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp index ed3cb5c8a..34e0c1976 100644 --- a/src/gui/windows/quitdialog.cpp +++ b/src/gui/windows/quitdialog.cpp @@ -24,6 +24,7 @@ #include "client.h" #include "configuration.h" +#include "settings.h" #include "soundmanager.h" #include "const/sound.h" @@ -88,8 +89,11 @@ QuitDialog::QuitDialog(QuitDialog **const pointerToMe) : { // Only added if we are connected to an accountserver or gameserver placeOption(placer, mLogoutQuit); - placeOption(placer, mSwitchAccountServer); - + if(!settings.options.uniqueSession) + { + // Only shown if we are not in a uniqueSession + placeOption(placer, mSwitchAccountServer); + } // Only added if we are connected to a gameserver if (state == State::GAME) placeOption(placer, mSwitchCharacter); |