From fc66d0841616f2abbda2e7ea08e62d39cb2df0c2 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 13 Feb 2021 19:16:42 +0100 Subject: [PATCH 1/9] [FIXED] GCC and Clang warnings and error --- indra/newview/llvisualeffect.h | 10 ++-------- indra/newview/rlveffects.cpp | 2 ++ indra/newview/rlvhelper.cpp | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/indra/newview/llvisualeffect.h b/indra/newview/llvisualeffect.h index fb11881e21..0bceec5fbb 100644 --- a/indra/newview/llvisualeffect.h +++ b/indra/newview/llvisualeffect.h @@ -89,12 +89,6 @@ protected: // // -enum class LLTweenType -{ - None, - Lerp, -}; - template class LLTweenableValue { @@ -118,13 +112,13 @@ template class LLTweenableValueLerp : public LLTweenableValue { public: - LLTweenableValueLerp(const T& defaultValue) : LLTweenableValue(defaultValue) {} + LLTweenableValueLerp(const T& defaultValue) : LLTweenableValue(defaultValue) {} T get() override; void start(const T& endValue, double duration) override { m_StartValue = get(); - m_CurValue = boost::none; + this->m_CurValue = boost::none; m_EndValue = endValue; m_StartTime = LLTimer::getElapsedSeconds(); diff --git a/indra/newview/rlveffects.cpp b/indra/newview/rlveffects.cpp index 9ed13747ba..6da6a15825 100644 --- a/indra/newview/rlveffects.cpp +++ b/indra/newview/rlveffects.cpp @@ -433,6 +433,8 @@ void RlvSphereEffect::run(const LLVisualEffectParams* pParams) gRlvSphereProgram.uniform2f(LLShaderMgr::RLV_EFFECT_PARAM5, 0.f, 1.f); renderPass(&gRlvSphereProgram, pShaderParams); break; + default: + llassert(true); } gRlvSphereProgram.unbind(); diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index c7eb508a53..70c5ac4819 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -412,7 +412,7 @@ const RlvBehaviourInfo* RlvBehaviourDictionary::getBehaviourInfo(ERlvBehaviour e { const RlvBehaviourInfo* pBhvrInfo = nullptr; for (auto itBhvrLower = m_Bhvr2InfoMap.lower_bound(eBhvr), itBhvrUpper = m_Bhvr2InfoMap.upper_bound(eBhvr); - std::find_if(itBhvrLower, itBhvrUpper, [eBhvr, eParamType](const rlv_bhvr2info_map_t::value_type& bhvrEntry) { return bhvrEntry.second->getParamTypeMask() == eParamType; }) != itBhvrUpper; + std::find_if(itBhvrLower, itBhvrUpper, [eParamType](const rlv_bhvr2info_map_t::value_type& bhvrEntry) { return bhvrEntry.second->getParamTypeMask() == eParamType; }) != itBhvrUpper; ++itBhvrLower) { if (pBhvrInfo) From 91e24a80ec9d4f6ccd42531bb47fa17227bae346 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 14 Feb 2021 21:41:16 +0100 Subject: [PATCH 2/9] [FIXED] llTextBox can be used to bypass @sendchat and @sendchannel (leave @sendchannel as-is for now) -> Reported by Chorazin Allen --- indra/newview/llnotificationscripthandler.cpp | 22 +++++++++++++++++++ indra/newview/llviewermessage.cpp | 14 ++++++++++++ .../skins/default/xui/en/rlva_strings.xml | 5 +++++ 3 files changed, 41 insertions(+) diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index ba831ab2ed..149d50c93a 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -37,6 +37,10 @@ #include "llscriptfloater.h" #include "llavatarname.h" #include "llavatarnamecache.h" +// [RLVa:KB] - @sendchat and @sendchannel/sendchannelexcept +#include "rlvactions.h" +#include "rlvcommon.h" +// [/RLVa:KB] using namespace LLNotificationsUI; @@ -112,6 +116,24 @@ bool LLScriptHandler::processNotification(const LLNotificationPtr& notification) if(notification->hasFormElements() && !notification->canShowToast()) { +// [RLVa:KB] - @sendchat and @sendchannel/sendchannelexcept + if (RlvActions::isRlvEnabled()) + { + const LLSD& sdPayload = notification->getPayload(); + if (sdPayload.has("chat_channel")) + { + const S32 nChannel = sdPayload["chat_channel"].asInteger(); + + // *TODO-RLVa: it's too late into the release cycle to block all script interactions so just take care of the nearby chat loophole for now + bool fBlock = (0 == nChannel) ? RlvActions::hasBehaviour(RLV_BHVR_SENDCHAT) : /*!RlvActions::canSendChannel(nChannel)*/false; + if (fBlock) + { + RlvUtil::notifyBlocked("blocked_scriptdialog"); + return false; + } + } + } +// [/RLVa:KB] LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID()); } else if (notification->canShowToast()) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 68cb7bf963..41c6830c2d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6902,6 +6902,20 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response) } } +// [RLVa:KB] - @sendchat and @sendchannel/sendchannelexcept + if ( (RlvActions::isRlvEnabled()) && (0 <= button_idx) ) + { + const S32 nChannel = notification["payload"]["chat_channel"].asInteger(); + + // *TODO-RLVa: it's too late into the release cycle to block all script interactions so just take care of the nearby chat loophole for now + bool fBlock = (0 == nChannel) ? RlvActions::hasBehaviour(RLV_BHVR_SENDCHAT) : /*!RlvActions::canSendChannel(nChannel)*/false; + if (fBlock) + { + button_idx = -1; + } + } +// [/RLVa:KB] + if (0 <= button_idx) { LLMessageSystem* msg = gMessageSystem; diff --git a/indra/newview/skins/default/xui/en/rlva_strings.xml b/indra/newview/skins/default/xui/en/rlva_strings.xml index edd2c2fecd..de0e99d6d0 100644 --- a/indra/newview/skins/default/xui/en/rlva_strings.xml +++ b/indra/newview/skins/default/xui/en/rlva_strings.xml @@ -136,6 +136,11 @@ value '[OBJECT]' was denied permission to teleport you due to RLV restrictions + blocked_scriptdialog + + value + Unable to show script dialog or textbox due to RLV restrictions + blocked_startim value From c5e037d6fcfe5321ed44c7d2083fb75cff4ab29d Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 14 Feb 2021 21:42:48 +0100 Subject: [PATCH 3/9] [FIXED] CATZ-582: @setoverlay modifiers are not applied when issued during login --- indra/newview/rlvhelper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 70c5ac4819..2429cd3769 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -737,8 +737,8 @@ RlvCommand::RlvCommand(const LLUUID& idObj, const std::string& strCommand) RlvCommand::RlvCommand(const RlvCommand& rlvCmd, ERlvParamType eParamType) : m_fValid(rlvCmd.m_fValid), m_idObj(rlvCmd.m_idObj), m_strBehaviour(rlvCmd.m_strBehaviour), m_pBhvrInfo(rlvCmd.m_pBhvrInfo) - , m_eParamType( (RLV_TYPE_UNKNOWN == eParamType) ? rlvCmd.m_eParamType : eParamType),m_fStrict(rlvCmd.m_fStrict), m_strOption(rlvCmd.m_strOption) - , m_strParam(rlvCmd.m_strParam), m_fRefCounted(rlvCmd.m_fRefCounted) + , m_eParamType( (RLV_TYPE_UNKNOWN == eParamType) ? rlvCmd.m_eParamType : eParamType), m_eBhvrModifier(rlvCmd.m_eBhvrModifier) + , m_fStrict(rlvCmd.m_fStrict), m_strOption(rlvCmd.m_strOption), m_strParam(rlvCmd.m_strParam), m_fRefCounted(rlvCmd.m_fRefCounted) { } From 8c9ffab8d6f2808ef9410620e82bb4fd30198298 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 14 Feb 2021 21:45:34 +0100 Subject: [PATCH 4/9] [FIXED] CATZ-583: Toolbar buttons no longer disable when restrictions are in place --- indra/newview/rlvhelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 2429cd3769..0b73a6faae 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -451,7 +451,7 @@ ERlvBehaviour RlvBehaviourDictionary::getBehaviourFromString(const std::string& ERlvLocalBhvrModifier eBhvrModifier; const RlvBehaviourInfo* pBhvrInfo = getBehaviourInfo(strBhvr, eParamType, pfStrict, &eBhvrModifier); // Filter out locally scoped modifier commands since they don't actually have a unique behaviour value of their own - return (pBhvrInfo && ERlvLocalBhvrModifier::Unknown != eBhvrModifier) ? pBhvrInfo->getBehaviourType() : RLV_BHVR_UNKNOWN; + return (pBhvrInfo && ERlvLocalBhvrModifier::Unknown == eBhvrModifier) ? pBhvrInfo->getBehaviourType() : RLV_BHVR_UNKNOWN; } bool RlvBehaviourDictionary::getCommands(const std::string& strMatch, ERlvParamType eParamType, std::list& cmdList) const From 8fe310f2830d42639c53c9335365629656e49723 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 14 Feb 2021 21:47:44 +0100 Subject: [PATCH 5/9] [FIXED] Only one @setsphere effect is ever visible (broken when code moved to LLPipeline::renderFinalize) --- indra/newview/llvisualeffect.cpp | 26 +++++++++++++------------- indra/newview/llvisualeffect.h | 15 ++++++++++++--- indra/newview/pipeline.cpp | 4 ++-- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/indra/newview/llvisualeffect.cpp b/indra/newview/llvisualeffect.cpp index 88e0b35807..af68a57413 100644 --- a/indra/newview/llvisualeffect.cpp +++ b/indra/newview/llvisualeffect.cpp @@ -107,33 +107,33 @@ bool LLVfxManager::removeEffect(const LLUUID& idEffect) return true; } -void LLVfxManager::runEffect(EVisualEffect eCode, const LLVisualEffectParams* pParams) +void LLVfxManager::runEffect(EVisualEffect eCode, LLVisualEffectParams* pParams) { // *TODO-Catz: once we're done, check whether iterating over the entire list still has negliable impact auto pred = [eCode](const LLVisualEffect* pEffect) { return pEffect->getCode() == eCode; }; - auto beginEffect = boost::make_filter_iterator(pred, m_Effects.begin(), m_Effects.end()), + auto itEffect = boost::make_filter_iterator(pred, m_Effects.begin(), m_Effects.end()), endEffect = boost::make_filter_iterator(pred, m_Effects.end(), m_Effects.end()); - - auto effectRange = boost::make_iterator_range(beginEffect, endEffect); - for (LLVisualEffect* pEffect : effectRange) + for (; itEffect != endEffect; ++itEffect) { - pEffect->run(pParams); + if (pParams) + pParams->step(itEffect == endEffect); + (*itEffect)->run(pParams); } } -void LLVfxManager::runEffect(EVisualEffectType eType, const LLVisualEffectParams* pParams) +void LLVfxManager::runEffect(EVisualEffectType eType, LLVisualEffectParams* pParams) { // *TODO-Catz: once we're done, check whether iterating over the entire list still has negliable impact auto pred = [eType](const LLVisualEffect* pEffect) { return pEffect->getType() == eType; }; - auto beginEffect = boost::make_filter_iterator(pred, m_Effects.begin(), m_Effects.end()), - endEffect = boost::make_filter_iterator(pred, m_Effects.end(), m_Effects.end()); - - auto effectRange = boost::make_iterator_range(beginEffect, endEffect); - for (LLVisualEffect* pEffect : effectRange) + auto itEffect = boost::make_filter_iterator(pred, m_Effects.begin(), m_Effects.end()), + endEffect = boost::make_filter_iterator(pred, m_Effects.end(), m_Effects.end()); + for (; itEffect != endEffect; ++itEffect) { - pEffect->run(pParams); + if (pParams) + pParams->step(itEffect == endEffect); + (*itEffect)->run(pParams); } } diff --git a/indra/newview/llvisualeffect.h b/indra/newview/llvisualeffect.h index 0bceec5fbb..6419e26b29 100644 --- a/indra/newview/llvisualeffect.h +++ b/indra/newview/llvisualeffect.h @@ -46,14 +46,23 @@ enum class EVisualEffectType struct LLVisualEffectParams { + virtual void step(bool isLast) = 0; }; struct LLShaderEffectParams : LLVisualEffectParams { - explicit LLShaderEffectParams(LLRenderTarget* pSrcBuffer, LLRenderTarget* pDstBuffer) : m_pSrcBuffer(pSrcBuffer), m_pDstBuffer(pDstBuffer) {} + explicit LLShaderEffectParams(LLRenderTarget* pSrcBuffer, LLRenderTarget* pScratchBuffer, bool fBindLast) : m_pSrcBuffer(pScratchBuffer), m_pDstBuffer(pSrcBuffer), m_fBindLast(fBindLast) {} + + void step(bool isLast) override + { + LLRenderTarget* pPrevSrc = m_pSrcBuffer, *pPrevDst = m_pDstBuffer; + m_pSrcBuffer = pPrevDst; + m_pDstBuffer = (!isLast || !m_fBindLast) ? pPrevSrc : nullptr; + } LLRenderTarget* m_pSrcBuffer = nullptr; LLRenderTarget* m_pDstBuffer = nullptr; + bool m_fBindLast = false; }; // ============================================================================ @@ -155,8 +164,8 @@ public: LLVisualEffect* getEffect(EVisualEffect eCode) const; template T* getEffect(EVisualEffect eCode) const { return dynamic_cast(getEffect(eCode)); } bool removeEffect(const LLUUID& idEffect); - void runEffect(EVisualEffect eCode, const LLVisualEffectParams* pParams = nullptr); - void runEffect(EVisualEffectType eType, const LLVisualEffectParams* pParams = nullptr); + void runEffect(EVisualEffect eCode, LLVisualEffectParams* pParams = nullptr); + void runEffect(EVisualEffectType eType, LLVisualEffectParams* pParams = nullptr); protected: /* diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2b36180488..ba40807dcb 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8098,7 +8098,7 @@ void LLPipeline::renderFinalize() // [RLVa:KB] - @setsphere if (RlvActions::hasBehaviour(RLV_BHVR_SETSPHERE)) { - LLShaderEffectParams params(pRenderBuffer, (multisample) ? &mScreen : nullptr); + LLShaderEffectParams params(pRenderBuffer, &mScreen, !multisample); LLVfxManager::instance().runEffect(EVisualEffect::RlvSphere, ¶ms); pRenderBuffer = params.m_pDstBuffer; } @@ -8186,7 +8186,7 @@ void LLPipeline::renderFinalize() // [RLVa:KB] - @setsphere if (RlvActions::hasBehaviour(RLV_BHVR_SETSPHERE)) { - LLShaderEffectParams params(&mScreen, &mDeferredLight); + LLShaderEffectParams params(&mScreen, &mDeferredLight, false); LLVfxManager::instance().runEffect(EVisualEffect::RlvSphere, ¶ms); pRenderBuffer = params.m_pDstBuffer; } From cdd624c4e740ed2673b71c7b1f1adfee9639595e Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 14 Feb 2021 21:48:26 +0100 Subject: [PATCH 6/9] Add @shownametags: --- indra/newview/llvoavatar.cpp | 2 +- indra/newview/rlvactions.cpp | 16 +++++++++++++--- indra/newview/rlvactions.h | 3 ++- indra/newview/rlvdefines.h | 1 + indra/newview/rlvhandler.cpp | 25 ++++++++++++++----------- indra/newview/rlvhelper.cpp | 3 ++- 6 files changed, 33 insertions(+), 17 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7b43632fc0..221f771bc1 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3088,7 +3088,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) bool fRlvShowAvTag = true, fRlvShowAvName = true; if (RlvActions::isRlvEnabled()) { - fRlvShowAvTag = RlvActions::canShowName(RlvActions::SNC_NAMETAG, getID()); + fRlvShowAvTag = RlvActions::canShowNameTag(this); fRlvShowAvName = (fRlvShowAvTag) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, getID())); } // [/RLVa:KB] diff --git a/indra/newview/rlvactions.cpp b/indra/newview/rlvactions.cpp index 44def7256c..0a2c8b5b58 100644 --- a/indra/newview/rlvactions.cpp +++ b/indra/newview/rlvactions.cpp @@ -220,9 +220,6 @@ bool RlvActions::canShowName(EShowNamesContext eContext, const LLUUID& idAgent) { switch (eContext) { - // Show/hide avatar nametag - case SNC_NAMETAG: - return (gRlvHandler.isException(RLV_BHVR_SHOWNAMETAGS, idAgent)) || (gAgentID == idAgent); // Show/hide avatar name case SNC_DEFAULT: case SNC_TELEPORTOFFER: @@ -233,6 +230,19 @@ bool RlvActions::canShowName(EShowNamesContext eContext, const LLUUID& idAgent) return false; } +bool RlvActions::canShowNameTag(const LLVOAvatar* pAvatar) +{ + // An avatar's name tag can be shown if: + // - not restricted from seeing avatars' name tags + // - OR the avatar is a @shownametags exception + // - OR the avatar is within the distance that nametags can be shown + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS)) || (gRlvHandler.isException(RLV_BHVR_SHOWNAMETAGS, pAvatar->getID())) || (gAgentID == pAvatar->getID()) ) + return true; + + const F32 nShowNameTagsDist = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SHOWNAMETAGSDIST)->getValue(); + return (nShowNameTagsDist != 0.f) && (dist_vec_squared(pAvatar->getPositionGlobal(), gAgent.getPositionGlobal()) < nShowNameTagsDist * nShowNameTagsDist); +} + bool RlvActions::canShowNearbyAgents() { return !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNEARBY); diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index 6571023ca7..499b53b6a5 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -123,8 +123,9 @@ public: * (This is used to hide an avatar name in one case but not a near-identical case - such as teleporting a friend vs a nearby agent - * in a way that limits the amount of code that needs to be changed to carry context from one function to another) */ - enum EShowNamesContext { SNC_DEFAULT = 0, SNC_NAMETAG, SNC_TELEPORTOFFER, SNC_TELEPORTREQUEST, SNC_COUNT }; + enum EShowNamesContext { SNC_DEFAULT = 0, SNC_TELEPORTOFFER, SNC_TELEPORTREQUEST, SNC_COUNT }; static bool canShowName(EShowNamesContext eContext, const LLUUID& idAgent = LLUUID::null); + static bool canShowNameTag(const LLVOAvatar* pAvatar); static void setShowName(EShowNamesContext eContext, bool fCanShowName) { if ( (eContext < SNC_COUNT) && (isRlvEnabled()) ) { s_BlockNamesContexts[eContext] = !fCanShowName; } } /* diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 3d7d77ae40..13631811d2 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -274,6 +274,7 @@ enum ERlvBehaviourModifier RLV_MODIFIER_SETCAM_FOVMIN, // Minimum value for the camera's field of view (angle in radians) RLV_MODIFIER_SETCAM_FOVMAX, // Maximum value for the camera's field of view (angle in radians) RLV_MODIFIER_SETCAM_TEXTURE, // Specifies the UUID of the texture used to texture the world view + RLV_MODIFIER_SHOWNAMETAGSDIST, // Distance at which name tags will still be shown RLV_MODIFIER_SITTPDIST, RLV_MODIFIER_TPLOCALDIST, diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 441d5034c2..5ba4839812 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -2564,28 +2564,31 @@ ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvCommand& return eRet; } -// Handles: @shownametags[:]=n|y toggles -template<> template<> -void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) +// Handles: @shownametags[:] value changes +template<> +void RlvBehaviourModifierHandler::onValueChange() const { if (LLApp::isExiting()) return; // Nothing to do if the viewer is shutting down - // Update the shownames context - RlvActions::setShowName(RlvActions::SNC_NAMETAG, !fHasBhvr); - // Refresh all name tags LLVOAvatar::invalidateNameTags(); } -// Handles: @shownametags[:]=n|y +// Handles: @shownametags[:]=n|y template<> template<> ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvCommand& rlvCmd, bool& fRefCount) { - ERlvCmdRet eRet = RlvBehaviourGenericHandler::onCommand(rlvCmd, fRefCount); - if ( (RLV_RET_SUCCESS == eRet) && (rlvCmd.hasOption()) ) - LLVOAvatar::invalidateNameTag(RlvCommandOptionHelper::parseOption(rlvCmd.getOption())); - return eRet; + LLUUID idOption; + if ( (rlvCmd.hasOption()) && (RlvCommandOptionHelper::parseOption(rlvCmd.getOption(), idOption)) ) + { + ERlvCmdRet eRet = RlvBehaviourGenericHandler::onCommand(rlvCmd, fRefCount); + if (RLV_RET_SUCCESS == eRet) + LLVOAvatar::invalidateNameTag(idOption); + fRefCount = false; + return eRet; + } + return RlvBehaviourGenericHandler::onCommand(rlvCmd, fRefCount); } // Handles: @shownearby=n|y toggles diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index 0b73a6faae..dcef3f9827 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -146,7 +146,8 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourGenericProcessor("showloc", RLV_BHVR_SHOWLOC)); addEntry(new RlvBehaviourGenericProcessor("showminimap", RLV_BHVR_SHOWMINIMAP)); addEntry(new RlvBehaviourToggleProcessor("shownames", RlvBehaviourInfo::BHVR_STRICT)); - addEntry(new RlvBehaviourToggleProcessor("shownametags", RlvBehaviourInfo::BHVR_STRICT )); + addEntry(new RlvBehaviourProcessor("shownametags", RlvBehaviourInfo::BHVR_STRICT)); + addModifier(RLV_BHVR_SHOWNAMETAGS, RLV_MODIFIER_SHOWNAMETAGSDIST, new RlvBehaviourModifierHandler("Name Tags - Visible Distance", 0.0f, true, new RlvBehaviourModifierCompMin)); addEntry(new RlvBehaviourGenericToggleProcessor("shownearby", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addEntry(new RlvBehaviourGenericToggleProcessor("showself", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); addEntry(new RlvBehaviourGenericToggleProcessor("showselfhead", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); From efd3c92135c9a2faa14cbabf5de8f020b2947553 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 14 Feb 2021 21:49:30 +0100 Subject: [PATCH 7/9] Cap the number of simultaneously running @setsphere effects at 6 --- indra/newview/rlvhandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 5ba4839812..d2117cbeaf 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -2064,6 +2064,10 @@ void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehavio template<> template<> ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvCommand& rlvCmd, bool& fRefCount) { + // *TODO: this needs to be done in a cleaner way but FS needs to release ASAP + if (RLV_TYPE_ADD == rlvCmd.getParamType() && gRlvHandler.m_Behaviours[RLV_BHVR_SETSPHERE] >= 6) + return RLV_RET_FAILED_LOCK; + ERlvCmdRet eRet = RlvBehaviourGenericHandler::onCommand(rlvCmd, fRefCount); if ( (RLV_RET_SUCCESS == eRet) && (!rlvCmd.isModifier()) ) { From 4a8f0d80cfc8d597afcd5731cd60a1b5c321be33 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 14 Feb 2021 21:50:03 +0100 Subject: [PATCH 8/9] Prevent toggling off atmospheric shaders when a @setsphere effect is active --- indra/newview/llfloaterpreference.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c300f1ace1..746a7743fe 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1410,7 +1410,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() LLTextBox* sky_text = getChild("SkyMeshDetailText"); // [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a // "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n - ctrl_wind_light->setEnabled( (RlvActions::canChangeEnvironment()) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))); + ctrl_wind_light->setEnabled( ((RlvActions::canChangeEnvironment()) && (!RlvActions::hasBehaviour(RLV_BHVR_SETSPHERE))) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))); // [/RLVa:KB] // ctrl_wind_light->setEnabled(TRUE); sky->setEnabled(TRUE); From 8574c47a0d6060ebc0cce353d2b18232f16fc682 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 14 Feb 2021 22:20:32 +0100 Subject: [PATCH 9/9] Add missing forward declaration --- indra/newview/rlvactions.h | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index 499b53b6a5..889da1e645 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -27,6 +27,7 @@ class LLInventoryCategory; class LLInventoryItem; class LLViewerObject; +class LLVOAvatar; // ============================================================================ // RlvActions class declaration - developer-friendly non-RLVa code facing class, use in lieu of RlvHandler whenever possible