From ee8afcb19ab01682ba8277004cb4dd217c91630d Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Wed, 18 Mar 2015 02:08:41 -0400 Subject: [PATCH] RLVa fixes for shownames --- indra/newview/llhudeffectlookat.cpp | 3 +++ indra/newview/llnetmap.cpp | 2 +- indra/newview/lltoolgun.cpp | 8 +++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 3efb9299a..f2eac7a91 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -55,6 +55,7 @@ #include "llviewerwindow.h" #include "llviewercontrol.h" // +#include "rlvhandler.h" // packet layout @@ -553,6 +554,8 @@ void LLHUDEffectLookAt::render() if (!LLAvatarNameCache::getNSName(static_cast(mSourceObject.get())->getID(), text, lookAtNames)) return; if (text.length() > 9 && 0 == text.compare(text.length() - 9, 9, " Resident")) text.erase(text.length() - 9); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + text = RlvStrings::getAnonym(text); LLVector3 offset = gAgentCamera.getCameraPositionAgent() - target; offset.normalize(); LLVector3 shadow_offset = offset * 0.49f; diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 838417b4c..369221f12 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -591,7 +591,7 @@ void LLNetMap::draw() else { bool getCustomColorRLV(const LLUUID&, LLColor4&, LLViewerRegion*, bool name_restricted); - getCustomColorRLV(uuid, color, LLWorld::getInstance()->getRegionFromPosGlobal(position), show_friends); + getCustomColorRLV(uuid, color, LLWorld::getInstance()->getRegionFromPosGlobal(position), !show_friends); } LLWorldMapView::drawAvatar( diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp index d4c5faba0..09112d284 100644 --- a/indra/newview/lltoolgun.cpp +++ b/indra/newview/lltoolgun.cpp @@ -52,9 +52,10 @@ // Linden library includes #include "llwindow.h" // setMouseClipping() -bool getCustomColor(const LLUUID& id, LLColor4& color, LLViewerRegion* parent_estate); +bool getCustomColorRLV(const LLUUID& id, LLColor4& color, LLViewerRegion* parent_estate, bool name_restricted); #include "llavatarnamecache.h" #include "llworld.h" +#include "rlvhandler.h" LLToolGun::LLToolGun( LLToolComposite* composite ) : LLTool( std::string("gun"), composite ), @@ -186,10 +187,11 @@ void LLToolGun::draw() { LLAvatarName avatarName; LLAvatarNameCache::get(id, &avatarName); - getCustomColor(id, targetColor, world.getRegionFromPosGlobal(targetPosition)); + bool name_restricted = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); + getCustomColorRLV(id, targetColor, world.getRegionFromPosGlobal(targetPosition), name_restricted); targetColor.mV[VALPHA] = 0.5f; LLFontGL::getFontSansSerifBold()->renderUTF8( - llformat("%s : %.2fm", avatarName.getNSName().c_str(), (targetPosition - myPosition).magVec()), + llformat("%s : %.2fm", name_restricted ? RlvStrings::getAnonym(avatarName).c_str() : avatarName.getNSName().c_str(), (targetPosition - myPosition).magVec()), 0, (windowWidth / 2.f), (windowHeight / 2.f) - 25.f, targetColor, LLFontGL::HCENTER, LLFontGL::TOP, LLFontGL::BOLD, LLFontGL::NO_SHADOW );