summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-06-02 03:11:08 +0300
committerAndrei Karas <akaras@inbox.ru>2011-06-02 03:11:08 +0300
commit205b331825d2d100a442d2d0399d477850d395d3 (patch)
tree1fd773e2af0234b78945364d9e7cfe21d4f2a9da
parent2f2ec6025c0eb43c475964187d815d6598b00f01 (diff)
downloadplus-205b331825d2d100a442d2d0399d477850d395d3.tar.gz
plus-205b331825d2d100a442d2d0399d477850d395d3.tar.bz2
plus-205b331825d2d100a442d2d0399d477850d395d3.tar.xz
plus-205b331825d2d100a442d2d0399d477850d395d3.zip
Add players gender sugn in popup menus and being popups.
-rw-r--r--src/being.cpp22
-rw-r--r--src/being.h2
-rw-r--r--src/gui/beingpopup.cpp2
-rw-r--r--src/gui/popupmenu.cpp5
4 files changed, 21 insertions, 10 deletions
diff --git a/src/being.cpp b/src/being.cpp
index e38e60026..944a05cb8 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -1455,6 +1455,20 @@ void Being::flashName(int time)
mDispName->flash(time);
}
+std::string Being::getGenderSign() const
+{
+ if (config.getBoolValue("showgender"))
+ {
+ if (getGender() == GENDER_FEMALE)
+ return "\u2640";
+ else if (getGender() == GENDER_MALE)
+ return "\u2642";
+ else
+ return "";
+ }
+ return "";
+}
+
void Being::showName()
{
delete mDispName;
@@ -1469,13 +1483,7 @@ void Being::showName()
if (config.getBoolValue("showlevel") && getLevel() != 0)
mDisplayName += toString(getLevel());
- if (config.getBoolValue("showgender"))
- {
- if (getGender() == GENDER_FEMALE)
- mDisplayName += "\u2640";
- else if (getGender() == GENDER_MALE)
- mDisplayName += "\u2642";
- }
+ mDisplayName += getGenderSign();
}
if (getType() == MONSTER)
diff --git a/src/being.h b/src/being.h
index 3313f40ba..b2a92d3df 100644
--- a/src/being.h
+++ b/src/being.h
@@ -721,6 +721,8 @@ class Being : public ActorSprite, public ConfigListener
void setGoodStatus(int n)
{ mGoodStatus = n; }
+ std::string getGenderSign() const;
+
static void clearCache();
protected:
diff --git a/src/gui/beingpopup.cpp b/src/gui/beingpopup.cpp
index a47e35032..37c969f05 100644
--- a/src/gui/beingpopup.cpp
+++ b/src/gui/beingpopup.cpp
@@ -81,7 +81,7 @@ void BeingPopup::show(int x, int y, Being *b)
Label *label2 = mBeingGuild;
Label *label3 = mBeingRank;
- mBeingName->setCaption(b->getName());
+ mBeingName->setCaption(b->getName() + b->getGenderSign());
if (gui)
{
if (player_relations.isGoodName(b))
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index f84088cc1..66a8ce3ab 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -117,7 +117,7 @@ void PopupMenu::showPopup(int x, int y, Being *being)
const std::string &name = mNick;
- mBrowserBox->addRow(name);
+ mBrowserBox->addRow(name + being->getGenderSign());
switch (being->getType())
{
@@ -323,7 +323,8 @@ void PopupMenu::showPopup(int x, int y, std::list<Being*> &beings)
if (!being->getName().empty())
{
mBrowserBox->addRow(strprintf("@@player_%u|%s >@@",
- being->getId(), being->getName().c_str()));
+ being->getId(), (being->getName()
+ + being->getGenderSign()).c_str()));
}
}
mBrowserBox->addRow("##3---");