From 6494df1ca2a1c00b85828deb3b62f371338536fb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 22 May 2012 22:21:21 +0300 Subject: Add option to hide nick for erased players relation. --- src/being.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/being.cpp') 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 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; } -- cgit v1.2.3-60-g2f50