summaryrefslogtreecommitdiff
path: root/indra/newview/llenvmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llenvmanager.cpp')
-rw-r--r--indra/newview/llenvmanager.cpp16
1 files changed, 15 insertions, 1 deletions
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.