diff options
author | gumi <git@gumi.ca> | 2018-11-24 16:22:23 -0500 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-11-27 21:56:36 +0300 |
commit | cdd3c77337a6bbff0d51d174663867463db8cf15 (patch) | |
tree | 4366fb2a5958f296707227961b5e4f842698bcd6 /src/gui/windows/whoisonline.cpp | |
parent | d33ffd2ac6230059cce68ecae862d3bdc813b93d (diff) | |
download | plus-cdd3c77337a6bbff0d51d174663867463db8cf15.tar.gz plus-cdd3c77337a6bbff0d51d174663867463db8cf15.tar.bz2 plus-cdd3c77337a6bbff0d51d174663867463db8cf15.tar.xz plus-cdd3c77337a6bbff0d51d174663867463db8cf15.zip |
Show short group name when available instead of (GM)
Diffstat (limited to 'src/gui/windows/whoisonline.cpp')
-rw-r--r-- | src/gui/windows/whoisonline.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 37dbf2a89..bc16397ed 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -55,6 +55,8 @@ #include "net/playerhandler.h" #include "net/serverfeatures.h" +#include "resources/db/groupdb.h" + #include "utils/foreach.h" #include "utils/gettext.h" #include "utils/sdlhelper.h" @@ -471,7 +473,7 @@ void WhoIsOnline::loadWebList() OnlinePlayer *const player = new OnlinePlayer(nick, CAST_U8(255), level, - Gender::UNSPECIFIED, -1); + Gender::UNSPECIFIED, -1, 0); mOnlinePlayers.insert(player); mOnlineNicks.insert(nick); @@ -870,8 +872,15 @@ void OnlinePlayer::setText(std::string color) } } - if ((mStatus != 255 && ((mStatus & BeingFlag::GM) != 0)) || mIsGM) + if (GroupDb::getShowBadge(mGroup)) + { + const std::string name = GroupDb::getName(mGroup); + mText.append(strprintf("(%s) ", name.c_str())); + } + else if ((mStatus != 255 && ((mStatus & BeingFlag::GM) != 0)) || mIsGM) + { mText.append("(GM) "); + } if (mLevel > 0) mText.append(strprintf("%d", mLevel)); @@ -881,6 +890,9 @@ void OnlinePlayer::setText(std::string color) else if (mGender == Gender::MALE) mText.append("\u2642"); + if (GroupDb::getHighlightName(mGroup) && color == "0") + color = "2"; + if (mStatus > 0 && mStatus != 255) { if ((mStatus & BeingFlag::SHOP) != 0) |