diff options
-rw-r--r-- | src/gui/whoisonline.cpp | 15 | ||||
-rw-r--r-- | src/gui/whoisonline.h | 8 |
2 files changed, 22 insertions, 1 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); diff --git a/src/gui/whoisonline.h b/src/gui/whoisonline.h index 4f70b24f9..1158ce03c 100644 --- a/src/gui/whoisonline.h +++ b/src/gui/whoisonline.h @@ -56,7 +56,8 @@ class OnlinePlayer mStatus(status), mLevel(level), mVersion(version), - mGender(gender) + mGender(gender), + mIsGM(false) { } @@ -66,6 +67,9 @@ class OnlinePlayer unsigned char getStaus() const { return mStatus; } + void setIsGM(bool b) + { mIsGM = b; } + char getVersion() const { return mVersion; } @@ -92,6 +96,8 @@ class OnlinePlayer char mVersion; unsigned char mGender; + + bool mIsGM; }; /** |