summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llviewermenu.cpp37
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml9
2 files changed, 46 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index a37f8ad0d8..f74bcafc5c 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -44,6 +44,7 @@
#include "llbottomtray.h"
#include "llcompilequeue.h"
#include "llconsole.h"
+#include "lldaycyclemanager.h"
#include "lldebugview.h"
#include "llenvmanager.h"
#include "llfilepicker.h"
@@ -100,6 +101,7 @@
#include "llworldmap.h"
#include "pipeline.h"
#include "llviewerjoystick.h"
+#include "llwaterparammanager.h"
#include "llwlanimator.h"
#include "llwlparammanager.h"
#include "llfloatercamera.h"
@@ -7667,6 +7669,40 @@ class LLWorldEnvPreset : public view_listener_t
}
};
+class LLWorldEnableEnvPreset : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ std::string item = userdata.asString();
+
+ if (item == "delete_water")
+ {
+ LLWaterParamManager::preset_name_list_t user_waters;
+ LLWaterParamManager::instance().getUserPresetNames(user_waters);
+ return !user_waters.empty();
+ }
+ else if (item == "delete_sky")
+ {
+ LLWLParamManager::preset_name_list_t user_skies;
+ LLWLParamManager::instance().getUserPresetNames(user_skies);
+ return !user_skies.empty();
+ }
+ else if (item == "delete_day_cycle")
+ {
+ LLDayCycleManager::preset_name_list_t user_days;
+ LLDayCycleManager::instance().getUserPresetNames(user_days);
+ return !user_days.empty();
+ }
+ else
+ {
+ llwarns << "Unknown item" << llendl;
+ }
+
+ return false;
+ }
+};
+
+
/// Post-Process callbacks
class LLWorldPostProcess : public view_listener_t
{
@@ -7906,6 +7942,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings");
view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset");
+ view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset");
view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess");
view_listener_t::addMenu(new LLWorldToggleMovementControls(), "World.Toggle.MovementControls");
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 317c6fe9ac..ab5c543376 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -557,6 +557,9 @@
<menu_item_call.on_click
function="World.EnvPreset"
parameter="delete_water"/>
+ <menu_item_call.on_enable
+ function="World.EnableEnvPreset"
+ parameter="delete_water"/>
</menu_item_call>
</menu>
@@ -583,6 +586,9 @@
<menu_item_call.on_click
function="World.EnvPreset"
parameter="delete_sky"/>
+ <menu_item_call.on_enable
+ function="World.EnableEnvPreset"
+ parameter="delete_sky"/>
</menu_item_call>
</menu>
@@ -609,6 +615,9 @@
<menu_item_call.on_click
function="World.EnvPreset"
parameter="delete_day_cycle"/>
+ <menu_item_call.on_enable
+ function="World.EnableEnvPreset"
+ parameter="delete_day_cycle"/>
</menu_item_call>
</menu>
</menu>