RLVa fixes for shownames

This commit is contained in:
Inusaito Sayori
2015-03-18 02:08:41 -04:00
parent 07a03d17c1
commit ee8afcb19a
3 changed files with 9 additions and 4 deletions

View File

@@ -55,6 +55,7 @@
#include "llviewerwindow.h"
#include "llviewercontrol.h"
// </edit>
#include "rlvhandler.h"
// packet layout
@@ -553,6 +554,8 @@ void LLHUDEffectLookAt::render()
if (!LLAvatarNameCache::getNSName(static_cast<LLVOAvatar*>(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;

View File

@@ -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(

View File

@@ -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
);