From e184c7598680f2069e2bcf5caa3c86967d7ab0a1 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 2 Jun 2011 18:56:49 +0300 Subject: STORM-1253 WIP Changed the workflow to modify region day cycle. Was: Press "Save" after editing the region day cycle in the Day Cycle Editor. Now: - Press "Save" in the Day Cycle Editor. - Open Region / Estate -> Environment tab. - Select the region day cycle. - Press "Apply". --- indra/newview/llenvmanager.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llenvmanager.cpp') diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index dd8db7b785..8e4b7197d6 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -666,7 +666,14 @@ std::string LLEnvManagerNew::getDayCycleName() const const LLEnvironmentSettings& LLEnvManagerNew::getRegionSettings() const { - return mCachedRegionPrefs; + return !mNewRegionPrefs.isEmpty() ? mNewRegionPrefs : mCachedRegionPrefs; +} + +void LLEnvManagerNew::setRegionSettings(const LLEnvironmentSettings& new_settings) +{ + // Set region settings override that will be used locally + // until user either uploads the changes or goes to another region. + mNewRegionPrefs = new_settings; } bool LLEnvManagerNew::usePrefs() @@ -958,6 +965,10 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content) void LLEnvManagerNew::onRegionSettingsApplyResponse(bool ok) { LL_DEBUGS("Windlight") << "Applying region settings " << (ok ? "succeeded" : "failed") << LL_ENDL; + + // Clear locally modified region settings because they have just been uploaded. + mNewRegionPrefs.clear(); + mRegionSettingsAppliedSignal(ok); } @@ -991,6 +1002,9 @@ void LLEnvManagerNew::onRegionChange(bool interpolate) return; } + // Clear locally modified region settings. + mNewRegionPrefs.clear(); + // *TODO: clear environment settings of the previous region? // Request environment settings of the new region. -- cgit v1.2.3