summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rwxr-xr-xindra/newview/llviewermenu.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index c7c8da27f3..59e98fc882 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -8235,6 +8235,45 @@ class LLWorldEnvSettings : public view_listener_t
}
};
+class LLWorldEnableEnvSettings : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ bool result = false;
+ std::string tod = userdata.asString();
+
+ if (tod == "region")
+ {
+ return LLEnvManagerNew::instance().getUseRegionSettings();
+ }
+
+ if (LLEnvManagerNew::instance().getUseFixedSky())
+ {
+ if (tod == "sunrise")
+ {
+ result = (LLEnvManagerNew::instance().getSkyPresetName() == "Sunrise");
+ }
+ else if (tod == "noon")
+ {
+ result = (LLEnvManagerNew::instance().getSkyPresetName() == "Midday");
+ }
+ else if (tod == "sunset")
+ {
+ result = (LLEnvManagerNew::instance().getSkyPresetName() == "Sunset");
+ }
+ else if (tod == "midnight")
+ {
+ result = (LLEnvManagerNew::instance().getSkyPresetName() == "Midnight");
+ }
+ else
+ {
+ llwarns << "Unknown item" << llendl;
+ }
+ }
+ return result;
+ }
+};
+
class LLWorldEnvPreset : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -8573,6 +8612,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun");
view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings");
+ view_listener_t::addMenu(new LLWorldEnableEnvSettings(), "World.EnableEnvSettings");
view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset");
view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset");
view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess");