From 047f69bf618fa525410dc512977e384cbbdb4d11 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 24 May 2011 19:05:41 +0300 Subject: STORM-1256 WIP Fixed resetting the Environment tab if a server env. update comes while your preference is using personal env. settings. The fix is to re-add server skies to our WL param mgr regardless of user preferences. --- indra/newview/llenvmanager.cpp | 6 ++---- indra/newview/llwlparammanager.cpp | 9 ++++----- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index 688e2ea9bf..85a7c4d069 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -820,10 +820,8 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content) mCachedRegionPrefs = new_settings; // If using server settings, update managers. - if (getUseRegionSettings()) - { - updateManagersFromPrefs(mInterpNextChangeMessage); - } + // This also adds server skies to the WL param mgr. + updateManagersFromPrefs(mInterpNextChangeMessage); // Let interested parties know about the region settings update. mRegionSettingsChangeSignal(); diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 16abe2b174..ec7889cb93 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -589,10 +589,12 @@ void LLWLParamManager::applyUserPrefs(bool interpolate) // Remove all region sky presets because they may belong to a previously visited region. clearParamSetsOfScope(LLEnvKey::SCOPE_REGION); + // Add all sky presets belonging to the current region. + const LLEnvironmentSettings& region_settings = LLEnvManagerNew::instance().getRegionSettings(); + addAllSkies(LLEnvKey::SCOPE_REGION, region_settings.getSkyMap()); + if (LLEnvManagerNew::instance().getUseRegionSettings()) // apply region-wide settings { - const LLEnvironmentSettings& region_settings = LLEnvManagerNew::instance().getRegionSettings(); - if (region_settings.getSkyMap().size() == 0) { applyDefaults(); @@ -602,9 +604,6 @@ void LLWLParamManager::applyUserPrefs(bool interpolate) // *TODO: Support fixed sky from region. LL_DEBUGS("Windlight") << "Applying region sky" << LL_ENDL; - // Add all sky presets belonging to the current region. - addAllSkies(LLEnvKey::SCOPE_REGION, region_settings.getSkyMap()); - // Apply region day cycle. mDay.loadDayCycle(region_settings.getWLDayCycle(), LLEnvKey::SCOPE_REGION); resetAnimator(region_settings.getDayTime(), true); -- cgit v1.2.3