summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-07-19 15:44:19 -0400
committerOz Linden <oz@lindenlab.com>2011-07-19 15:44:19 -0400
commit41890cfee81b1883f8f1c80cc07d4fddbffa6e75 (patch)
tree53598f32cb8964251a8399c28c1a673214a8c7e1 /indra
parent51f251b2d581563c316a2d6baff6323c25bbdc86 (diff)
parentb1473d4b6bbcbfd67af80f8f1d2f7a7584677c5c (diff)
merge changes for storm-1502
Diffstat (limited to 'indra')
-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>