fix private lookat and pointat
This commit is contained in:
@@ -71,11 +71,12 @@
|
||||
|
||||
BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVector3 position)
|
||||
{
|
||||
if (object && target_type != LOOKAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAt"))
|
||||
if(gSavedSettings.getBOOL("PrivateLookAt"))
|
||||
{
|
||||
target_type = LOOKAT_TARGET_NONE;
|
||||
object = mAvatarObject;
|
||||
if(!mLookAt || mLookAt->isDead())
|
||||
return FALSE;
|
||||
position.clearVec();
|
||||
return mLookAt->setLookAt(LOOKAT_TARGET_NONE, mAvatarObject, position);
|
||||
}
|
||||
|
||||
if(object && object->isAttachment())
|
||||
@@ -104,18 +105,11 @@ BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVecto
|
||||
BOOL LLAgent::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVector3 position)
|
||||
{
|
||||
// disallow pointing at attachments and avatars
|
||||
if (object && (object->isAttachment() || object->isAvatar()))
|
||||
if (object && (object->isAttachment() || object->isAvatar()) || gSavedSettings.getBOOL("PrivateLookAt"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (object && target_type != POINTAT_TARGET_NONE && gSavedSettings.getBOOL("PrivateLookAt"))
|
||||
{
|
||||
target_type = POINTAT_TARGET_NONE;
|
||||
object = NULL;
|
||||
position.clearVec();
|
||||
}
|
||||
|
||||
if(!mPointAt || mPointAt->isDead())
|
||||
{
|
||||
mPointAt = (LLHUDEffectPointAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT);
|
||||
|
||||
@@ -47,6 +47,12 @@
|
||||
|
||||
|
||||
#include "llxmltree.h"
|
||||
// <edit>
|
||||
#include "llresmgr.h"
|
||||
#include "llhudrender.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llviewercontrol.h"
|
||||
// </edit>
|
||||
|
||||
|
||||
BOOL LLHUDEffectLookAt::sDebugLookAt = FALSE;
|
||||
@@ -498,6 +504,8 @@ void LLHUDEffectLookAt::setSourceObject(LLViewerObject* objectp)
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLHUDEffectLookAt::render()
|
||||
{
|
||||
if (gSavedSettings.getBOOL("PrivateLookAt") &&
|
||||
(gAgent.getAvatarObject() == ((LLVOAvatar*)(LLViewerObject*)mSourceObject))) return;
|
||||
if (sDebugLookAt && mSourceObject.notNull())
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
@@ -521,6 +529,34 @@ void LLHUDEffectLookAt::render()
|
||||
gGL.vertex3f(0.f, 0.f, 1.f);
|
||||
} gGL.end();
|
||||
gGL.popMatrix();
|
||||
// <edit>
|
||||
const std::string text = ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->getFullname();
|
||||
LLVector3 offset = gAgent.getCameraPositionAgent() - target;
|
||||
offset.normalize();
|
||||
LLVector3 shadow_offset = offset * 0.49f;
|
||||
offset *= 0.5f;
|
||||
const LLFontGL* font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF);
|
||||
LLGLEnable gl_blend(GL_BLEND);
|
||||
glPushMatrix();
|
||||
gViewerWindow->setupViewport();
|
||||
hud_render_utf8text(text,
|
||||
target + shadow_offset,
|
||||
*font,
|
||||
LLFontGL::NORMAL,
|
||||
-0.5f * font->getWidthF32(text) + 2.0f,
|
||||
-2.0f,
|
||||
LLColor4::black,
|
||||
FALSE);
|
||||
hud_render_utf8text(text,
|
||||
target + offset,
|
||||
*font,
|
||||
LLFontGL::NORMAL,
|
||||
-0.5f * font->getWidthF32(text),
|
||||
0.0f,
|
||||
(*mAttentions)[mTargetType].mColor,
|
||||
FALSE);
|
||||
glPopMatrix();
|
||||
// </edit>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ void LLHUDManager::updateEffects()
|
||||
|
||||
void LLHUDManager::sendEffects()
|
||||
{
|
||||
if(!gSavedSettings.getBOOL("BroadcastViewerEffects"))return;
|
||||
S32 i;
|
||||
for (i = 0; i < mHUDEffects.count(); i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user