summaryrefslogtreecommitdiff
path: root/src/gui/whoisonline.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-28 21:00:12 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-28 21:00:12 +0300
commita93722a53e2d50466dfd5512c4a6a1c3dfc60fb1 (patch)
treeb4ade374e591f520ae49b1dcb3317b19d503f089 /src/gui/whoisonline.cpp
parente5695ad6c41d4deb79504998b2bc5caeb1e61285 (diff)
downloadmanaverse-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.tar.gz
manaverse-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.tar.bz2
manaverse-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.tar.xz
manaverse-a93722a53e2d50466dfd5512c4a6a1c3dfc60fb1.zip
Add support for processing player statuses in evol server.
Diffstat (limited to 'src/gui/whoisonline.cpp')
-rw-r--r--src/gui/whoisonline.cpp36
1 files changed, 33 insertions, 3 deletions
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index 34cfc1a57..e38f6ad73 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -402,7 +402,8 @@ void WhoIsOnline::loadWebList()
if (!mShowLevel)
level = 0;
- OnlinePlayer *player = new OnlinePlayer(nick, -1, level, -1);
+ OnlinePlayer *player = new OnlinePlayer(nick, 0, level,
+ GENDER_UNSPECIFIED, -1);
mOnlinePlayers.insert(player);
mOnlineNicks.insert(nick);
@@ -709,11 +710,40 @@ void WhoIsOnline::optionChanged(const std::string &name)
void OnlinePlayer::setText(std::string color)
{
- mText = strprintf("@@%s|##%s%s", mNick.c_str(),
+ mText = strprintf("@@%s|##%s%s ", mNick.c_str(),
color.c_str(), mNick.c_str());
+ if (actorSpriteManager)
+ {
+ Being *being = actorSpriteManager->findBeingByName(
+ mNick, Being::PLAYER);
+ if (being)
+ being->setState(mStatus);
+ }
+
if (mLevel > 0)
- mText += strprintf(" (%d)", mLevel);
+ mText += strprintf("%d", mLevel);
+
+ if (mGender == GENDER_FEMALE)
+ mText += "\u2640";
+ else if (mGender == GENDER_MALE)
+ mText += "\u2642";
+
+ if (mStatus > 0)
+ {
+ if (mStatus & Being::FLAG_SHOP)
+ mText += "$";
+ if (mStatus & Being::FLAG_AWAY)
+ {
+ // TRANSLATORS: this away status writed in player nick
+ mText += _("A");
+ }
+ if (mStatus & Being::FLAG_INACTIVE)
+ {
+ // TRANSLATORS: this inactive status writed in player nick
+ mText += _("I");
+ }
+ }
if (mVersion > 0)
mText += strprintf(" - %d", mVersion);