summaryrefslogtreecommitdiff
path: root/src/gui/windows/charselectdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/windows/charselectdialog.cpp')
-rw-r--r--src/gui/windows/charselectdialog.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index 3ee5e5218..c7a2e0eef 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -47,6 +47,7 @@
#include "net/character.h"
#include "net/charserverhandler.h"
#include "net/logindata.h"
+#include "net/loginhandler.h"
#ifdef TMWA_SUPPORT
#include "net/net.h"
#endif // TMWA_SUPPORT
@@ -71,9 +72,13 @@ CharSelectDialog::CharSelectDialog(LoginData &data) :
ActionListener(),
KeyListener(),
mLoginData(&data),
- // TRANSLATORS: char select dialog. button.
- mSwitchLoginButton(new Button(this, _("Switch"), "switch",
- BUTTON_SKIN, this)),
+ mSwitchLoginButton(new Button(this,
+ (loginHandler != nullptr && loginHandler->getWorlds().size() > 1)
+ // TRANSLATORS: char select dialog. button.
+ ? _("Switch World") : _("Logout"),
+ "switch",
+ BUTTON_SKIN,
+ this)),
// TRANSLATORS: char select dialog. button.
mChangePasswordButton(new Button(this, _("Password"), "change_password",
BUTTON_SKIN, this)),
@@ -620,7 +625,7 @@ bool CharSelectDialog::selectByName(const std::string &name,
void CharSelectDialog::close()
{
- client->setState(State::SWITCH_LOGIN);
+ client->setState(State::SWITCH_WORLD);
Window::close();
}