From 9d7c376390b75a9dd770bb1e5c41b53de4caf45a Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 15 May 2016 22:57:24 +0200 Subject: [PATCH] Added @camunlock=n --HG-- branch : RLVa --- indra/newview/llagentcamera.cpp | 8 ++++++++ indra/newview/rlvdefines.h | 1 + indra/newview/rlvhandler.cpp | 12 ++++++++++++ indra/newview/rlvhelper.cpp | 1 + 4 files changed, 22 insertions(+) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index a67de190ae..a02ddccb6b 100755 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1145,6 +1145,14 @@ void LLAgentCamera::updateCamera() mCameraUpVector = LLVector3::z_axis; //LLVector3 camera_skyward(0.f, 0.f, 1.f); +// [RLVa:KB] - Checked: RLVa-2.0.0 + // Set focus back on our avie if something changed it + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_CAMUNLOCK)) && (cameraThirdPerson()) && (!getFocusOnAvatar()) ) + { + setFocusOnAvatar(TRUE, FALSE); + } +// [/RLVa:KB] + U32 camera_mode = mCameraAnimating ? mLastCameraMode : mCameraMode; validateFocusObject(); diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index d79833430a..c136c9921d 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -157,6 +157,7 @@ enum ERlvBehaviour { RLV_BHVR_SETENV, // "setenv" RLV_BHVR_ALWAYSRUN, // "alwaysrun" RLV_BHVR_TEMPRUN, // "temprun" + RLV_BHVR_CAMUNLOCK, RLV_BHVR_DETACHME, // "detachme" RLV_BHVR_ATTACHTHIS, // "attachthis" RLV_BHVR_ATTACHTHISEXCEPT, // "attachthis_except" diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index fdb92ab5d3..be4bdb39c2 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -24,11 +24,13 @@ #include "llmoveview.h" #include "llstartup.h" #include "llviewermessage.h" +#include "llviewermenu.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" // Command specific includes +#include "llagentcamera.h" // @camfocus #include "llenvmanager.h" // @setenv #include "lloutfitslist.h" // @showinv - "Appearance / My Outfits" panel #include "llpaneloutfitsinventory.h" // @showinv - "Appearance" floater @@ -1497,6 +1499,16 @@ ERlvCmdRet RlvBehaviourAddRemAttachHandler::onCommand(const RlvCommand& rlvCmd, return RLV_RET_SUCCESS; } +// Handles: @sendim=n|y toggles +template<> template<> +void RlvBehaviourHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) +{ + if (fHasBhvr) + { + handle_reset_view(); + } +} + // Handles: @detach[:]=n|y template<> template<> ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvCommand& rlvCmd, bool& fRefCount) diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 3d5182669c..3c9ee3408b 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -91,6 +91,7 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourInfo("attachallthis", RLV_BHVR_ATTACHTHIS, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE)); addEntry(new RlvBehaviourInfo("attachthis_except", RLV_BHVR_ATTACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_NODE)); addEntry(new RlvBehaviourInfo("attachallthis_except", RLV_BHVR_ATTACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE)); + addEntry(new RlvBehaviourToggleProcessor("camunlock")); addEntry(new RlvBehaviourGenericProcessor("chatwhisper", RLV_BHVR_CHATWHISPER)); addEntry(new RlvBehaviourGenericProcessor("chatnormal", RLV_BHVR_CHATNORMAL)); addEntry(new RlvBehaviourGenericProcessor("chatshout", RLV_BHVR_CHATSHOUT));