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 | |
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')
-rw-r--r-- | indra/newview/llfloaterenvsettings.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llfloaterenvsettings.h | 4 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 39 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_env_settings.xml | 10 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 18 |
5 files changed, 59 insertions, 37 deletions
diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index 2fa022049d..a2a6005b14 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -71,31 +71,9 @@ BOOL LLFloaterEnvSettings::postBuild() initCallbacks(); syncMenu(); - LLEnvKey::EScope cur_scope = LLEnvManager::getInstance()->getNormallyDisplayedScope(); - childSetValue("RegionWLOptIn", cur_scope == LLEnvKey::SCOPE_REGION); - return TRUE; } -void LLFloaterEnvSettings::onUseRegionEnvironment(LLUICtrl* ctrl, void* data) -{ - //LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data; - LLCheckBoxCtrl* checkbox = static_cast<LLCheckBoxCtrl*>(ctrl); //self->getChildView("RegionWLOptIn"); - setOptIn(checkbox->getValue().asBoolean()); -} - -void LLFloaterEnvSettings::setOptIn(bool opt_in) -{ - if (opt_in) - { - LLEnvManager::getInstance()->setNormallyDisplayedScope(LLEnvKey::SCOPE_REGION); - } - else - { - LLEnvManager::getInstance()->setNormallyDisplayedScope(LLEnvKey::SCOPE_LOCAL); - } -} - void LLFloaterEnvSettings::initCallbacks(void) { // our three sliders @@ -112,8 +90,7 @@ void LLFloaterEnvSettings::initCallbacks(void) childSetCommitCallback("EnvUseEstateTimeButton", &LLFloaterEnvSettings::onUseEstateTime, NULL); getChild<LLUICtrl>("EnvUseLocalTimeButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onUseLocalTime)); - childSetCommitCallback("RegionWLOptIn", &LLFloaterEnvSettings::onUseRegionEnvironment, NULL); - getChild<LLUICtrl>("RegionWLOptIn")->setRightMouseDownCallback(boost::bind(&LLEnvManager::dumpScopes, &LLEnvManager::instance())); + getChild<LLUICtrl>("EnvUseEstateTimeButton")->setRightMouseDownCallback(boost::bind(&LLEnvManager::dumpScopes, &LLEnvManager::instance())); } diff --git a/indra/newview/llfloaterenvsettings.h b/indra/newview/llfloaterenvsettings.h index 440c73961f..b93bf07395 100644 --- a/indra/newview/llfloaterenvsettings.h +++ b/indra/newview/llfloaterenvsettings.h @@ -74,9 +74,6 @@ public: /// sync time with local clock static void onUseLocalTime(); - // opt-in for region Windlight settings - //static void onUseRegionEnvironment(LLUICtrl* ctrl, void* userData); - static void onUseRegionEnvironment(LLUICtrl*, void*); //// menu management @@ -86,7 +83,6 @@ public: private: // one instance on the inside - static void setOptIn(bool opt_in); }; 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"); diff --git a/indra/newview/skins/default/xui/en/floater_env_settings.xml b/indra/newview/skins/default/xui/en/floater_env_settings.xml index dbd75495b1..e6cf433c8d 100644 --- a/indra/newview/skins/default/xui/en/floater_env_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_env_settings.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater legacy_header_height="18" - height="165" + height="150" layout="topleft" name="Environment Editor Floater" help_topic="environment_editor_floater" @@ -134,12 +134,6 @@ name="EnvWaterFogSlider" top_delta="4" width="210" /> - <check_box - follows="left|top" - label="Use Region Environment Settings" - left="8" - name="RegionWLOptIn" - top_pad="20" /> <button follows="left|top" height="23" @@ -147,7 +141,7 @@ layout="topleft" left="10" name="EnvUseEstateTimeButton" - top_pad="6" + top_pad="20" width="137" /> <button follows="left|top" diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 51610c0ae0..150e067ab2 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -470,7 +470,7 @@ <menu_item_separator/> - <menu + <menu create_jump_keys="true" label="Sun" name="Environment Settings" @@ -523,6 +523,22 @@ parameter="editor" /> </menu_item_call> </menu> + <menu + create_jump_keys="true" + label="Edit My Environment" + name="Environment" + tear_off="true"> + <menu_item_check + label="Use Region Settings" + name="Use Region Settings"> + <on_check + function="World.CheckEnvironment" + parameter="use_region_settings" /> + <on_click + function="World.Environment" + parameter="use_region_settings" /> + </menu_item_check> + </menu> </menu> <menu create_jump_keys="true" |