From 38f87d0e21cfb6807e262e0289e1f6b08904a4e7 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 31 Mar 2011 18:24:01 +0300 Subject: 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. --- indra/newview/llfloaterwindlight.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterwindlight.cpp') diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index 04adf62733..5682bc1f17 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -790,9 +790,22 @@ void LLFloaterWindLight::onSavePreset(void* userData) return; } + // If region scope, save immediately. + // We don't actually save to file in this case, but just update the preset + // so that the changes can be uploaded to server. + LLWLParamKey key(comboBox->getSelectedValue()); + if (key.scope == LLEnvKey::SCOPE_REGION) + { + // *TODO: Eliminate code duplication. + LL_DEBUGS("Windlight") << "Saving region sky preset: " << key.name << llendl; + LLWLParamManager * param_mgr = LLWLParamManager::getInstance(); + param_mgr->mCurParams.mName = key.name; + param_mgr->setParamSet(key, param_mgr->mCurParams); + return; + } + // check to see if it's a default and shouldn't be overwritten - std::set::iterator sIt = sDefaultPresets.find( - LLWLParamKey(comboBox->getSelectedValue())); + std::set::iterator sIt = sDefaultPresets.find(LLWLParamKey(key)); if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("SkyEditPresets")) { LLNotifications::instance().add("WLNoEditDefault", LLSD(), LLSD()); -- cgit v1.3