summaryrefslogtreecommitdiff
path: root/src/gui/whoisonline.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-09 12:43:10 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-09 21:37:15 +0300
commit7de8936d864564b2a9fafaa74af84ec10e755388 (patch)
treeaaae9812510121cdc894e375b387b9f4b1a77c28 /src/gui/whoisonline.cpp
parent39172957623e0b91343e51e2694c78d9c3b1a5fe (diff)
downloadplus-7de8936d864564b2a9fafaa74af84ec10e755388.tar.gz
plus-7de8936d864564b2a9fafaa74af84ec10e755388.tar.bz2
plus-7de8936d864564b2a9fafaa74af84ec10e755388.tar.xz
plus-7de8936d864564b2a9fafaa74af84ec10e755388.zip
Hightlight gms in online list with "friends" color and letters (GM).
Diffstat (limited to 'src/gui/whoisonline.cpp')
-rw-r--r--src/gui/whoisonline.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index 503ce3758..8c2bfa6c9 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -375,9 +375,13 @@ void WhoIsOnline::loadWebList()
}
trim(nick);
+ bool isGM(false);
pos = lineStr.find(gmText, 0);
if (pos != std::string::npos)
+ {
lineStr = lineStr.substr(pos + gmText.length());
+ isGM = true;
+ }
trim(lineStr);
pos = lineStr.find("/", 0);
@@ -416,6 +420,9 @@ void WhoIsOnline::loadWebList()
mOnlinePlayers.insert(player);
mOnlineNicks.insert(nick);
+ if (isGM)
+ player->setIsGM(true);
+
numOnline++;
switch (player_relations.getRelation(nick))
{
@@ -747,6 +754,9 @@ void OnlinePlayer::setText(std::string color)
}
}
+ if ((mStatus != 255 && mStatus & Being::FLAG_GM) || mIsGM)
+ mText += "(GM) ";
+
if (mLevel > 0)
mText += strprintf("%d", mLevel);
@@ -769,9 +779,14 @@ void OnlinePlayer::setText(std::string color)
// TRANSLATORS: this inactive status writed in player nick
mText += _("I");
}
+
if (mStatus & Being::FLAG_GM && color == "0")
color = "2";
}
+ else if (mIsGM && color == "0")
+ {
+ color = "2";
+ }
if (mVersion > 0)
mText += strprintf(" - %d", mVersion);