diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-04-19 23:24:28 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-04-19 23:24:28 +0300 |
commit | db6862e15b1ff6257593eab798250316a350cf73 (patch) | |
tree | a3683abe55ec9b59e7be600a4ee58428fc837758 /indra/newview/llviewermenu.cpp | |
parent | 302e0bc87ec6429de1c4e29ed8469c2b1de766d5 (diff) |
STORM-1174 FIX Moved "Use Region Environment Settings" to the "World -> Edit My Environment" menu.
It has been a checkbox in the environment editor.
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3fe2cf3bb2..6f06e766e8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -44,6 +44,7 @@ #include "llcompilequeue.h" #include "llconsole.h" #include "lldebugview.h" +#include "llenvmanager.h" #include "llfilepicker.h" #include "llfirstuse.h" #include "llfloaterbuy.h" @@ -7633,6 +7634,42 @@ class LLWorldEnvSettings : public view_listener_t } }; +class LLWorldCheckEnvironment : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + const std::string& item = userdata.asString(); + + if (item == "use_region_settings") + { + // Check whether we're using region environment settings. + LLEnvKey::EScope cur_scope = LLEnvManager::getInstance()->getNormallyDisplayedScope(); + return cur_scope == LLEnvKey::SCOPE_REGION; + } + + return true; + } +}; + +class LLWorldEnvironment : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + const std::string& item = userdata.asString(); + + if (item == "use_region_settings") + { + // Toggle using region environment settings. + LLEnvManager* env_mgr = LLEnvManager::getInstance(); + LLEnvKey::EScope cur_scope = env_mgr->getNormallyDisplayedScope(); + LLEnvKey::EScope new_scope = (cur_scope == LLEnvKey::SCOPE_LOCAL ? LLEnvKey::SCOPE_REGION : LLEnvKey::SCOPE_LOCAL); + env_mgr->setNormallyDisplayedScope(new_scope); + } + + return true; + } +}; + /// Post-Process callbacks class LLWorldPostProcess : public view_listener_t { @@ -7881,6 +7918,8 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun"); view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings"); + view_listener_t::addEnable(new LLWorldCheckEnvironment(), "World.CheckEnvironment"); + view_listener_t::addMenu(new LLWorldEnvironment(), "World.Environment"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); view_listener_t::addMenu(new LLWorldDayCycle(), "World.DayCycle"); |