From 2cff929d0a4dc6129f121f0203be478258aff962 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 4 May 2025 23:41:01 +0200 Subject: [PATCH] Reset controls properly based on default value from settings.xml --- indra/newview/llpresetsmanager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 836869a665..ebc332caa1 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -539,21 +539,21 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, std::string n gSavedSettings.setString("PresetGraphicActive", name); // [FIRE-35390] Old viewer presets have these as true and 0.7, whereas the equivalent on modern viewers is false and 1.0 - gSavedSettings.setBOOL("RenderSkyAutoAdjustLegacy", false); - gSavedSettings.setF32("RenderSkyAmbientScale", 1.0); + if (auto control = gSavedSettings.getControl("RenderSkyAutoAdjustLegacy")) + control->resetToDefault(true); + if (auto control = gSavedSettings.getControl("RenderSkyAmbientScale")) + control->resetToDefault(true); // // Update indirect controls LLAvatarComplexityControls::setIndirectControls(); - LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); - if (instance) + if (LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences")) { instance->refreshEnabledGraphics(); } // Graphic preset controls independent from XUI - FloaterQuickPrefs* phototools = LLFloaterReg::findTypedInstance(PHOTOTOOLS_FLOATER); - if (phototools) + if (FloaterQuickPrefs* phototools = LLFloaterReg::findTypedInstance(PHOTOTOOLS_FLOATER)) { phototools->refreshSettings(); }