summaryrefslogtreecommitdiff
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
parentf085c8aed70d5efaaccfa7a4e2cac4a840935165 (diff)
downloadmv-5e70bf11d9715dec5678f787cee838ddbaaaf063.tar.gz
mv-5e70bf11d9715dec5678f787cee838ddbaaaf063.tar.bz2
mv-5e70bf11d9715dec5678f787cee838ddbaaaf063.tar.xz
mv-5e70bf11d9715dec5678f787cee838ddbaaaf063.zip
Show group name in being popup and status window.
-rw-r--r--src/gui/popups/beingpopup.cpp15
-rw-r--r--src/gui/windows/statuswindow.cpp11
2 files changed, 23 insertions, 3 deletions
diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp
index 015134c9f..c9e9e8608 100644
--- a/src/gui/popups/beingpopup.cpp
+++ b/src/gui/popups/beingpopup.cpp
@@ -35,6 +35,8 @@
#include "resources/chatobject.h"
+#include "resources/db/groupdb.h"
+
#include "utils/gettext.h"
#include "utils/foreach.h"
#include "utils/stringutils.h"
@@ -168,6 +170,19 @@ void BeingPopup::show(const int x, const int y, Being *const b)
}
else
{
+ const int groupId = b->getGroupId();
+ const std::string groupName = GroupDb::getLongName(groupId);
+ if (!groupName.empty())
+ {
+ ptr = mLabels[num];
+ // TRANSLATORS: being popup label
+ ptr->setCaption(strprintf(_("Group: %s (%d)"),
+ groupName.c_str(),
+ groupId));
+ ptr->adjustSize();
+ num ++;
+ }
+
if (!(b->getPartyName().empty()))
{
ptr = mLabels[num];
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
{