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

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