diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 126 |
1 files changed, 43 insertions, 83 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5bbf5650ad..647489666f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -51,9 +51,8 @@ #include "llagentpilot.h" #include "llcompilequeue.h" #include "llconsole.h" -#include "lldaycyclemanager.h" #include "lldebugview.h" -#include "llenvmanager.h" +#include "llenvironment.h" #include "llfacebookconnect.h" #include "llfilepicker.h" #include "llfirstuse.h" @@ -121,9 +120,6 @@ #include "llworldmap.h" #include "pipeline.h" #include "llviewerjoystick.h" -#include "llwaterparammanager.h" -#include "llwlanimator.h" -#include "llwlparammanager.h" #include "llfloatercamera.h" #include "lluilistener.h" #include "llappearancemgr.h" @@ -135,6 +131,7 @@ #include "llstartup.h" #include "boost/unordered_map.hpp" #include "llcleanup.h" +#include "llviewershadermgr.h" using namespace LLAvatarAppearanceDefines; @@ -8394,32 +8391,30 @@ class LLWorldEnvSettings : public view_listener_t if (tod == "sunrise") { - LLEnvManagerNew::instance().setUseSkyPreset("Sunrise"); + LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName("Sunrise"); + LLEnvironment::instance().setSkyFor(LLEnvironment::ENV_LOCAL, psky); } else if (tod == "noon") { - LLEnvManagerNew::instance().setUseSkyPreset("Midday"); - } + LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName("Midday"); + LLEnvironment::instance().setSkyFor(LLEnvironment::ENV_LOCAL, psky); + } else if (tod == "sunset") { - LLEnvManagerNew::instance().setUseSkyPreset("Sunset"); - } + LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName("Sunset"); + LLEnvironment::instance().setSkyFor(LLEnvironment::ENV_LOCAL, psky); + } else if (tod == "midnight") { - LLEnvManagerNew::instance().setUseSkyPreset("Midnight"); - } + LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName("Midnight"); + LLEnvironment::instance().setSkyFor(LLEnvironment::ENV_LOCAL, psky); + } else { - LLEnvManagerNew &envmgr = LLEnvManagerNew::instance(); - // reset all environmental settings to track the region defaults, make this reset 'sticky' like the other sun settings. - bool use_fixed_sky = false; - bool use_region_settings = true; - envmgr.setUserPrefs(envmgr.getWaterPresetName(), - envmgr.getSkyPresetName(), - envmgr.getDayCycleName(), - use_fixed_sky, use_region_settings); + LLEnvironment::instance().clearUserSettings(); } - + + LLEnvironment::instance().applyChosenEnvironment(); return true; } }; @@ -8431,37 +8426,38 @@ class LLWorldEnableEnvSettings : public view_listener_t bool result = false; std::string tod = userdata.asString(); - if (LLEnvManagerNew::instance().getUseRegionSettings()) + LLSettingsSky::ptr_t sky = LLEnvironment::instance().getSkyFor(LLEnvironment::ENV_LOCAL); + + if (!sky) { return (tod == "region"); } - if (LLEnvManagerNew::instance().getUseFixedSky()) + std::string skyname = (sky) ? sky->getName() : ""; + + if (tod == "sunrise") { - 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 if (tod == "region") - { - return false; - } - else - { - LL_WARNS() << "Unknown time-of-day item: " << tod << LL_ENDL; - } + result = (skyname == "Sunrise"); + } + else if (tod == "noon") + { + result = (skyname == "Midday"); + } + else if (tod == "sunset") + { + result = (skyname == "Sunset"); + } + else if (tod == "midnight") + { + result = (skyname == "Midnight"); + } + else if (tod == "region") + { + return false; + } + else + { + LL_WARNS() << "Unknown time-of-day item: " << tod << LL_ENDL; } return result; } @@ -8481,10 +8477,6 @@ class LLWorldEnvPreset : public view_listener_t { 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"); @@ -8493,10 +8485,6 @@ class LLWorldEnvPreset : public view_listener_t { 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"); @@ -8505,10 +8493,6 @@ class LLWorldEnvPreset : public view_listener_t { LLFloaterReg::showInstance("env_edit_day_cycle", "edit"); } - else if (item == "delete_day_cycle") - { - LLFloaterReg::showInstance("env_delete_preset", "day_cycle"); - } else { LL_WARNS() << "Unknown item selected" << LL_ENDL; @@ -8522,30 +8506,6 @@ class LLWorldEnableEnvPreset : public view_listener_t { bool handleEvent(const LLSD& userdata) { - std::string item = userdata.asString(); - - if (item == "delete_water") - { - LLWaterParamManager::preset_name_list_t user_waters; - LLWaterParamManager::instance().getUserPresetNames(user_waters); - return !user_waters.empty(); - } - else if (item == "delete_sky") - { - LLWLParamManager::preset_name_list_t user_skies; - LLWLParamManager::instance().getUserPresetNames(user_skies); - return !user_skies.empty(); - } - else if (item == "delete_day_cycle") - { - LLDayCycleManager::preset_name_list_t user_days; - LLDayCycleManager::instance().getUserPresetNames(user_days); - return !user_days.empty(); - } - else - { - LL_WARNS() << "Unknown item" << LL_ENDL; - } return false; } |