summaryrefslogtreecommitdiff
path: root/src/gui/char_select.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-09-14 00:57:03 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-09-14 00:57:03 +0000
commit535ac50a68c17e421230875fea05fd1161a92fe6 (patch)
tree62cddbe1350c775c439da4fde561ee93918f837f /src/gui/char_select.cpp
parentc4529dbd7b7f8f3ae5009d35010139e7f1b68deb (diff)
downloadmana-535ac50a68c17e421230875fea05fd1161a92fe6.tar.gz
mana-535ac50a68c17e421230875fea05fd1161a92fe6.tar.bz2
mana-535ac50a68c17e421230875fea05fd1161a92fe6.tar.xz
mana-535ac50a68c17e421230875fea05fd1161a92fe6.zip
Fix up the player selection stuff, it's a bit nicer now.
Diffstat (limited to 'src/gui/char_select.cpp')
-rw-r--r--src/gui/char_select.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index c52f73a9..6da0f64d 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -228,6 +228,26 @@ void CharSelectDialog::logic()
updatePlayerInfo();
}
+bool CharSelectDialog::selectByName(const std::string &name)
+{
+ if (mCharInfo->isLocked())
+ return false;
+
+ unsigned int oldPos = mCharInfo->getPos();
+
+ mCharInfo->select(0);
+ do {
+ LocalPlayer *player = mCharInfo->getEntry();
+
+ if (player && player->getName() == name)
+ return true;
+ } while (mCharInfo->getPos());
+
+ mCharInfo->select(oldPos);
+
+ return false;
+}
+
std::string CharSelectDialog::getName()
{
return mNameLabel->getCaption();