Reset controls properly based on default value from settings.xml

master
Ansariel 2025-05-04 23:41:01 +02:00
parent 3b07d5ee69
commit 2cff929d0a
1 changed files with 6 additions and 6 deletions

View File

@ -539,21 +539,21 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, std::string n
gSavedSettings.setString("PresetGraphicActive", name);
// <FS> [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);
// </FS>
// <FS:Ansariel> Update indirect controls
LLAvatarComplexityControls::setIndirectControls();
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
if (instance)
if (LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"))
{
instance->refreshEnabledGraphics();
}
// <FS:Ansariel> Graphic preset controls independent from XUI
FloaterQuickPrefs* phototools = LLFloaterReg::findTypedInstance<FloaterQuickPrefs>(PHOTOTOOLS_FLOATER);
if (phototools)
if (FloaterQuickPrefs* phototools = LLFloaterReg::findTypedInstance<FloaterQuickPrefs>(PHOTOTOOLS_FLOATER))
{
phototools->refreshSettings();
}