diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-07-09 11:05:29 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2011-07-09 11:05:29 -0400 |
commit | 961d5b1d65fffff7075d0afbce003586b1f3b197 (patch) | |
tree | d72caf02576506883be2638a458616bd8b5ea292 /indra/newview/llviewermenu.cpp | |
parent | dd6547a55e02a4340cb178c72acff1216a56f84c (diff) | |
parent | b40a44d24d7e59d9102f603a28ab329046e34b5d (diff) |
merge
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 108 |
1 files changed, 55 insertions, 53 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4bf5454905..f38dd12f68 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -45,6 +45,7 @@ #include "llcompilequeue.h" #include "llconsole.h" #include "lldebugview.h" +#include "llenvmanager.h" #include "llfilepicker.h" #include "llfirstuse.h" #include "llfloaterbuy.h" @@ -108,6 +109,7 @@ #include "lltrans.h" #include "lleconomy.h" #include "lltoolgrab.h" +#include "llwindow.h" #include "boost/unordered_map.hpp" using namespace LLVOAvatarDefines; @@ -7585,74 +7587,85 @@ class LLWorldEnvSettings : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string tod = userdata.asString(); - LLVector3 sun_direction; if (tod == "editor") { - // if not there or is hidden, show it LLFloaterReg::toggleInstance("env_settings"); return true; } - + if (tod == "sunrise") { - // set the value, turn off animation - LLWLParamManager::instance()->mAnimator.setDayTime(0.25); - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // then call update once - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); + LLEnvManagerNew::instance().setUseSkyPreset("Sunrise"); } else if (tod == "noon") { - // set the value, turn off animation - LLWLParamManager::instance()->mAnimator.setDayTime(0.567); - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // then call update once - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); + LLEnvManagerNew::instance().setUseSkyPreset("Midday"); } else if (tod == "sunset") { - // set the value, turn off animation - LLWLParamManager::instance()->mAnimator.setDayTime(0.75); - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // then call update once - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); + LLEnvManagerNew::instance().setUseSkyPreset("Sunset"); } else if (tod == "midnight") { - // set the value, turn off animation - LLWLParamManager::instance()->mAnimator.setDayTime(0.0); - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // then call update once - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); + LLEnvManagerNew::instance().setUseSkyPreset("Midnight"); } else { - LLWLParamManager::instance()->mAnimator.mIsRunning = true; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = true; + LLEnvManagerNew::instance().setUseDayCycle(LLEnvManagerNew::instance().getDayCycleName()); } + return true; } }; -/// Water Menu callbacks -class LLWorldWaterSettings : public view_listener_t -{ +class LLWorldEnvPreset : public view_listener_t +{ bool handleEvent(const LLSD& userdata) { - LLFloaterReg::toggleInstance("env_water"); + std::string item = userdata.asString(); + + if (item == "new_water") + { + LLFloaterReg::showInstance("env_edit_water", "new"); + } + else if (item == "edit_water") + { + LLFloaterReg::showInstance("env_edit_water", "edit"); + } + else if (item == "delete_water") + { + LLFloaterReg::showInstance("env_delete_preset", "water"); + } + else if (item == "new_sky") + { + LLFloaterReg::showInstance("env_edit_sky", "new"); + } + else if (item == "edit_sky") + { + LLFloaterReg::showInstance("env_edit_sky", "edit"); + } + else if (item == "delete_sky") + { + LLFloaterReg::showInstance("env_delete_preset", "sky"); + } + else if (item == "new_day_cycle") + { + LLFloaterReg::showInstance("env_edit_day_cycle", "new"); + } + else if (item == "edit_day_cycle") + { + LLFloaterReg::showInstance("env_edit_day_cycle", "edit"); + } + else if (item == "delete_day_cycle") + { + LLFloaterReg::showInstance("env_delete_preset", "day_cycle"); + } + else + { + llwarns << "Unknown item selected" << llendl; + } + return true; } }; @@ -7667,16 +7680,6 @@ class LLWorldPostProcess : public view_listener_t } }; -/// Day Cycle callbacks -class LLWorldDayCycle : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterReg::showInstance("env_day_cycle"); - return true; - } -}; - class LLWorldToggleMovementControls : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -7905,9 +7908,8 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun"); view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings"); - view_listener_t::addMenu(new LLWorldWaterSettings(), "World.WaterSettings"); + view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); - view_listener_t::addMenu(new LLWorldDayCycle(), "World.DayCycle"); view_listener_t::addMenu(new LLWorldToggleMovementControls(), "World.Toggle.MovementControls"); view_listener_t::addMenu(new LLWorldToggleCameraControls(), "World.Toggle.CameraControls"); |