summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-05-22 22:21:21 +0300
committerAndrei Karas <akaras@inbox.ru>2012-05-22 23:03:48 +0300
commit6494df1ca2a1c00b85828deb3b62f371338536fb (patch)
treef4b7e6593ee9b6affa6516d6b0fdbbf7051c6dba /src/being.cpp
parent7f06820c754522b00d1a3954036931a0b6efcf0f (diff)
downloadmanaplus-6494df1ca2a1c00b85828deb3b62f371338536fb.tar.gz
manaplus-6494df1ca2a1c00b85828deb3b62f371338536fb.tar.bz2
manaplus-6494df1ca2a1c00b85828deb3b62f371338536fb.tar.xz
manaplus-6494df1ca2a1c00b85828deb3b62f371338536fb.zip
Add option to hide nick for erased players relation.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 69dfb9046..c58cc4696 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -203,6 +203,7 @@ bool Being::mShowGender = false;
bool Being::mShowLevel = false;
bool Being::mShowPlayersStatus = false;
bool Being::mEnableReorderSprites = true;
+bool Being::mHideErased = false;
std::list<BeingCacheEntry*> beingInfoCache;
@@ -279,7 +280,7 @@ Being::Being(int id, Type type, Uint16 subtype, Map *map):
config.addListener("visiblenames", this);
- mEnableReorderSprites = config.getBoolValue("enableReorderSprites");
+ reReadConfig();
if (mType == NPC)
setShowName(true);
@@ -1602,8 +1603,18 @@ std::string Being::getGenderSign() const
void Being::showName()
{
+ if (mName.empty())
+ return;
+
delete mDispName;
mDispName = nullptr;
+
+ if (mHideErased && player_relations.getRelation(mName) ==
+ PlayerRelation::ERASED)
+ {
+ return;
+ }
+
std::string mDisplayName(mName);
if (mType != MONSTER && (mShowGender || mShowLevel))
@@ -1632,9 +1643,6 @@ void Being::showName()
font = gui->getSecureFont();
}
- if (mDisplayName.empty())
- return;
-
mDispName = new FlashText(mDisplayName, getPixelX(), getPixelY(),
gcn::Graphics::CENTER, mNameColor, font);
@@ -1837,6 +1845,7 @@ void Being::reReadConfig()
mShowLevel = config.getBoolValue("showlevel");
mShowPlayersStatus = config.getBoolValue("showPlayersStatus");
mEnableReorderSprites = config.getBoolValue("enableReorderSprites");
+ mHideErased = config.getBoolValue("hideErased");
mUpdateConfigTime = cur_time;
}