diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d7e71e0b1d2fd3f7e5c77cf18eed05c388084cd2..bb56b71be2b145f85124ffd79f18024f36ff8118 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -367,8 +367,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.RemoveSkin", boost::bind(&LLFloaterPreference::onRemoveSkin, this)); mCommitCallbackRegistrar.add("Pref.ApplySkin", boost::bind(&LLFloaterPreference::onApplySkin, this)); mCommitCallbackRegistrar.add("Pref.SelectSkin", boost::bind(&LLFloaterPreference::onSelectSkin, this, _2)); - - mCommitCallbackRegistrar.add("Pref.UpdateLookAtClampDistance", boost::bind(&LLFloaterPreference::onUpdateLookAtClampDistance, this, _2)); } void LLFloaterPreference::processProperties( void* pData, EAvatarProcessorType type ) @@ -902,12 +900,6 @@ void LLFloaterPreference::refreshSkinInfo(const skin_t& skin) getChild<LLTextBase>("skin_notes")->setText(skin.mNotes); } -void LLFloaterPreference::onUpdateLookAtClampDistance(const LLSD& data) -{ - F32 clamp_distance = (F32)(data.asReal()); - gSavedSettings.setF32("AlchemyLookAtClampDistance", clamp_distance); -} - LLFloaterPreference::~LLFloaterPreference() { #ifndef LL_HAVOK diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index ef881f38e6b73a9dca8ad6d6884356aa2b9ce06a..23901a9fc3667f2f5c8088bfb0b8882598d2ae31 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -226,8 +226,6 @@ class LLFloaterPreference final : public LLFloater, public LLAvatarPropertiesObs void onSelectSkin(const LLSD& data); void refreshSkinInfo(const skin_t& skin); - void onUpdateLookAtClampDistance(const LLSD& data); - static std::string sSkin; notifications_map mNotificationOptions; bool mGotPersonalInfo; diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index d7dcba00bc6590de2e6678a261ca02fddf67a979..6cb99855ea3aa05126acb3057af2d74f1ae1bf32 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -412,10 +412,8 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec return FALSE; } - auto newTargetLookat = (*mAttentions)[mTargetType]; - // must be same or higher priority than existing effect - if ((*mAttentions)[target_type].mPriority < newTargetLookat.mPriority) + if ((*mAttentions)[target_type].mPriority < (*mAttentions)[mTargetType].mPriority) { return FALSE; } @@ -423,13 +421,11 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec F32 current_time = mTimer.getElapsedTimeF32(); bool looking_at_self = false; - if (object != NULL) // Why does this crash? + if (object && object->isAvatar()) { - auto objectp = static_cast<LLViewerObject*>(object); - if (objectp->isAvatar()) + if (auto avatarp = object->asAvatar()) { - auto voavatarp = dynamic_cast<LLVOAvatar*>(objectp); - if (voavatarp->isSelf()) + if (avatarp->isSelf()) { looking_at_self = true; } @@ -437,14 +433,14 @@ BOOL LLHUDEffectLookAt::setLookAt(ELookAtType target_type, LLViewerObject *objec } static LLCachedControl<bool> clamp_lookat_enabled(gSavedSettings, "AlchemyLookAtClampEnabled", false); bool clamp_lookat = clamp_lookat_enabled && !looking_at_self && - newTargetLookat.mName != "Respond" && - newTargetLookat.mName != "Conversation" && - newTargetLookat.mName != "AutoListen"; + (*mAttentions)[target_type].mName != "Respond" && + (*mAttentions)[target_type].mName != "Conversation" && + (*mAttentions)[target_type].mName != "AutoListen"; if (!clamp_lookat) { // type of lookat behavior or target object has changed - BOOL lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); + bool lookAtChanged = (target_type != mTargetType) || (object != mTargetObject); // lookat position has moved a certain amount and we haven't just sent an update lookAtChanged = lookAtChanged || ((dist_vec_squared(position, mLastSentOffsetGlobal) > MIN_DELTAPOS_FOR_UPDATE_SQUARED) && diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index b05a7fbc71f3e3bb273bad3c420b747f021e04f7..5cc7c91187a5f7b92e1ee1eb166d5ab6aa218f62 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -24,7 +24,7 @@ left="20" mouse_opaque="false" name="privacy_text" - top="10" + top="4" text_color="LtGray_50" width="60"> Privacy: @@ -235,15 +235,24 @@ name="LookAtHideOwn" tool_tip="Don't show me my own camera crosshairs" width="350" /> + <check_box + control_name="AlchemyLookAtPrivate" + height="16" + label="Don't send my actual camera target to others" + layout="topleft" + left="30" + name="privatelookat" + tool_tip="Disable your camera focus point from showing to others" + width="350" /> <check_box control_name="AlchemyLookAtClampEnabled" + disabled_control="AlchemyLookAtPrivate" height="16" label="Limit camera target distance" layout="topleft" left="30" name="privatelookat" - tool_tip="Allows cosmetic features like eye and head movement but will point at nothing specific if beyond the set distance." - top_pad="4" + tool_tip="Allows cosmetic features like eye and head movement but will point at nothing specific if beyond the set distance." width="200" /> <slider height="16" @@ -253,23 +262,12 @@ max_val="128" follows="top|left" control_name="AlchemyLookAtClampDistance" + disabled_control="AlchemyLookAtPrivate" initial_value="1.0" increment="0.5" label="Max Distance" width="275" - layout="topleft"> - <button.commit_callback - function="Pref.UpdateLookAtClampDistance" /> - </slider> - <check_box - control_name="AlchemyLookAtPrivate" - height="16" - label="Don't send my actual camera target to others" - layout="topleft" - left="30" - name="privatelookat" - tool_tip="Disable your camera focus point from showing to others" - width="350" /> + layout="topleft"/> <button follows="left|top" height="23" @@ -277,7 +275,7 @@ layout="topleft" left="30" name="block_list" - top_pad="8" + top_pad="4" width="145"> <!--<button.commit_callback function="SideTray.ShowPanel"-->