From 205b331825d2d100a442d2d0399d477850d395d3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 2 Jun 2011 03:11:08 +0300 Subject: Add players gender sugn in popup menus and being popups. --- src/being.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/being.cpp') 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) -- cgit v1.2.3-70-g09d2