diff options
-rw-r--r-- | indra/newview/llfloatereditsky.cpp | 86 | ||||
-rw-r--r-- | indra/newview/llfloatereditsky.h | 4 |
2 files changed, 45 insertions, 45 deletions
diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index f78baf2ed5..da3f684ba2 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -45,8 +45,6 @@ static const F32 WL_SUN_AMBIENT_SLIDER_SCALE = 3.0f; -//================================================================================================= - LLFloaterEditSky::LLFloaterEditSky(const LLSD &key) : LLFloater(key) , mSkyPresetNameEditor(NULL) @@ -210,6 +208,8 @@ void LLFloaterEditSky::initCallbacks(void) getChild<LLUICtrl>("WLStarAlpha")->setCommitCallback(boost::bind(&LLFloaterEditSky::onStarAlphaMoved, this, _1)); } +//================================================================================================= + void LLFloaterEditSky::syncControls() { bool err; @@ -822,6 +822,47 @@ void LLFloaterEditSky::onSkyPresetSelected() mMakeDefaultCheckBox->setEnabled(key.scope == LLEnvKey::SCOPE_LOCAL); } +bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + // If they choose save, do it. Otherwise, don't do anything + if (option == 0) + { + onSaveConfirmed(); + } + + return false; +} + +void LLFloaterEditSky::onSaveConfirmed() +{ + // Save current params to the selected preset. + LLWLParamKey key(getSelectedSkyPreset()); + + LL_DEBUGS("Windlight") << "Saving sky preset " << key.name << LL_ENDL; + LLWLParamManager& wl_mgr = LLWLParamManager::instance(); + if (wl_mgr.hasParamSet(key)) + { + wl_mgr.setParamSet(key, wl_mgr.mCurParams); + } + else + { + wl_mgr.addParamSet(key, wl_mgr.mCurParams); + } + + wl_mgr.savePreset(key); + + // Change preference if requested. + if (mMakeDefaultCheckBox->getValue()) + { + LL_DEBUGS("Windlight") << key.name << " is now the new preferred sky preset" << llendl; + LLEnvManagerNew::instance().setUseSkyPreset(key.name); + } + + closeFloater(); +} + void LLFloaterEditSky::onBtnSave() { LLWLParamKey selected_sky = getSelectedSkyPreset(); @@ -866,47 +907,6 @@ void LLFloaterEditSky::onBtnCancel() closeFloater(); } -bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - // If they choose save, do it. Otherwise, don't do anything - if (option == 0) - { - onSaveConfirmed(); - } - - return false; -} - -void LLFloaterEditSky::onSaveConfirmed() -{ - // Save current params to the selected preset. - LLWLParamKey key(getSelectedSkyPreset()); - - LL_DEBUGS("Windlight") << "Saving sky preset " << key.name << LL_ENDL; - LLWLParamManager& wl_mgr = LLWLParamManager::instance(); - if (wl_mgr.hasParamSet(key)) - { - wl_mgr.setParamSet(key, wl_mgr.mCurParams); - } - else - { - wl_mgr.addParamSet(key, wl_mgr.mCurParams); - } - - wl_mgr.savePreset(key); - - // Change preference if requested. - if (mMakeDefaultCheckBox->getValue()) - { - LL_DEBUGS("Windlight") << key.name << " is now the new preferred sky preset" << llendl; - LLEnvManagerNew::instance().setUseSkyPreset(key.name); - } - - closeFloater(); -} - void LLFloaterEditSky::onSkyPresetListChange() { LLWLParamKey key = getSelectedSkyPreset(); // preset being edited diff --git a/indra/newview/llfloatereditsky.h b/indra/newview/llfloatereditsky.h index 70a90fb5b3..89e7719270 100644 --- a/indra/newview/llfloatereditsky.h +++ b/indra/newview/llfloatereditsky.h @@ -55,6 +55,8 @@ private: //-- WL stuff begins ------------------------------------------------------ + void syncControls(); /// sync up sliders with parameters + // general purpose callbacks for dealing with color controllers void onColorControlRMoved(LLUICtrl* ctrl, void* userdata); void onColorControlGMoved(LLUICtrl* ctrl, void* userdata); @@ -78,8 +80,6 @@ private: void onCloudScrollXToggled(LLUICtrl* ctrl); void onCloudScrollYToggled(LLUICtrl* ctrl); - void syncControls(); /// sync up sliders with parameters - //-- WL stuff ends -------------------------------------------------------- bool isNewPreset() const; |