From d8ed0b7e0c9015ee5f8212e6325b3b99b96c6e54 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 5 Jun 2011 20:25:31 +0300 Subject: Add space before gender sign. --- src/being.cpp | 9 +++++++++ src/being.h | 2 ++ src/gui/beingpopup.cpp | 2 +- src/gui/popupmenu.cpp | 4 ++-- 4 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 35fe6052c..d45bbcf74 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -1455,6 +1455,15 @@ void Being::flashName(int time) mDispName->flash(time); } +std::string Being::getGenderSignWithSpace() const +{ + const std::string &str = getGenderSign(); + if (str.empty()) + return str; + else + return " " + str; +} + std::string Being::getGenderSign() const { if (config.getBoolValue("showgender")) diff --git a/src/being.h b/src/being.h index b2a92d3df..652b8a889 100644 --- a/src/being.h +++ b/src/being.h @@ -723,6 +723,8 @@ class Being : public ActorSprite, public ConfigListener std::string getGenderSign() const; + std::string getGenderSignWithSpace() const; + static void clearCache(); protected: diff --git a/src/gui/beingpopup.cpp b/src/gui/beingpopup.cpp index 37c969f05..1b32d2b7b 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() + b->getGenderSign()); + mBeingName->setCaption(b->getName() + b->getGenderSignWithSpace()); if (gui) { if (player_relations.isGoodName(b)) diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index a9905d4ca..8497b2924 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -118,7 +118,7 @@ void PopupMenu::showPopup(int x, int y, Being *being) const std::string &name = mNick; - mBrowserBox->addRow(name + being->getGenderSign()); + mBrowserBox->addRow(name + being->getGenderSignWithSpace()); switch (being->getType()) { @@ -325,7 +325,7 @@ void PopupMenu::showPopup(int x, int y, std::list &beings) { mBrowserBox->addRow(strprintf("@@player_%u|%s >@@", being->getId(), (being->getName() - + being->getGenderSign()).c_str())); + + being->getGenderSignWithSpace()).c_str())); } } mBrowserBox->addRow("##3---"); -- cgit v1.2.3-60-g2f50