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 88f1dd14ff..9c08ec7e77 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -8225,6 +8225,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)
@@ -8563,6 +8602,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");