summaryrefslogtreecommitdiff
path: root/src/gui/windows/statuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-12 22:11:56 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-13 00:47:48 +0300
commit5e70bf11d9715dec5678f787cee838ddbaaaf063 (patch)
tree75b18603dd649626aee29a1e2cfd51aef61bf582 /src/gui/windows/statuswindow.cpp
parentf085c8aed70d5efaaccfa7a4e2cac4a840935165 (diff)
downloadplus-5e70bf11d9715dec5678f787cee838ddbaaaf063.tar.gz
plus-5e70bf11d9715dec5678f787cee838ddbaaaf063.tar.bz2
plus-5e70bf11d9715dec5678f787cee838ddbaaaf063.tar.xz
plus-5e70bf11d9715dec5678f787cee838ddbaaaf063.zip
Show group name in being popup and status window.
Diffstat (limited to 'src/gui/windows/statuswindow.cpp')
-rw-r--r--src/gui/windows/statuswindow.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 5e79f6b73..c40ba819c 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -48,6 +48,7 @@
#include "net/inventoryhandler.h"
#include "net/playerhandler.h"
+#include "resources/db/groupdb.h"
#include "resources/db/unitsdb.h"
#include "resources/db/statdb.h"
@@ -259,12 +260,16 @@ void StatusWindow::addTabBasic(const std::string &name)
void StatusWindow::updateLevelLabel()
{
- if ((localPlayer != nullptr) && localPlayer->isGM())
+ const int groupId = localPlayer->getGroupId();
+ const std::string name = GroupDb::getName(groupId);
+ if (localPlayer != nullptr &&
+ !name.empty())
{
// TRANSLATORS: status window label
- mLvlLabel->setCaption(strprintf(_("Level: %d (GM %d)"),
+ mLvlLabel->setCaption(strprintf(_("Level: %d (%s %d)"),
PlayerInfo::getAttribute(Attributes::PLAYER_LEVEL),
- localPlayer->getGroupId()));
+ name.c_str(),
+ groupId));
}
else
{