diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-03-31 18:24:01 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-03-31 18:24:01 +0300 |
commit | 38f87d0e21cfb6807e262e0289e1f6b08904a4e7 (patch) | |
tree | 29fa2d175e9cd8931ec090b7f4f4177c884e5713 /indra/newview/llenvmanager.cpp | |
parent | 7419abc12ba07380593fa3c0571155b248b8c8a6 (diff) |
STORM-1126 WIP Windlight Estate Settings integration: pass 6
* Made it possible to update a region sky preset with the Save button.
* Fixed resetting day cycle when you start editing region environment settings.
* Fixed: if you press "Cancel Changes" in the region envitonment settings
and then choose to resume editing in the confirmation dialog,
you won't be able to cancel your changes later.
Diffstat (limited to 'indra/newview/llenvmanager.cpp')
-rw-r--r-- | indra/newview/llenvmanager.cpp | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index 010ecc267b..9300161837 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -109,6 +109,12 @@ void LLEnvManager::startEditingScope(LLEnvKey::EScope scope) mIsEditing = true; mCurEditingScope = scope; + // Back up local settings so that we can switch back to them later. + if (scope != LLEnvKey::SCOPE_LOCAL) + { + backUpLocalSettingsIfNeeded(); + } + // show scope being edited loadSettingsIntoManagers(scope, false); @@ -160,16 +166,17 @@ void LLEnvManager::maybeClearEditingScope(bool user_initiated, bool was_commit) void LLEnvManager::clearEditingScope(const LLSD& notification, const LLSD& response) { - LL_DEBUGS("Windlight") << "Clearing editing scope " << mCurNormalScope << LL_ENDL; - if(notification.isDefined() && response.isDefined() && LLNotification::getSelectedOption(notification, response) != 0) { +#if 0 // *TODO: select terrain panel here mIsEditing = false; LLFloaterReg::showTypedInstance<LLFloaterRegionInfo>("regioninfo"); +#endif return; } + LL_DEBUGS("Windlight") << "Clearing editing scope " << mCurNormalScope << LL_ENDL; mIsEditing = false; updateUIFromEditability(); @@ -244,6 +251,12 @@ bool LLEnvManager::canEdit(LLEnvKey::EScope scope) void LLEnvManager::refreshFromStorage(LLEnvKey::EScope scope) { + // Back up local env. settings so that we can switch to them later. + if (scope != LLEnvKey::SCOPE_LOCAL) + { + backUpLocalSettingsIfNeeded(); + } + switch (scope) { case LLEnvKey::SCOPE_LOCAL: @@ -473,6 +486,20 @@ void LLEnvManager::saveSettingsFromManagers(LLEnvKey::EScope scope) } } +void LLEnvManager::backUpLocalSettingsIfNeeded() +{ + // *HACK: Back up local env. settings so that we can switch to them later. + // Otherwise local day cycle is likely to be reset. + static bool sSavedLocalSettings = false; + + if (!sSavedLocalSettings) + { + LL_DEBUGS("Windlight") << "Backing up local environment settings" << LL_ENDL; + saveSettingsFromManagers(LLEnvKey::SCOPE_LOCAL); + sSavedLocalSettings = true; + } +} + /******* * Setting desired display level *******/ |