From 8be31d980ec5d50f431c66ca4ae4e2f793058eb2 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 15 Jun 2020 20:14:25 +0200 Subject: [PATCH] [FIXED] Prevent unchecking atmospheric shaders when @setenv restricted --- indra/newview/llfloaterpreference.cpp | 17 +++++++++-------- indra/newview/llviewercontrol.cpp | 10 ++++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index de2cd996c1..f8d06c0d46 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -110,7 +110,6 @@ #include "llweb.h" // [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) #include "rlvactions.h" -#include "rlvhandler.h" // [/RLVa:KB] #include "lllogininstance.h" // to check if logged in yet @@ -1320,7 +1319,11 @@ void LLFloaterPreference::refreshEnabledState() } else { - ctrl_wind_light->setEnabled(TRUE); +// [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"))); +// [/RLVa:KB] +// ctrl_wind_light->setEnabled(TRUE); } //Deferred/SSAO/Shadows @@ -1347,7 +1350,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() LLTextBox* reflections_text = getChild("ReflectionsText"); // [RLVa:KB] - Checked: 2013-05-11 (RLVa-1.4.9) - if (rlv_handler_t::isEnabled()) + if (RlvActions::isRlvEnabled()) { getChild("do_not_disturb_response")->setEnabled(!RlvActions::hasBehaviour(RLV_BHVR_SENDIM)); } @@ -1399,13 +1402,11 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); LLSliderCtrl* sky = getChild("SkyMeshDetail"); LLTextBox* sky_text = getChild("SkyMeshDetailText"); - ctrl_wind_light->setEnabled(TRUE); // [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 -// bool fCtrlWindLightEnable = fCtrlShaderEnable && shaders; -// ctrl_wind_light->setEnabled( -// fCtrlWindLightEnable && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) ); + // "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n + ctrl_wind_light->setEnabled( (RlvActions::canChangeEnvironment()) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))); // [/RLVa:KB] +// ctrl_wind_light->setEnabled(TRUE); sky->setEnabled(TRUE); sky_text->setEnabled(TRUE); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index f9ed018393..007fb0e339 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -76,6 +76,7 @@ #include "llslurl.h" #include "llstartup.h" // [RLVa:KB] - Checked: 2015-12-27 (RLVa-1.5.0) +#include "rlvactions.h" #include "rlvcommon.h" // [/RLVa:KB] @@ -142,6 +143,15 @@ static bool handleAvatarHoverOffsetChanged(const LLSD& newvalue) static bool handleSetShaderChanged(const LLSD& newvalue) { +// [RLVa:KB] - @setenv + if ( (!RlvActions::canChangeEnvironment()) && (LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders")) && (!gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ) + { + gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE); + return true; + } +// [/RLVa:KB] + + // changing shader level may invalidate existing cached bump maps, as the shader type determines the format of the bump map it expects - clear and repopulate the bump cache gBumpImageList.destroyGL(); gBumpImageList.restoreGL();