summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditsky.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2017-11-10 16:17:25 -0800
committerRider Linden <rider@lindenlab.com>2017-11-10 16:17:25 -0800
commitb37eb2642f6e6e4d1e32a49c7ab31f70321cd979 (patch)
tree3ec6bd8233525b5a96f0a0308f1d6100c59fb32f /indra/newview/llfloatereditsky.cpp
parentd709c7f35ebfd1945fd036b859f56b349d01dfe7 (diff)
Remove delete preset dialog, Initial settings for selection level (Region/Parcel/Local)
Diffstat (limited to 'indra/newview/llfloatereditsky.cpp')
-rw-r--r--indra/newview/llfloatereditsky.cpp44
1 files changed, 14 insertions, 30 deletions
diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp
index 715376cfa3..a779241cf4 100644
--- a/indra/newview/llfloatereditsky.cpp
+++ b/indra/newview/llfloatereditsky.cpp
@@ -59,10 +59,6 @@ namespace
const F32 WL_CLOUD_SLIDER_SCALE(1.0f);
}
-// static F32 sun_pos_to_time24(F32 sun_pos)
-// {
-// return fmodf(sun_pos * 24.0f + 6, 24.0f);
-// }
static F32 time24_to_sun_pos(F32 time24)
{
@@ -129,7 +125,7 @@ void LLFloaterEditSky::onClose(bool app_quitting)
{
if (!app_quitting) // there's no point to change environment if we're quitting
{
- LLEnvironment::instance().clearAllSelected();
+ LLEnvironment::instance().applyChosenEnvironment();
}
}
@@ -672,40 +668,28 @@ bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& respon
void LLFloaterEditSky::onSaveConfirmed()
{
-#if 0
- // Save current params to the selected preset.
- LLWLParamKey key(getSelectedSkyPreset());
+ // Save currently displayed water params to the selected preset.
+ std::string name = mEditSettings->getName();
- 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);
- }
+ LL_DEBUGS("Windlight") << "Saving sky preset " << name << LL_ENDL;
- wl_mgr.savePreset(key);
+ LLEnvironment::instance().addSky(mEditSettings);
- // Change preference if requested.
- if (mMakeDefaultCheckBox->getValue())
- {
- LL_DEBUGS("Windlight") << key.name << " is now the new preferred sky preset" << LL_ENDL;
- LLEnvManagerNew::instance().setUseSkyPreset(key.name);
- }
+ // Change preference if requested.
+ if (mMakeDefaultCheckBox->getEnabled() && mMakeDefaultCheckBox->getValue())
+ {
+ LL_DEBUGS("Windlight") << name << " is now the new preferred sky preset" << LL_ENDL;
+ LLEnvironment::instance().setUserSky(mEditSettings);
+ }
- closeFloater();
-#endif
+ closeFloater();
}
void LLFloaterEditSky::onBtnSave()
{
- LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
- LLEnvironment::instance().addSky(psky);
+ LLEnvironment::instance().addSky(mEditSettings);
+ LLEnvironment::instance().setUserSky(mEditSettings);
- LLEnvironment::instance().applySky();
closeFloater();
}