From 5e70bf11d9715dec5678f787cee838ddbaaaf063 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 12 Jul 2017 22:11:56 +0300 Subject: Show group name in being popup and status window. --- src/gui/windows/statuswindow.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/gui/windows/statuswindow.cpp') 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 { -- cgit v1.2.3-60-g2f50