summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterenvironmentadjust.cpp
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2019-04-16 16:26:52 +0300
committermaxim_productengine <mnikolenko@productengine.com>2019-04-16 16:26:52 +0300
commitcc70bf9ea04b6c934fec23d693d6a5b76eaf6df6 (patch)
treec6eadf2f3994e8bbf70eda3149e582ef28852496 /indra/newview/llfloaterenvironmentadjust.cpp
parent479385c97fa2d433c85598f6871274c970a6f9a7 (diff)
SL-10957 [EEP] Add Reset button to revert to shared environment
Diffstat (limited to 'indra/newview/llfloaterenvironmentadjust.cpp')
-rw-r--r--indra/newview/llfloaterenvironmentadjust.cpp19
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&notif, 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()
{