From cc70bf9ea04b6c934fec23d693d6a5b76eaf6df6 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 16 Apr 2019 16:26:52 +0300 Subject: SL-10957 [EEP] Add Reset button to revert to shared environment --- indra/newview/llfloaterenvironmentadjust.cpp | 19 +++++++++++++++++++ indra/newview/llfloaterenvironmentadjust.h | 2 ++ .../default/xui/en/floater_adjust_environment.xml | 14 ++++++++++++-- indra/newview/skins/default/xui/en/notifications.xml | 15 ++++++++++++++- 4 files changed, 47 insertions(+), 3 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(FIELD_SKY_SUN_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunScaleChanged(); }); getChild(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); + getChild(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() { diff --git a/indra/newview/llfloaterenvironmentadjust.h b/indra/newview/llfloaterenvironmentadjust.h index 5bd91b0c43..4876c45065 100644 --- a/indra/newview/llfloaterenvironmentadjust.h +++ b/indra/newview/llfloaterenvironmentadjust.h @@ -77,6 +77,8 @@ private: void onMoonRotationChanged(); + void onButtonReset(); + void onEnvironmentUpdated(LLEnvironment::EnvSelection_t env, S32 version); LLSettingsSky::ptr_t mLiveSky; diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml index e2cf809c9c..fc356c10c7 100644 --- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml +++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml @@ -5,14 +5,14 @@ save_rect="false" title="Personal Lighting" width="845" - height="225" + height="230" min_width="500" min_height="225" single_instance="true" can_resize="false"> +