From 52b0d4173cec0f643f37d426aef8f5ab1fdf3232 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 27 Sep 2017 09:36:26 -0700 Subject: No longer 'goth windlight only', sky parameters passed from settings object. --- indra/newview/llfloaterenvironmentsettings.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterenvironmentsettings.cpp') diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index 4dbc8cdee0..3a059e92dc 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -37,6 +37,8 @@ #include "llwlparamset.h" #include "llwlparammanager.h" +#include "llenvironment.h" + LLFloaterEnvironmentSettings::LLFloaterEnvironmentSettings(const LLSD &key) : LLFloater(key) ,mRegionSettingsRadioGroup(NULL) @@ -188,7 +190,9 @@ void LLFloaterEnvironmentSettings::apply() { if (use_fixed_sky) { - env_mgr.useSkyPreset(sky_preset); + /* LAPRAS */ + //env_mgr.useSkyPreset(sky_preset); + LLEnvironment::instance().selectSky(sky_preset); } else { -- cgit v1.2.3 From cc22ffc6d799544e8f2a9dfed6813081d908c88d Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 13 Oct 2017 17:17:49 -0700 Subject: Watter settings active and start of new joystick button type. --- indra/newview/llfloaterenvironmentsettings.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'indra/newview/llfloaterenvironmentsettings.cpp') diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index 3a059e92dc..39907b19a3 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -32,10 +32,6 @@ #include "llradiogroup.h" #include "lldaycyclemanager.h" -#include "llenvmanager.h" -#include "llwaterparammanager.h" -#include "llwlparamset.h" -#include "llwlparammanager.h" #include "llenvironment.h" @@ -74,10 +70,10 @@ BOOL LLFloaterEnvironmentSettings::postBuild() setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this)); - LLEnvManagerNew::instance().setPreferencesChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::refresh, this)); - LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLFloaterEnvironmentSettings::populateDayCyclePresetsList, this)); - LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::populateSkyPresetsList, this)); - LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::populateWaterPresetsList, this)); +// LLEnvManagerNew::instance().setPreferencesChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::refresh, this)); +// LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLFloaterEnvironmentSettings::populateDayCyclePresetsList, this)); +// LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::populateSkyPresetsList, this)); +// LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::populateWaterPresetsList, this)); return TRUE; } @@ -199,7 +195,9 @@ void LLFloaterEnvironmentSettings::apply() env_mgr.useDayCycle(day_cycle, LLEnvKey::SCOPE_LOCAL); } - env_mgr.useWaterPreset(water_preset); + /* LAPRAS */ + //env_mgr.useWaterPreset(water_preset); + LLEnvironment::instance().selectWater(water_preset); } } @@ -214,7 +212,7 @@ void LLFloaterEnvironmentSettings::populateWaterPresetsList() mWaterPresetCombo->removeall(); std::list user_presets, system_presets; - LLWaterParamManager::instance().getPresetNames(user_presets, system_presets); + //LLWaterParamManager::instance().getPresetNames(user_presets, system_presets); // Add user presets first. for (std::list::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) -- cgit v1.2.3 From 61e6632a713041e8e4ccebf72874767238bf8a48 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 3 Nov 2017 11:28:08 -0700 Subject: Initial day cycle impl. --- indra/newview/llfloaterenvironmentsettings.cpp | 112 ++++++++++--------------- 1 file changed, 43 insertions(+), 69 deletions(-) (limited to 'indra/newview/llfloaterenvironmentsettings.cpp') diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index 39907b19a3..e25c5cedbf 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -70,10 +70,10 @@ BOOL LLFloaterEnvironmentSettings::postBuild() setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this)); + LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEnvironmentSettings::populateSkyPresetsList, this)); + LLEnvironment::instance().setWaterListChange(boost::bind(&LLFloaterEnvironmentSettings::populateWaterPresetsList, this)); + LLEnvironment::instance().setDayCycleListChange(boost::bind(&LLFloaterEnvironmentSettings::populateDayCyclePresetsList, this)); // LLEnvManagerNew::instance().setPreferencesChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::refresh, this)); -// LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLFloaterEnvironmentSettings::populateDayCyclePresetsList, this)); -// LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::populateSkyPresetsList, this)); -// LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::populateWaterPresetsList, this)); return TRUE; } @@ -84,6 +84,14 @@ void LLFloaterEnvironmentSettings::onOpen(const LLSD& key) refresh(); } +//virtual +void LLFloaterEnvironmentSettings::onClose(bool app_quitting) +{ + if (!app_quitting) + LLEnvironment::instance().clearAllSelected(); +} + + void LLFloaterEnvironmentSettings::onSwitchRegionSettings() { getChild("user_environment_settings")->setEnabled(mRegionSettingsRadioGroup->getSelectedIndex() != 0); @@ -133,6 +141,7 @@ void LLFloaterEnvironmentSettings::onBtnOK() use_region_settings); // *TODO: This triggers applying user preferences again, which is suboptimal. + LLEnvironment::instance().applyAllSelected(); closeFloater(); } @@ -173,9 +182,9 @@ void LLFloaterEnvironmentSettings::apply() // Update environment with the user choice. bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; - std::string water_preset = mWaterPresetCombo->getValue().asString(); - std::string sky_preset = mSkyPresetCombo->getValue().asString(); - std::string day_cycle = mDayCyclePresetCombo->getValue().asString(); + std::string water_preset = mWaterPresetCombo->getValue()[0].asString(); + std::string sky_preset = mSkyPresetCombo->getValue()[0].asString(); + std::string day_cycle = mDayCyclePresetCombo->getValue()[0].asString(); LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); if (use_region_settings) @@ -186,18 +195,23 @@ void LLFloaterEnvironmentSettings::apply() { if (use_fixed_sky) { - /* LAPRAS */ - //env_mgr.useSkyPreset(sky_preset); - LLEnvironment::instance().selectSky(sky_preset); + LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName(sky_preset); + if (psky) + LLEnvironment::instance().selectSky(psky); } else { - env_mgr.useDayCycle(day_cycle, LLEnvKey::SCOPE_LOCAL); + LLSettingsDayCycle::ptr_t pday = LLEnvironment::instance().findDayCycleByName(day_cycle); + if (pday) + LLEnvironment::instance().selectDayCycle(pday); + +// LLEnvironment::instance().selectDayCycle(day_cycle); +// env_mgr.useDayCycle(day_cycle, LLEnvKey::SCOPE_LOCAL); } - /* LAPRAS */ - //env_mgr.useWaterPreset(water_preset); - LLEnvironment::instance().selectWater(water_preset); + LLSettingsWater::ptr_t pwater = LLEnvironment::instance().findWaterByName(water_preset); + if (pwater) + LLEnvironment::instance().selectWater(pwater); } } @@ -209,76 +223,36 @@ void LLFloaterEnvironmentSettings::cancel() void LLFloaterEnvironmentSettings::populateWaterPresetsList() { - mWaterPresetCombo->removeall(); + mWaterPresetCombo->removeall(); - std::list user_presets, system_presets; - //LLWaterParamManager::instance().getPresetNames(user_presets, system_presets); + LLEnvironment::list_name_id_t list = LLEnvironment::instance().getWaterList(); - // Add user presets first. - for (std::list::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) - { - mWaterPresetCombo->add(*it); - } - - if (user_presets.size() > 0) - { - mWaterPresetCombo->addSeparator(); - } - - // Add system presets. - for (std::list::const_iterator it = system_presets.begin(); it != system_presets.end(); ++it) - { - mWaterPresetCombo->add(*it); - } + for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) + { + mWaterPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); + } } void LLFloaterEnvironmentSettings::populateSkyPresetsList() { mSkyPresetCombo->removeall(); - LLWLParamManager::preset_name_list_t region_presets; // unused as we don't list region presets here - LLWLParamManager::preset_name_list_t user_presets, sys_presets; - LLWLParamManager::instance().getPresetNames(region_presets, user_presets, sys_presets); + LLEnvironment::list_name_id_t list = LLEnvironment::instance().getSkyList(); - // Add user presets. - for (LLWLParamManager::preset_name_list_t::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) - { - mSkyPresetCombo->add(*it); - } - - if (!user_presets.empty()) - { - mSkyPresetCombo->addSeparator(); - } - - // Add system presets. - for (LLWLParamManager::preset_name_list_t::const_iterator it = sys_presets.begin(); it != sys_presets.end(); ++it) - { - mSkyPresetCombo->add(*it); - } + for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) + { + mSkyPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); + } } void LLFloaterEnvironmentSettings::populateDayCyclePresetsList() { mDayCyclePresetCombo->removeall(); - LLDayCycleManager::preset_name_list_t user_days, sys_days; - LLDayCycleManager::instance().getPresetNames(user_days, sys_days); + LLEnvironment::list_name_id_t list = LLEnvironment::instance().getDayCycleList(); - // Add user days. - for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it) - { - mDayCyclePresetCombo->add(*it); - } - - if (user_days.size() > 0) - { - mDayCyclePresetCombo->addSeparator(); - } - - // Add system days. - for (LLDayCycleManager::preset_name_list_t::const_iterator it = sys_days.begin(); it != sys_days.end(); ++it) - { - mDayCyclePresetCombo->add(*it); - } + for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) + { + mDayCyclePresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); + } } -- cgit v1.2.3 From fe846ec9942af5ad2ab6a4aad9e8561ba9bc1fba Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 8 Nov 2017 16:02:20 -0800 Subject: Day cycles and animated sky/water blending. --- indra/newview/llfloaterenvironmentsettings.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/newview/llfloaterenvironmentsettings.cpp') diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index e25c5cedbf..eaef017f08 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -1,25 +1,25 @@ -/** +/** * @file llfloaterenvironmentsettings.cpp * @brief LLFloaterEnvironmentSettings class definition * * $LicenseInfo:firstyear=2011&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2011, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -35,6 +35,7 @@ #include "llenvironment.h" + LLFloaterEnvironmentSettings::LLFloaterEnvironmentSettings(const LLSD &key) : LLFloater(key) ,mRegionSettingsRadioGroup(NULL) @@ -197,13 +198,13 @@ void LLFloaterEnvironmentSettings::apply() { LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName(sky_preset); if (psky) - LLEnvironment::instance().selectSky(psky); + LLEnvironment::instance().selectSky(psky, LLEnvironment::TRANSITION_FAST); } else { LLSettingsDayCycle::ptr_t pday = LLEnvironment::instance().findDayCycleByName(day_cycle); if (pday) - LLEnvironment::instance().selectDayCycle(pday); + LLEnvironment::instance().selectDayCycle(pday, LLEnvironment::TRANSITION_FAST); // LLEnvironment::instance().selectDayCycle(day_cycle); // env_mgr.useDayCycle(day_cycle, LLEnvKey::SCOPE_LOCAL); @@ -211,7 +212,7 @@ void LLFloaterEnvironmentSettings::apply() LLSettingsWater::ptr_t pwater = LLEnvironment::instance().findWaterByName(water_preset); if (pwater) - LLEnvironment::instance().selectWater(pwater); + LLEnvironment::instance().selectWater(pwater, LLEnvironment::TRANSITION_FAST); } } -- cgit v1.2.3 From b37eb2642f6e6e4d1e32a49c7ab31f70321cd979 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 10 Nov 2017 16:17:25 -0800 Subject: Remove delete preset dialog, Initial settings for selection level (Region/Parcel/Local) --- indra/newview/llfloaterenvironmentsettings.cpp | 88 +++++++++++++++++++------- 1 file changed, 64 insertions(+), 24 deletions(-) (limited to 'indra/newview/llfloaterenvironmentsettings.cpp') diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index eaef017f08..6908363839 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -65,16 +65,13 @@ BOOL LLFloaterEnvironmentSettings::postBuild() mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSelectDayCyclePreset, this)); childSetCommitCallback("ok_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnOK, this), NULL); - getChild("ok_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance())); childSetCommitCallback("cancel_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnCancel, this), NULL); - getChild("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance())); setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this)); LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEnvironmentSettings::populateSkyPresetsList, this)); LLEnvironment::instance().setWaterListChange(boost::bind(&LLFloaterEnvironmentSettings::populateWaterPresetsList, this)); LLEnvironment::instance().setDayCycleListChange(boost::bind(&LLFloaterEnvironmentSettings::populateDayCyclePresetsList, this)); -// LLEnvManagerNew::instance().setPreferencesChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::refresh, this)); return TRUE; } @@ -89,7 +86,7 @@ void LLFloaterEnvironmentSettings::onOpen(const LLSD& key) void LLFloaterEnvironmentSettings::onClose(bool app_quitting) { if (!app_quitting) - LLEnvironment::instance().clearAllSelected(); + LLEnvironment::instance().applyChosenEnvironment(); } @@ -127,6 +124,41 @@ void LLFloaterEnvironmentSettings::onSelectDayCyclePreset() void LLFloaterEnvironmentSettings::onBtnOK() { + bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; + + if (use_region_settings) + { + LLEnvironment::instance().clearUserSettings(); + } + else + { + LLEnvironment::instance().clearUserSettings(); + + bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; + + if (!use_fixed_sky) + { + std::string day_cycle = mDayCyclePresetCombo->getValue().asString(); + LLSettingsDay::ptr_t day = LLEnvironment::instance().findDayCycleByName(day_cycle); + if (day) + { + LLEnvironment::instance().setDayFor(LLEnvironment::ENV_LOCAL, day); + } + } + else + { + std::string water_preset = mWaterPresetCombo->getValue().asString(); + std::string sky_preset = mSkyPresetCombo->getValue().asString(); + + LLSettingsSky::ptr_t sky = LLEnvironment::instance().findSkyByName(sky_preset); + LLSettingsWater::ptr_t water = LLEnvironment::instance().findWaterByName(water_preset); + + LLEnvironment::instance().setSkyFor(LLEnvironment::ENV_LOCAL, sky); + LLEnvironment::instance().setWaterFor(LLEnvironment::ENV_LOCAL, water); + } + } + +#if 0 // Save and apply new user preferences. bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; @@ -142,8 +174,8 @@ void LLFloaterEnvironmentSettings::onBtnOK() use_region_settings); // *TODO: This triggers applying user preferences again, which is suboptimal. - LLEnvironment::instance().applyAllSelected(); - closeFloater(); +#endif + closeFloater(); } void LLFloaterEnvironmentSettings::onBtnCancel() @@ -153,10 +185,13 @@ void LLFloaterEnvironmentSettings::onBtnCancel() void LLFloaterEnvironmentSettings::refresh() { - LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); + LLSettingsDay::ptr_t day = LLEnvironment::instance().getChosenDay(); + LLSettingsSky::ptr_t sky = LLEnvironment::instance().getChosenSky(); + LLSettingsWater::ptr_t water = LLEnvironment::instance().getChosenWater(); - bool use_region_settings = env_mgr.getUseRegionSettings(); - bool use_fixed_sky = env_mgr.getUseFixedSky(); + + bool use_region_settings = true; + bool use_fixed_sky = !day; // Set up radio buttons according to user preferences. mRegionSettingsRadioGroup->setSelectedIndex(use_region_settings ? 0 : 1); @@ -173,9 +208,18 @@ void LLFloaterEnvironmentSettings::refresh() mDayCyclePresetCombo->setEnabled(!use_fixed_sky); // Select the current presets in combo boxes. - mWaterPresetCombo->selectByValue(env_mgr.getWaterPresetName()); - mSkyPresetCombo->selectByValue(env_mgr.getSkyPresetName()); - mDayCyclePresetCombo->selectByValue(env_mgr.getDayCycleName()); + if (water) + mWaterPresetCombo->selectByValue(water->getName()); + else + mWaterPresetCombo->selectByValue(LLSD()); + if (sky) + mSkyPresetCombo->selectByValue(sky->getName()); + else + mSkyPresetCombo->selectByValue(LLSD()); + if (day) + mDayCyclePresetCombo->selectByValue(day->getName()); + else + mDayCyclePresetCombo->selectByValue(LLSD()); } void LLFloaterEnvironmentSettings::apply() @@ -183,14 +227,13 @@ void LLFloaterEnvironmentSettings::apply() // Update environment with the user choice. bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; - std::string water_preset = mWaterPresetCombo->getValue()[0].asString(); - std::string sky_preset = mSkyPresetCombo->getValue()[0].asString(); - std::string day_cycle = mDayCyclePresetCombo->getValue()[0].asString(); + std::string water_preset = mWaterPresetCombo->getValue().asString(); + std::string sky_preset = mSkyPresetCombo->getValue().asString(); + std::string day_cycle = mDayCyclePresetCombo->getValue().asString(); - LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); if (use_region_settings) { - env_mgr.useRegionSettings(); + //env_mgr.useRegionSettings(); } else { @@ -202,12 +245,9 @@ void LLFloaterEnvironmentSettings::apply() } else { - LLSettingsDayCycle::ptr_t pday = LLEnvironment::instance().findDayCycleByName(day_cycle); + LLSettingsDay::ptr_t pday = LLEnvironment::instance().findDayCycleByName(day_cycle); if (pday) LLEnvironment::instance().selectDayCycle(pday, LLEnvironment::TRANSITION_FAST); - -// LLEnvironment::instance().selectDayCycle(day_cycle); -// env_mgr.useDayCycle(day_cycle, LLEnvKey::SCOPE_LOCAL); } LLSettingsWater::ptr_t pwater = LLEnvironment::instance().findWaterByName(water_preset); @@ -230,7 +270,7 @@ void LLFloaterEnvironmentSettings::populateWaterPresetsList() for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) { - mWaterPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); + mWaterPresetCombo->add((*it).first, LLSD::String((*it).first)); // } } @@ -242,7 +282,7 @@ void LLFloaterEnvironmentSettings::populateSkyPresetsList() for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) { - mSkyPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); + mSkyPresetCombo->add((*it).first, LLSD::String((*it).first)); } } @@ -254,6 +294,6 @@ void LLFloaterEnvironmentSettings::populateDayCyclePresetsList() for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) { - mDayCyclePresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); + mDayCyclePresetCombo->add((*it).first, LLSD::String((*it).first)); } } -- cgit v1.2.3 From b227c86b450134f17ec0624655e1e4c5cb5ba89d Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 13 Nov 2017 14:40:54 -0800 Subject: Remove the old wl environment code. --- indra/newview/llfloaterenvironmentsettings.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/llfloaterenvironmentsettings.cpp') diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index 6908363839..9a41d434ee 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -31,8 +31,6 @@ #include "llcombobox.h" #include "llradiogroup.h" -#include "lldaycyclemanager.h" - #include "llenvironment.h" @@ -259,7 +257,7 @@ void LLFloaterEnvironmentSettings::apply() void LLFloaterEnvironmentSettings::cancel() { // Revert environment to user preferences. - LLEnvManagerNew::instance().usePrefs(); +// LLEnvManagerNew::instance().usePrefs(); } void LLFloaterEnvironmentSettings::populateWaterPresetsList() -- cgit v1.2.3 From 0bf50e2f8cfa5f3ccd6165ce935cf0fd9c174ced Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 30 Jan 2018 16:42:34 -0800 Subject: Cleanup on daycyle selection and stack. Move blenders into environment. (Transition bronken, instant only. Shaddows moved based on region, not parcel) --- indra/newview/llfloaterenvironmentsettings.cpp | 34 ++++++++++++++------------ 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'indra/newview/llfloaterenvironmentsettings.cpp') diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index 9a41d434ee..b7bf6918fe 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -84,7 +84,7 @@ void LLFloaterEnvironmentSettings::onOpen(const LLSD& key) void LLFloaterEnvironmentSettings::onClose(bool app_quitting) { if (!app_quitting) - LLEnvironment::instance().applyChosenEnvironment(); + LLEnvironment::instance().updateEnvironment(); } @@ -124,23 +124,24 @@ void LLFloaterEnvironmentSettings::onBtnOK() { bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; + LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); if (use_region_settings) { - LLEnvironment::instance().clearUserSettings(); + LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_PARCEL); } else { - LLEnvironment::instance().clearUserSettings(); - bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; if (!use_fixed_sky) { + std::string day_cycle = mDayCyclePresetCombo->getValue().asString(); LLSettingsDay::ptr_t day = LLEnvironment::instance().findDayCycleByName(day_cycle); if (day) { - LLEnvironment::instance().setDayFor(LLEnvironment::ENV_LOCAL, day); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, day, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); } } else @@ -151,9 +152,9 @@ void LLFloaterEnvironmentSettings::onBtnOK() LLSettingsSky::ptr_t sky = LLEnvironment::instance().findSkyByName(sky_preset); LLSettingsWater::ptr_t water = LLEnvironment::instance().findWaterByName(water_preset); - LLEnvironment::instance().setSkyFor(LLEnvironment::ENV_LOCAL, sky); - LLEnvironment::instance().setWaterFor(LLEnvironment::ENV_LOCAL, water); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::fixedEnvironment_t(sky, water)); } + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); } #if 0 @@ -183,11 +184,12 @@ void LLFloaterEnvironmentSettings::onBtnCancel() void LLFloaterEnvironmentSettings::refresh() { - LLSettingsDay::ptr_t day = LLEnvironment::instance().getChosenDay(); - LLSettingsSky::ptr_t sky = LLEnvironment::instance().getChosenSky(); - LLSettingsWater::ptr_t water = LLEnvironment::instance().getChosenWater(); + LLEnvironment::fixedEnvironment_t fixed = LLEnvironment::instance().getEnvironmentFixed(LLEnvironment::ENV_EDIT); + + LLSettingsDay::ptr_t day = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_EDIT); + LLSettingsSky::ptr_t sky = fixed.first; + LLSettingsWater::ptr_t water = fixed.second; - bool use_region_settings = true; bool use_fixed_sky = !day; @@ -239,18 +241,18 @@ void LLFloaterEnvironmentSettings::apply() { LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName(sky_preset); if (psky) - LLEnvironment::instance().selectSky(psky, LLEnvironment::TRANSITION_FAST); - } + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, psky); + } else { LLSettingsDay::ptr_t pday = LLEnvironment::instance().findDayCycleByName(day_cycle); if (pday) - LLEnvironment::instance().selectDayCycle(pday, LLEnvironment::TRANSITION_FAST); - } + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, pday, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + } LLSettingsWater::ptr_t pwater = LLEnvironment::instance().findWaterByName(water_preset); if (pwater) - LLEnvironment::instance().selectWater(pwater, LLEnvironment::TRANSITION_FAST); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, pwater); } } -- cgit v1.2.3 From 2a613d7363c4e91a7258d4f0ea3971db1569e788 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 1 Jun 2018 16:24:36 -0700 Subject: Rework preset loading and context menu from inventory. --- indra/newview/llfloaterenvironmentsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterenvironmentsettings.cpp') diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp index b7bf6918fe..1b96db6611 100644 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -122,6 +122,7 @@ void LLFloaterEnvironmentSettings::onSelectDayCyclePreset() void LLFloaterEnvironmentSettings::onBtnOK() { +#if 0 bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); @@ -157,7 +158,6 @@ void LLFloaterEnvironmentSettings::onBtnOK() LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); } -#if 0 // Save and apply new user preferences. bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; -- cgit v1.2.3 From 97da85de0b1e0f8c2fc60c156c31b237b869230a Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 11 Jun 2018 11:43:50 -0700 Subject: remove legacy environmental edit floater and some lingering transition functions. Change floater environment switch behavior. --- indra/newview/llfloaterenvironmentsettings.cpp | 299 ------------------------- 1 file changed, 299 deletions(-) delete mode 100644 indra/newview/llfloaterenvironmentsettings.cpp (limited to 'indra/newview/llfloaterenvironmentsettings.cpp') diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp deleted file mode 100644 index 1b96db6611..0000000000 --- a/indra/newview/llfloaterenvironmentsettings.cpp +++ /dev/null @@ -1,299 +0,0 @@ -/** - * @file llfloaterenvironmentsettings.cpp - * @brief LLFloaterEnvironmentSettings class definition - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterenvironmentsettings.h" - -#include "llcombobox.h" -#include "llradiogroup.h" - -#include "llenvironment.h" - - -LLFloaterEnvironmentSettings::LLFloaterEnvironmentSettings(const LLSD &key) -: LLFloater(key) - ,mRegionSettingsRadioGroup(NULL) - ,mDayCycleSettingsRadioGroup(NULL) - ,mWaterPresetCombo(NULL) - ,mSkyPresetCombo(NULL) - ,mDayCyclePresetCombo(NULL) -{ -} - -// virtual -BOOL LLFloaterEnvironmentSettings::postBuild() -{ - mRegionSettingsRadioGroup = getChild("region_settings_radio_group"); - mRegionSettingsRadioGroup->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSwitchRegionSettings, this)); - - mDayCycleSettingsRadioGroup = getChild("sky_dayc_settings_radio_group"); - mDayCycleSettingsRadioGroup->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSwitchDayCycle, this)); - - mWaterPresetCombo = getChild("water_settings_preset_combo"); - mWaterPresetCombo->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSelectWaterPreset, this)); - - mSkyPresetCombo = getChild("sky_settings_preset_combo"); - mSkyPresetCombo->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSelectSkyPreset, this)); - - mDayCyclePresetCombo = getChild("dayc_settings_preset_combo"); - mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSelectDayCyclePreset, this)); - - childSetCommitCallback("ok_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnOK, this), NULL); - childSetCommitCallback("cancel_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnCancel, this), NULL); - - setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this)); - - LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEnvironmentSettings::populateSkyPresetsList, this)); - LLEnvironment::instance().setWaterListChange(boost::bind(&LLFloaterEnvironmentSettings::populateWaterPresetsList, this)); - LLEnvironment::instance().setDayCycleListChange(boost::bind(&LLFloaterEnvironmentSettings::populateDayCyclePresetsList, this)); - - return TRUE; -} - -// virtual -void LLFloaterEnvironmentSettings::onOpen(const LLSD& key) -{ - refresh(); -} - -//virtual -void LLFloaterEnvironmentSettings::onClose(bool app_quitting) -{ - if (!app_quitting) - LLEnvironment::instance().updateEnvironment(); -} - - -void LLFloaterEnvironmentSettings::onSwitchRegionSettings() -{ - getChild("user_environment_settings")->setEnabled(mRegionSettingsRadioGroup->getSelectedIndex() != 0); - - apply(); -} - -void LLFloaterEnvironmentSettings::onSwitchDayCycle() -{ - bool is_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; - - mSkyPresetCombo->setEnabled(is_fixed_sky); - mDayCyclePresetCombo->setEnabled(!is_fixed_sky); - - apply(); -} - -void LLFloaterEnvironmentSettings::onSelectWaterPreset() -{ - apply(); -} - -void LLFloaterEnvironmentSettings::onSelectSkyPreset() -{ - apply(); -} - -void LLFloaterEnvironmentSettings::onSelectDayCyclePreset() -{ - apply(); -} - -void LLFloaterEnvironmentSettings::onBtnOK() -{ -#if 0 - bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; - - LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); - if (use_region_settings) - { - LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_PARCEL); - } - else - { - bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; - - if (!use_fixed_sky) - { - - std::string day_cycle = mDayCyclePresetCombo->getValue().asString(); - LLSettingsDay::ptr_t day = LLEnvironment::instance().findDayCycleByName(day_cycle); - if (day) - { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, day, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); - } - } - else - { - std::string water_preset = mWaterPresetCombo->getValue().asString(); - std::string sky_preset = mSkyPresetCombo->getValue().asString(); - - LLSettingsSky::ptr_t sky = LLEnvironment::instance().findSkyByName(sky_preset); - LLSettingsWater::ptr_t water = LLEnvironment::instance().findWaterByName(water_preset); - - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, LLEnvironment::fixedEnvironment_t(sky, water)); - } - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); - } - - // Save and apply new user preferences. - bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; - bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; - std::string water_preset = mWaterPresetCombo->getValue().asString(); - std::string sky_preset = mSkyPresetCombo->getValue().asString(); - std::string day_cycle = mDayCyclePresetCombo->getValue().asString(); - - LLEnvManagerNew::instance().setUserPrefs( - water_preset, - sky_preset, - day_cycle, - use_fixed_sky, - use_region_settings); - - // *TODO: This triggers applying user preferences again, which is suboptimal. -#endif - closeFloater(); -} - -void LLFloaterEnvironmentSettings::onBtnCancel() -{ - closeFloater(); -} - -void LLFloaterEnvironmentSettings::refresh() -{ - LLEnvironment::fixedEnvironment_t fixed = LLEnvironment::instance().getEnvironmentFixed(LLEnvironment::ENV_EDIT); - - LLSettingsDay::ptr_t day = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_EDIT); - LLSettingsSky::ptr_t sky = fixed.first; - LLSettingsWater::ptr_t water = fixed.second; - - bool use_region_settings = true; - bool use_fixed_sky = !day; - - // Set up radio buttons according to user preferences. - mRegionSettingsRadioGroup->setSelectedIndex(use_region_settings ? 0 : 1); - mDayCycleSettingsRadioGroup->setSelectedIndex(use_fixed_sky ? 0 : 1); - - // Populate the combo boxes with appropriate lists of available presets. - populateWaterPresetsList(); - populateSkyPresetsList(); - populateDayCyclePresetsList(); - - // Enable/disable other controls based on user preferences. - getChild("user_environment_settings")->setEnabled(!use_region_settings); - mSkyPresetCombo->setEnabled(use_fixed_sky); - mDayCyclePresetCombo->setEnabled(!use_fixed_sky); - - // Select the current presets in combo boxes. - if (water) - mWaterPresetCombo->selectByValue(water->getName()); - else - mWaterPresetCombo->selectByValue(LLSD()); - if (sky) - mSkyPresetCombo->selectByValue(sky->getName()); - else - mSkyPresetCombo->selectByValue(LLSD()); - if (day) - mDayCyclePresetCombo->selectByValue(day->getName()); - else - mDayCyclePresetCombo->selectByValue(LLSD()); -} - -void LLFloaterEnvironmentSettings::apply() -{ - // Update environment with the user choice. - bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; - bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; - std::string water_preset = mWaterPresetCombo->getValue().asString(); - std::string sky_preset = mSkyPresetCombo->getValue().asString(); - std::string day_cycle = mDayCyclePresetCombo->getValue().asString(); - - if (use_region_settings) - { - //env_mgr.useRegionSettings(); - } - else - { - if (use_fixed_sky) - { - LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName(sky_preset); - if (psky) - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, psky); - } - else - { - LLSettingsDay::ptr_t pday = LLEnvironment::instance().findDayCycleByName(day_cycle); - if (pday) - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, pday, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); - } - - LLSettingsWater::ptr_t pwater = LLEnvironment::instance().findWaterByName(water_preset); - if (pwater) - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, pwater); - } -} - -void LLFloaterEnvironmentSettings::cancel() -{ - // Revert environment to user preferences. -// LLEnvManagerNew::instance().usePrefs(); -} - -void LLFloaterEnvironmentSettings::populateWaterPresetsList() -{ - mWaterPresetCombo->removeall(); - - LLEnvironment::list_name_id_t list = LLEnvironment::instance().getWaterList(); - - for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) - { - mWaterPresetCombo->add((*it).first, LLSD::String((*it).first)); // - } -} - -void LLFloaterEnvironmentSettings::populateSkyPresetsList() -{ - mSkyPresetCombo->removeall(); - - LLEnvironment::list_name_id_t list = LLEnvironment::instance().getSkyList(); - - for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) - { - mSkyPresetCombo->add((*it).first, LLSD::String((*it).first)); - } -} - -void LLFloaterEnvironmentSettings::populateDayCyclePresetsList() -{ - mDayCyclePresetCombo->removeall(); - - LLEnvironment::list_name_id_t list = LLEnvironment::instance().getDayCycleList(); - - for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) - { - mDayCyclePresetCombo->add((*it).first, LLSD::String((*it).first)); - } -} -- cgit v1.2.3