diff options
author | Rider Linden <rider@lindenlab.com> | 2019-04-18 00:19:35 +0000 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2019-04-18 00:19:35 +0000 |
commit | 83e0af9f95c39b1385cd63df46874b040a408af6 (patch) | |
tree | 43cc4baf9b75fde5328b21bf51a966e17c68c141 /indra/newview/llfloaterenvironmentadjust.cpp | |
parent | 5f8cca95f8890d22496932827626f6c437d2b188 (diff) | |
parent | cc70bf9ea04b6c934fec23d693d6a5b76eaf6df6 (diff) |
Merged in maxim_productengine/viewer-eep (pull request #353)
SL-10957 [EEP] Add Reset button to revert to shared environment
Diffstat (limited to 'indra/newview/llfloaterenvironmentadjust.cpp')
-rw-r--r-- | indra/newview/llfloaterenvironmentadjust.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp index 6773e2dcaf..2c646799ff 100644 --- a/indra/newview/llfloaterenvironmentadjust.cpp +++ b/indra/newview/llfloaterenvironmentadjust.cpp @@ -28,6 +28,7 @@ #include "llfloaterenvironmentadjust.h" +#include "llnotificationsutil.h" #include "llslider.h" #include "llsliderctrl.h" #include "llcolorswatch.h" @@ -53,6 +54,7 @@ namespace const std::string FIELD_SKY_GLOW_SIZE("glow_size"); const std::string FIELD_SKY_STAR_BRIGHTNESS("star_brightness"); const std::string FIELD_SKY_MOON_ROTATION("moon_rotation"); + const std::string BTN_RESET("btn_reset"); const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f); const F32 SLIDER_SCALE_BLUE_HORIZON_DENSITY(2.0f); @@ -93,6 +95,7 @@ BOOL LLFloaterEnvironmentAdjust::postBuild() getChild<LLUICtrl>(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); }); getChild<LLUICtrl>(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); + getChild<LLUICtrl>(BTN_RESET)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onButtonReset(); }); refresh(); return TRUE; @@ -184,6 +187,22 @@ void LLFloaterEnvironmentAdjust::captureCurrentEnvironment() } +void LLFloaterEnvironmentAdjust::onButtonReset() +{ + LLNotificationsUtil::add("PersonalSettingsConfirmReset", LLSD(), LLSD(), + [this](const LLSD¬if, const LLSD&resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + { + this->closeFloater(); + LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().updateEnvironment(); + } + }); + +} //------------------------------------------------------------------------- void LLFloaterEnvironmentAdjust::onAmbientLightChanged() { |