summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterenvironmentadjust.cpp19
-rw-r--r--indra/newview/llfloaterenvironmentadjust.h2
-rw-r--r--indra/newview/skins/default/xui/en/floater_adjust_environment.xml14
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml15
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<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()
{
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">
<layout_stack name="outer_stack"
width="845"
- height="212"
+ height="220"
follows="all"
animate="false"
top="0"
@@ -84,6 +84,16 @@
name="blue_density"
top_pad="5"
width="60"/>
+ <button
+ follows="left|top"
+ height="23"
+ label="Reset"
+ tool_tip="Close and reset to Shared Environment"
+ layout="topleft"
+ name="btn_reset"
+ left_delta="-2"
+ top_pad="10"
+ width="100"/>
<text follows="right|top"
height="10"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 42b1a1ec1b..85b55346c2 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -11345,7 +11345,20 @@ Are you sure you want to continue?
notext="No"
yestext="Yes"/>
</notification>
-
+
+ <notification
+ icon="alertmodal.tga"
+ name="PersonalSettingsConfirmReset"
+ type="alertmodal">
+ You are about to remove all applied Personal lighting settings.
+ Are you sure you want to continue?
+ <tag>confirm</tag>
+ <usetemplate
+ name="okcancelbuttons"
+ notext="No"
+ yestext="Yes"/>
+ </notification>
+
<notification
icon="alertmodal.tga"
name="SettingsMakeNoTrans"