From e045d212d35354d679c2d2e05c6d4689f9f8ac95 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 27 Sep 2010 22:56:08 -0400 Subject: STORM-1126 WIP Windlight Estate Settings port from 1.23: first pass at merging in windlight estate settings to viewer-dev codebase. not built, not tested. Probably needs a bunch of fixes to be able to be integrated. (resubmitted by Vadim ProductEngine) --- indra/newview/llfloaterenvsettings.cpp | 353 ++++++++++++++++++++++----------- 1 file changed, 235 insertions(+), 118 deletions(-) (limited to 'indra/newview/llfloaterenvsettings.cpp') diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index fcaef1f34b..6d1b27db07 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -2,25 +2,31 @@ * @file llfloaterenvsettings.cpp * @brief LLFloaterEnvSettings class definition * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * $LicenseInfo:firstyear=2007&license=viewergpl$ + * + * Copyright (c) 2007-2009, 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. + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * - * 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. + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * - * 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 + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ @@ -28,9 +34,10 @@ #include "llfloaterenvsettings.h" -#include "llfloaterreg.h" #include "llfloaterwindlight.h" #include "llfloaterwater.h" +#include "llfloaterdaycycle.h" +#include "llfloaterregioninfo.h" #include "lluictrlfactory.h" #include "llsliderctrl.h" #include "llcombobox.h" @@ -42,57 +49,89 @@ #include "llwaterparammanager.h" #include "llmath.h" #include "llviewerwindow.h" +#include "llviewercontrol.h" + +#include "llcheckboxctrl.h" #include "pipeline.h" #include -LLFloaterEnvSettings::LLFloaterEnvSettings(const LLSD& key) - : LLFloater(key) +LLFloaterEnvSettings* LLFloaterEnvSettings::sEnvSettings = NULL; + +LLFloaterEnvSettings::LLFloaterEnvSettings() : LLFloater(std::string("Environment Settings Floater")) { + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_env_settings.xml", NULL, FALSE); + + // load it up + initCallbacks(); } -// virtual + LLFloaterEnvSettings::~LLFloaterEnvSettings() { } -// virtual -BOOL LLFloaterEnvSettings::postBuild() -{ - // load it up - initCallbacks(); - syncMenu(); - return TRUE; + +void LLFloaterEnvSettings::onClickHelp(void* data) +{ + LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data; + LLNotifications::instance().add(self->contextualNotification("EnvSettingsHelpButton")); +} + +void LLFloaterEnvSettings::onUseRegionEnvironment(LLUICtrl* ctrl, void* data) +{ + LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data; + LLCheckBoxCtrl* checkbox = (LLCheckBoxCtrl*)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 - getChild("EnvTimeSlider")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeDayTime, this, _1)); - getChild("EnvCloudSlider")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeCloudCoverage, this, _1)); - getChild("EnvWaterFogSlider")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeWaterFogDensity, this, _1, &LLWaterParamManager::instance()->mFogDensity)); + childSetCommitCallback("EnvTimeSlider", onChangeDayTime, NULL); + childSetCommitCallback("EnvCloudSlider", onChangeCloudCoverage, NULL); + childSetCommitCallback("EnvWaterFogSlider", onChangeWaterFogDensity, + &LLWaterParamManager::getInstance()->mFogDensity); // color picker - getChild("EnvWaterColor")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeWaterColor, this, _1, &LLWaterParamManager::instance()->mFogColor)); + childSetCommitCallback("EnvWaterColor", onChangeWaterColor, + &LLWaterParamManager::getInstance()->mFogColor); // WL Top - getChild("EnvAdvancedSkyButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onOpenAdvancedSky, this)); - getChild("EnvAdvancedWaterButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onOpenAdvancedWater, this)); - getChild("EnvUseEstateTimeButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onUseEstateTime, this)); + childSetAction("EnvAdvancedSkyButton", onOpenAdvancedSky, NULL); + childSetAction("EnvAdvancedWaterButton", onOpenAdvancedWater, NULL); + childSetAction("EnvUseEstateTimeButton", onUseEstateTime, NULL); + childSetAction("EnvUseLocalTimeButton", onUseLocalTime, NULL); + childSetAction("EnvSettingsHelpButton", onClickHelp, this); + + childSetCommitCallback("RegionWLOptIn", onUseRegionEnvironment, this); } + // menu maintenance functions void LLFloaterEnvSettings::syncMenu() { LLSliderCtrl* sldr; - sldr = getChild("EnvTimeSlider"); + sldr = sEnvSettings->getChild("EnvTimeSlider"); // sync the clock - F32 val = (F32)LLWLParamManager::instance()->mAnimator.getDayTime(); - std::string timeStr = timeToString(val); + F32 val = (F32)LLWLParamManager::getInstance()->mAnimator.getDayTime(); + std::string timeStr = LLWLAnimator::timeToString(val); LLTextBox* textBox; - textBox = getChild("EnvTimeText"); + textBox = sEnvSettings->getChild("EnvTimeText"); textBox->setValue(timeStr); @@ -106,62 +145,159 @@ void LLFloaterEnvSettings::syncMenu() // sync cloud coverage bool err; - getChild("EnvCloudSlider")->setValue(LLWLParamManager::instance()->mCurParams.getFloat("cloud_shadow", err)); + childSetValue("EnvCloudSlider", LLWLParamManager::getInstance()->mCurParams.getFloat("cloud_shadow", err)); - LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); + LLWaterParamManager * param_mgr = LLWaterParamManager::getInstance(); // sync water params LLColor4 col = param_mgr->getFogColor(); - LLColorSwatchCtrl* colCtrl = getChild("EnvWaterColor"); + LLColorSwatchCtrl* colCtrl = sEnvSettings->getChild("EnvWaterColor"); col.mV[3] = 1.0f; colCtrl->set(col); - getChild("EnvWaterFogSlider")->setValue(param_mgr->mFogDensity.mExp); + childSetValue("EnvWaterFogSlider", param_mgr->mFogDensity.mExp); param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); - // turn off Use Estate Time button if it's already being used - if(LLWLParamManager::instance()->mAnimator.mUseLindenTime) + // turn off Use Estate/Local Time buttons if already being used + + if(LLWLParamManager::getInstance()->mAnimator.getUseLindenTime()) { - getChildView("EnvUseEstateTimeButton")->setEnabled(FALSE); - } else { - getChildView("EnvUseEstateTimeButton")->setEnabled(TRUE); + childDisable("EnvUseEstateTimeButton"); + } + else + { + childEnable("EnvUseEstateTimeButton"); + } + + if(LLWLParamManager::getInstance()->mAnimator.getUseLocalTime()) + { + childDisable("EnvUseLocalTimeButton"); + } + else + { + childEnable("EnvUseLocalTimeButton"); } if(!gPipeline.canUseVertexShaders()) { - getChildView("EnvWaterColor")->setEnabled(FALSE); - getChildView("EnvWaterColorText")->setEnabled(FALSE); - //getChildView("EnvAdvancedWaterButton")->setEnabled(FALSE); + childDisable("EnvWaterColor"); + childDisable("EnvWaterColorText"); + //childDisable("EnvAdvancedWaterButton"); } else { - getChildView("EnvWaterColor")->setEnabled(TRUE); - getChildView("EnvWaterColorText")->setEnabled(TRUE); - //getChildView("EnvAdvancedWaterButton")->setEnabled(TRUE); + childEnable("EnvWaterColor"); + childEnable("EnvWaterColorText"); + //childEnable("EnvAdvancedWaterButton"); } // only allow access to these if they are using windlight if(!gPipeline.canUseWindLightShaders()) { - getChildView("EnvCloudSlider")->setEnabled(FALSE); - getChildView("EnvCloudText")->setEnabled(FALSE); - //getChildView("EnvAdvancedSkyButton")->setEnabled(FALSE); + childDisable("EnvCloudSlider"); + childDisable("EnvCloudText"); + //childDisable("EnvAdvancedSkyButton"); + } + else + { + childEnable("EnvCloudSlider"); + childEnable("EnvCloudText"); + //childEnable("EnvAdvancedSkyButton"); + } +} + + +// static instance of it +LLFloaterEnvSettings* LLFloaterEnvSettings::instance() +{ + if (!sEnvSettings) + { + sEnvSettings = new LLFloaterEnvSettings(); + // sEnvSettings->open(); + // sEnvSettings->setFocus(TRUE); + } + return sEnvSettings; +} + +void LLFloaterEnvSettings::setControlsEnabled(bool enable) +{ + if(enable) + { + // reenable UI elements, resync sliders, and reload saved settings + childEnable("EnvAdvancedSkyButton"); + childEnable("EnvAdvancedWaterButton"); + childEnable("EnvUseEstateTimeButton"); + childShow("EnvTimeText"); + childShow("EnvWaterColor"); + childShow("EnvTimeSlider"); + childShow("EnvCloudSlider"); + childShow("EnvWaterFogSlider"); + syncMenu(); } else { - getChildView("EnvCloudSlider")->setEnabled(TRUE); - getChildView("EnvCloudText")->setEnabled(TRUE); - //getChildView("EnvAdvancedSkyButton")->setEnabled(TRUE); + // disable UI elements the user shouldn't be able to see to protect potentially proprietary WL region settings from being visible + LLFloaterWindLight::instance()->close(); + LLFloaterWater::instance()->close(); + LLFloaterDayCycle::instance()->close(); + childDisable("EnvAdvancedSkyButton"); + childDisable("EnvAdvancedWaterButton"); + childDisable("EnvUseEstateTimeButton"); + childHide("EnvTimeText"); + childHide("EnvWaterColor"); + childHide("EnvTimeSlider"); + childHide("EnvCloudSlider"); + childHide("EnvWaterFogSlider"); } } -void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl) + +void LLFloaterEnvSettings::show() +{ + LLFloaterEnvSettings* envSettings = instance(); + envSettings->syncMenu(); + + // comment in if you want the menu to rebuild each time + //LLUICtrlFactory::getInstance()->buildFloater(envSettings, "floater_env_settings.xml"); + //envSettings->initCallbacks(); + + // Set environment opt-in checkbox based on saved value -- only need to do once, not every time syncMenu is called + + bool opt_in = gSavedSettings.getBOOL("UseEnvironmentFromRegion"); + + sEnvSettings->childSetVisible("RegionWLOptIn", LLEnvManager::getInstance()->regionCapable()); + sEnvSettings->setOptIn(opt_in); + sEnvSettings->getChildView("RegionWLOptIn")->setValue(LLSD::Boolean(opt_in)); + sEnvSettings->getChildView("RegionWLOptIn")->setToolTip(sEnvSettings->getString("region_environment_tooltip")); + envSettings->open(); +} + +bool LLFloaterEnvSettings::isOpen() { - LLSliderCtrl* sldr = static_cast(ctrl); + if (sEnvSettings != NULL) + { + return true; + } + return false; +} + +// virtual +void LLFloaterEnvSettings::onClose(bool app_quitting) +{ + if (sEnvSettings) + { + sEnvSettings->setVisible(FALSE); + } +} + + +void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl, void* userData) +{ + LLSliderCtrl* sldr; + sldr = sEnvSettings->getChild("EnvTimeSlider"); // deactivate animator - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; + LLWLParamManager::getInstance()->mAnimator.deactivate(); F32 val = sldr->getValueF32() + 0.25f; if(val > 1.0) @@ -169,100 +305,81 @@ void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl) val--; } - LLWLParamManager::instance()->mAnimator.setDayTime((F64)val); - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); + LLWLParamManager::getInstance()->mAnimator.setDayTime((F64)val); + LLWLParamManager::getInstance()->mAnimator.update( + LLWLParamManager::getInstance()->mCurParams); } -void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl) +void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl, void* userData) { - LLSliderCtrl* sldr = static_cast(ctrl); + LLSliderCtrl* sldr; + sldr = sEnvSettings->getChild("EnvCloudSlider"); // deactivate animator - //LLWLParamManager::instance()->mAnimator.mIsRunning = false; - //LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; + //LLWLParamManager::getInstance()->mAnimator.mIsRunning = false; + //LLWLParamManager::getInstance()->mAnimator.mUseLindenTime = false; F32 val = sldr->getValueF32(); - LLWLParamManager::instance()->mCurParams.set("cloud_shadow", val); + LLWLParamManager::getInstance()->mCurParams.set("cloud_shadow", val); } -void LLFloaterEnvSettings::onChangeWaterFogDensity(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl) +void LLFloaterEnvSettings::onChangeWaterFogDensity(LLUICtrl* ctrl, void* userData) { LLSliderCtrl* sldr; - sldr = getChild("EnvWaterFogSlider"); + sldr = sEnvSettings->getChild("EnvWaterFogSlider"); + + if(NULL == userData) + { + return; + } + + WaterExpFloatControl * expFloatControl = static_cast(userData); F32 val = sldr->getValueF32(); expFloatControl->mExp = val; - LLWaterParamManager::instance()->setDensitySliderValue(val); + LLWaterParamManager::getInstance()->setDensitySliderValue(val); - expFloatControl->update(LLWaterParamManager::instance()->mCurParams); - LLWaterParamManager::instance()->propagateParameters(); + expFloatControl->update(LLWaterParamManager::getInstance()->mCurParams); + LLWaterParamManager::getInstance()->propagateParameters(); } -void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, WaterColorControl* colorControl) +void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, void* userData) { LLColorSwatchCtrl* swatch = static_cast(ctrl); + WaterColorControl * colorControl = static_cast(userData); *colorControl = swatch->get(); - colorControl->update(LLWaterParamManager::instance()->mCurParams); - LLWaterParamManager::instance()->propagateParameters(); + colorControl->update(LLWaterParamManager::getInstance()->mCurParams); + LLWaterParamManager::getInstance()->propagateParameters(); } -void LLFloaterEnvSettings::onOpenAdvancedSky() +void LLFloaterEnvSettings::onOpenAdvancedSky(void* userData) { - LLFloaterReg::showInstance("env_windlight"); + LLFloaterWindLight::show(); } -void LLFloaterEnvSettings::onOpenAdvancedWater() +void LLFloaterEnvSettings::onOpenAdvancedWater(void* userData) { - LLFloaterReg::showInstance("env_water"); + LLFloaterWater::show(); } -void LLFloaterEnvSettings::onUseEstateTime() +void LLFloaterEnvSettings::onUseEstateTime(void* userData) { - LLFloaterWindLight* wl = LLFloaterReg::findTypedInstance("env_windlight"); - if(wl) + if(LLFloaterWindLight::isOpen()) { + // select the blank value in + LLFloaterWindLight* wl = LLFloaterWindLight::instance(); LLComboBox* box = wl->getChild("WLPresetsCombo"); box->selectByValue(""); } - LLWLParamManager::instance()->mAnimator.mIsRunning = true; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = true; + LLWLParamManager::getInstance()->mAnimator.activate(LLWLAnimator::TIME_LINDEN); } -std::string LLFloaterEnvSettings::timeToString(F32 curTime) +void LLFloaterEnvSettings::onUseLocalTime(void* userData) { - S32 hours; - S32 min; - - // get hours and minutes - hours = (S32) (24.0 * curTime); - curTime -= ((F32) hours / 24.0f); - min = llround(24.0f * 60.0f * curTime); - - // handle case where it's 60 - if(min == 60) - { - hours++; - min = 0; - } - - std::string newTime = getString("timeStr"); - struct tm * timeT; - time_t secT = time(0); - timeT = gmtime (&secT); - - timeT->tm_hour = hours; - timeT->tm_min = min; - secT = mktime (timeT); - secT -= LLStringOps::getLocalTimeOffset (); - - LLSD substitution; - substitution["datetime"] = (S32) secT; - - LLStringUtil::format (newTime, substitution); - return newTime; + LLWLParamManager::getInstance()->mAnimator.setDayTime(LLWLAnimator::getLocalTime()); + LLWLParamManager::getInstance()->mAnimator.activate(LLWLAnimator::TIME_LOCAL); } -- cgit v1.2.3 From 2fb337bc12984f9abecfbc7f3918c372a7b5ac6c Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 30 Sep 2010 23:21:23 -0400 Subject: STORM-1126 WIP Windlight Estate Settings port from 1.23: second pass at getting windlight ported to V2. Lots of cleanup in the floater classes. Not sure every decision was correct but it compiles now. Doesn't link yet. (resubmitted by Vadim ProductEngine) --- indra/newview/llfloaterenvsettings.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloaterenvsettings.cpp') diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index 6d1b27db07..eea333745f 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -43,6 +43,7 @@ #include "llcombobox.h" #include "llcolorswatch.h" #include "llwlanimator.h" +#include "llnotifications.h" #include "llwlparamset.h" #include "llwlparammanager.h" @@ -59,10 +60,8 @@ LLFloaterEnvSettings* LLFloaterEnvSettings::sEnvSettings = NULL; -LLFloaterEnvSettings::LLFloaterEnvSettings() : LLFloater(std::string("Environment Settings Floater")) -{ - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_env_settings.xml", NULL, FALSE); - +LLFloaterEnvSettings::LLFloaterEnvSettings(const LLSD &key) : LLFloater(key) +{ // load it up initCallbacks(); } @@ -73,8 +72,7 @@ LLFloaterEnvSettings::~LLFloaterEnvSettings() void LLFloaterEnvSettings::onClickHelp(void* data) { - LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data; - LLNotifications::instance().add(self->contextualNotification("EnvSettingsHelpButton")); + LLNotifications::instance().add("EnvSettingsHelpButton", LLSD(), LLSD()); } void LLFloaterEnvSettings::onUseRegionEnvironment(LLUICtrl* ctrl, void* data) @@ -212,7 +210,7 @@ LLFloaterEnvSettings* LLFloaterEnvSettings::instance() { if (!sEnvSettings) { - sEnvSettings = new LLFloaterEnvSettings(); + sEnvSettings = new LLFloaterEnvSettings("Environment Editor Floater"); // sEnvSettings->open(); // sEnvSettings->setFocus(TRUE); } @@ -237,9 +235,9 @@ void LLFloaterEnvSettings::setControlsEnabled(bool enable) else { // disable UI elements the user shouldn't be able to see to protect potentially proprietary WL region settings from being visible - LLFloaterWindLight::instance()->close(); - LLFloaterWater::instance()->close(); - LLFloaterDayCycle::instance()->close(); + LLFloaterWindLight::instance()->closeFloater(); + LLFloaterWater::instance()->closeFloater(); + LLFloaterDayCycle::instance()->closeFloater(); childDisable("EnvAdvancedSkyButton"); childDisable("EnvAdvancedWaterButton"); childDisable("EnvUseEstateTimeButton"); @@ -267,9 +265,10 @@ void LLFloaterEnvSettings::show() sEnvSettings->childSetVisible("RegionWLOptIn", LLEnvManager::getInstance()->regionCapable()); sEnvSettings->setOptIn(opt_in); - sEnvSettings->getChildView("RegionWLOptIn")->setValue(LLSD::Boolean(opt_in)); + LLCheckBoxCtrl* checkbox = (LLCheckBoxCtrl*)envSettings->getChildView("RegionWLOptIn"); + checkbox->setValue(LLSD::Boolean(opt_in)); sEnvSettings->getChildView("RegionWLOptIn")->setToolTip(sEnvSettings->getString("region_environment_tooltip")); - envSettings->open(); + envSettings->openFloater(); } bool LLFloaterEnvSettings::isOpen() @@ -361,7 +360,7 @@ void LLFloaterEnvSettings::onOpenAdvancedSky(void* userData) void LLFloaterEnvSettings::onOpenAdvancedWater(void* userData) { - LLFloaterWater::show(); + LLFloaterWater::instance()->openFloater(); } -- cgit v1.2.3 From 758fdbfe125d75bd2253a69337eab7fec7406ecf Mon Sep 17 00:00:00 2001 From: "tiggs@lindenlab.com" Date: Wed, 23 Feb 2011 17:44:18 -0500 Subject: STORM-1126 WIP Windlight Estate Settings port from 1.23: baseline: read only windlight works (resubmitted by Vadim ProductEngine) --- indra/newview/llfloaterenvsettings.cpp | 200 ++++++++------------------------- 1 file changed, 48 insertions(+), 152 deletions(-) (limited to 'indra/newview/llfloaterenvsettings.cpp') diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index eea333745f..e863aef94f 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -34,6 +34,7 @@ #include "llfloaterenvsettings.h" +#include "llfloaterreg.h" #include "llfloaterwindlight.h" #include "llfloaterwater.h" #include "llfloaterdaycycle.h" @@ -58,27 +59,29 @@ #include -LLFloaterEnvSettings* LLFloaterEnvSettings::sEnvSettings = NULL; +// LLFloaterEnvSettings* LLFloaterEnvSettings::sEnvSettings = NULL; LLFloaterEnvSettings::LLFloaterEnvSettings(const LLSD &key) : LLFloater(key) { - // load it up - initCallbacks(); } LLFloaterEnvSettings::~LLFloaterEnvSettings() { } -void LLFloaterEnvSettings::onClickHelp(void* data) -{ - LLNotifications::instance().add("EnvSettingsHelpButton", LLSD(), LLSD()); +// virtual +BOOL LLFloaterEnvSettings::postBuild() +{ + // load it up + initCallbacks(); + syncMenu(); + return TRUE; } void LLFloaterEnvSettings::onUseRegionEnvironment(LLUICtrl* ctrl, void* data) { - LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data; - LLCheckBoxCtrl* checkbox = (LLCheckBoxCtrl*)self->getChildView("RegionWLOptIn"); + //LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data; + LLCheckBoxCtrl* checkbox = static_cast(ctrl); //self->getChildView("RegionWLOptIn"); setOptIn(checkbox->getValue().asBoolean()); } @@ -97,23 +100,19 @@ void LLFloaterEnvSettings::setOptIn(bool opt_in) void LLFloaterEnvSettings::initCallbacks(void) { // our three sliders - childSetCommitCallback("EnvTimeSlider", onChangeDayTime, NULL); - childSetCommitCallback("EnvCloudSlider", onChangeCloudCoverage, NULL); - childSetCommitCallback("EnvWaterFogSlider", onChangeWaterFogDensity, - &LLWaterParamManager::getInstance()->mFogDensity); + childSetCommitCallback("EnvTimeSlider", &LLFloaterEnvSettings::onChangeDayTime, NULL); + childSetCommitCallback("EnvCloudSlider", &LLFloaterEnvSettings::onChangeCloudCoverage, NULL); + childSetCommitCallback("EnvWaterFogSlider", &LLFloaterEnvSettings::onChangeWaterFogDensity, &LLWaterParamManager::instance().mFogDensity); // color picker - childSetCommitCallback("EnvWaterColor", onChangeWaterColor, - &LLWaterParamManager::getInstance()->mFogColor); + childSetCommitCallback("EnvWaterColor", &LLFloaterEnvSettings::onChangeWaterColor, &LLWaterParamManager::instance().mFogColor); // WL Top - childSetAction("EnvAdvancedSkyButton", onOpenAdvancedSky, NULL); - childSetAction("EnvAdvancedWaterButton", onOpenAdvancedWater, NULL); - childSetAction("EnvUseEstateTimeButton", onUseEstateTime, NULL); - childSetAction("EnvUseLocalTimeButton", onUseLocalTime, NULL); - childSetAction("EnvSettingsHelpButton", onClickHelp, this); + childSetCommitCallback("EnvAdvancedSkyButton", &LLFloaterEnvSettings::onOpenAdvancedSky, NULL); + childSetCommitCallback("EnvAdvancedWaterButton", &LLFloaterEnvSettings::onOpenAdvancedWater, NULL); + childSetCommitCallback("EnvUseEstateTimeButton", &LLFloaterEnvSettings::onUseEstateTime, NULL); - childSetCommitCallback("RegionWLOptIn", onUseRegionEnvironment, this); + childSetCommitCallback("RegionWLOptIn", &LLFloaterEnvSettings::onUseRegionEnvironment, NULL); } @@ -122,14 +121,14 @@ void LLFloaterEnvSettings::initCallbacks(void) void LLFloaterEnvSettings::syncMenu() { LLSliderCtrl* sldr; - sldr = sEnvSettings->getChild("EnvTimeSlider"); + sldr = getChild("EnvTimeSlider"); // sync the clock F32 val = (F32)LLWLParamManager::getInstance()->mAnimator.getDayTime(); std::string timeStr = LLWLAnimator::timeToString(val); LLTextBox* textBox; - textBox = sEnvSettings->getChild("EnvTimeText"); + textBox = getChild("EnvTimeText"); textBox->setValue(timeStr); @@ -148,7 +147,7 @@ void LLFloaterEnvSettings::syncMenu() LLWaterParamManager * param_mgr = LLWaterParamManager::getInstance(); // sync water params LLColor4 col = param_mgr->getFogColor(); - LLColorSwatchCtrl* colCtrl = sEnvSettings->getChild("EnvWaterColor"); + LLColorSwatchCtrl* colCtrl = getChild("EnvWaterColor"); col.mV[3] = 1.0f; colCtrl->set(col); @@ -204,99 +203,12 @@ void LLFloaterEnvSettings::syncMenu() } } - -// static instance of it -LLFloaterEnvSettings* LLFloaterEnvSettings::instance() -{ - if (!sEnvSettings) - { - sEnvSettings = new LLFloaterEnvSettings("Environment Editor Floater"); - // sEnvSettings->open(); - // sEnvSettings->setFocus(TRUE); - } - return sEnvSettings; -} - -void LLFloaterEnvSettings::setControlsEnabled(bool enable) -{ - if(enable) - { - // reenable UI elements, resync sliders, and reload saved settings - childEnable("EnvAdvancedSkyButton"); - childEnable("EnvAdvancedWaterButton"); - childEnable("EnvUseEstateTimeButton"); - childShow("EnvTimeText"); - childShow("EnvWaterColor"); - childShow("EnvTimeSlider"); - childShow("EnvCloudSlider"); - childShow("EnvWaterFogSlider"); - syncMenu(); - } - else - { - // disable UI elements the user shouldn't be able to see to protect potentially proprietary WL region settings from being visible - LLFloaterWindLight::instance()->closeFloater(); - LLFloaterWater::instance()->closeFloater(); - LLFloaterDayCycle::instance()->closeFloater(); - childDisable("EnvAdvancedSkyButton"); - childDisable("EnvAdvancedWaterButton"); - childDisable("EnvUseEstateTimeButton"); - childHide("EnvTimeText"); - childHide("EnvWaterColor"); - childHide("EnvTimeSlider"); - childHide("EnvCloudSlider"); - childHide("EnvWaterFogSlider"); - } -} - - -void LLFloaterEnvSettings::show() -{ - LLFloaterEnvSettings* envSettings = instance(); - envSettings->syncMenu(); - - // comment in if you want the menu to rebuild each time - //LLUICtrlFactory::getInstance()->buildFloater(envSettings, "floater_env_settings.xml"); - //envSettings->initCallbacks(); - - // Set environment opt-in checkbox based on saved value -- only need to do once, not every time syncMenu is called - - bool opt_in = gSavedSettings.getBOOL("UseEnvironmentFromRegion"); - - sEnvSettings->childSetVisible("RegionWLOptIn", LLEnvManager::getInstance()->regionCapable()); - sEnvSettings->setOptIn(opt_in); - LLCheckBoxCtrl* checkbox = (LLCheckBoxCtrl*)envSettings->getChildView("RegionWLOptIn"); - checkbox->setValue(LLSD::Boolean(opt_in)); - sEnvSettings->getChildView("RegionWLOptIn")->setToolTip(sEnvSettings->getString("region_environment_tooltip")); - envSettings->openFloater(); -} - -bool LLFloaterEnvSettings::isOpen() -{ - if (sEnvSettings != NULL) - { - return true; - } - return false; -} - -// virtual -void LLFloaterEnvSettings::onClose(bool app_quitting) -{ - if (sEnvSettings) - { - sEnvSettings->setVisible(FALSE); - } -} - - void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl, void* userData) { - LLSliderCtrl* sldr; - sldr = sEnvSettings->getChild("EnvTimeSlider"); + LLSliderCtrl* sldr = static_cast(ctrl); // deactivate animator - LLWLParamManager::getInstance()->mAnimator.deactivate(); + LLWLParamManager::instance().mAnimator.deactivate(); F32 val = sldr->getValueF32() + 0.25f; if(val > 1.0) @@ -304,81 +216,65 @@ void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl, void* userData) val--; } - LLWLParamManager::getInstance()->mAnimator.setDayTime((F64)val); - LLWLParamManager::getInstance()->mAnimator.update( - LLWLParamManager::getInstance()->mCurParams); + LLWLParamManager::instance().mAnimator.setDayTime((F64)val); + LLWLParamManager::instance().mAnimator.update( + LLWLParamManager::instance().mCurParams); } void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl, void* userData) { - LLSliderCtrl* sldr; - sldr = sEnvSettings->getChild("EnvCloudSlider"); + LLSliderCtrl* sldr = static_cast(ctrl); // deactivate animator - //LLWLParamManager::getInstance()->mAnimator.mIsRunning = false; - //LLWLParamManager::getInstance()->mAnimator.mUseLindenTime = false; + //LLWLParamManager::instance()->mAnimator.mIsRunning = false; + //LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; F32 val = sldr->getValueF32(); - LLWLParamManager::getInstance()->mCurParams.set("cloud_shadow", val); + LLWLParamManager::instance().mCurParams.set("cloud_shadow", val); } void LLFloaterEnvSettings::onChangeWaterFogDensity(LLUICtrl* ctrl, void* userData) { - LLSliderCtrl* sldr; - sldr = sEnvSettings->getChild("EnvWaterFogSlider"); - - if(NULL == userData) - { - return; - } - - WaterExpFloatControl * expFloatControl = static_cast(userData); - + LLSliderCtrl* sldr = static_cast(ctrl); F32 val = sldr->getValueF32(); + + WaterExpFloatControl* expFloatControl = static_cast(userData); expFloatControl->mExp = val; - LLWaterParamManager::getInstance()->setDensitySliderValue(val); + LLWaterParamManager::instance().setDensitySliderValue(val); - expFloatControl->update(LLWaterParamManager::getInstance()->mCurParams); - LLWaterParamManager::getInstance()->propagateParameters(); + expFloatControl->update(LLWaterParamManager::instance().mCurParams); + LLWaterParamManager::instance().propagateParameters(); } void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, void* userData) { LLColorSwatchCtrl* swatch = static_cast(ctrl); - WaterColorControl * colorControl = static_cast(userData); + WaterColorControl* colorControl = static_cast(userData); *colorControl = swatch->get(); - colorControl->update(LLWaterParamManager::getInstance()->mCurParams); - LLWaterParamManager::getInstance()->propagateParameters(); + colorControl->update(LLWaterParamManager::instance().mCurParams); + LLWaterParamManager::instance().propagateParameters(); } - -void LLFloaterEnvSettings::onOpenAdvancedSky(void* userData) +void LLFloaterEnvSettings::onOpenAdvancedSky(void* userData1, void* userData2) { - LLFloaterWindLight::show(); + LLFloaterReg::showInstance("env_windlight"); } -void LLFloaterEnvSettings::onOpenAdvancedWater(void* userData) +void LLFloaterEnvSettings::onOpenAdvancedWater(void* userData1, void* userData2) { - LLFloaterWater::instance()->openFloater(); + LLFloaterReg::showInstance("env_water"); } -void LLFloaterEnvSettings::onUseEstateTime(void* userData) +void LLFloaterEnvSettings::onUseEstateTime(void* userData1, void* userData2) { - if(LLFloaterWindLight::isOpen()) + LLFloaterWindLight* wl = LLFloaterReg::findTypedInstance("env_windlight"); + if(wl) { - // select the blank value in - LLFloaterWindLight* wl = LLFloaterWindLight::instance(); LLComboBox* box = wl->getChild("WLPresetsCombo"); box->selectByValue(""); } - LLWLParamManager::getInstance()->mAnimator.activate(LLWLAnimator::TIME_LINDEN); -} - -void LLFloaterEnvSettings::onUseLocalTime(void* userData) -{ - LLWLParamManager::getInstance()->mAnimator.setDayTime(LLWLAnimator::getLocalTime()); - LLWLParamManager::getInstance()->mAnimator.activate(LLWLAnimator::TIME_LOCAL); + LLWLParamManager::instance().mAnimator.activate(LLWLAnimator::TIME_LINDEN); } -- cgit v1.2.3 From 79fb8e2ec26dc2c5a42ef1ee48ebaaa39183c67b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 31 Mar 2011 18:24:01 +0300 Subject: STORM-1126 WIP Windlight Estate Settings integration: pass 4 Changes: * Fixed incorrect way to pass parameters to notifications. * Fixed crashes in the Advanced Sky floater and the Region Terrain panel. * Fixed initialization and multiple instantiation of the Day Cycle floater (that might lead to incorrect behavior). * Fixed and re-enabled committing env. settings changes to region. * Fixed day cycle and sky settings being sent as empty arrays and therefore not passing validation on server. It is now possible to change region environment settings. * Added debug messages. --- indra/newview/llfloaterenvsettings.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llfloaterenvsettings.cpp') diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index e863aef94f..733b808ec9 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -63,6 +63,7 @@ LLFloaterEnvSettings::LLFloaterEnvSettings(const LLSD &key) : LLFloater(key) { + lldebugs << "Creating env settings floater" << llendl; } LLFloaterEnvSettings::~LLFloaterEnvSettings() @@ -75,6 +76,10 @@ BOOL LLFloaterEnvSettings::postBuild() // load it up initCallbacks(); syncMenu(); + + LLEnvKey::EScope cur_scope = LLEnvManager::getInstance()->getNormallyDisplayedScope(); + childSetValue("RegionWLOptIn", cur_scope == LLEnvKey::SCOPE_REGION); + return TRUE; } @@ -258,11 +263,13 @@ void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, void* userData) void LLFloaterEnvSettings::onOpenAdvancedSky(void* userData1, void* userData2) { + // *TODO: make sure title is displayed correctly. LLFloaterReg::showInstance("env_windlight"); } void LLFloaterEnvSettings::onOpenAdvancedWater(void* userData1, void* userData2) { + // *TODO: make sure title is displayed correctly. LLFloaterReg::showInstance("env_water"); } -- cgit v1.2.3 From 48309dcb3f5609ae72ca81a161a6efae3b2e91a1 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 31 Mar 2011 18:24:01 +0300 Subject: STORM-1126 WIP Windlight Estate Settings integration: pass 8 Eliminated more merge artifacts (superflous copyright changes). --- indra/newview/llfloaterenvsettings.cpp | 36 ++++++++++++++-------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/llfloaterenvsettings.cpp') diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index 733b808ec9..b97f5e715f 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -2,31 +2,25 @@ * @file llfloaterenvsettings.cpp * @brief LLFloaterEnvSettings class definition * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, 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. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * 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. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * 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 * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 89d747221c15ce8eee19252291a0273871e8c986 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 7 Apr 2011 06:21:14 +0300 Subject: STORM-1142 FIXED The "Use Estate Time" and "Use Local Time" buttons in the Environment Editor now work. --- indra/newview/llfloaterenvsettings.cpp | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'indra/newview/llfloaterenvsettings.cpp') diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index b97f5e715f..d569159d6b 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -110,6 +110,7 @@ void LLFloaterEnvSettings::initCallbacks(void) childSetCommitCallback("EnvAdvancedSkyButton", &LLFloaterEnvSettings::onOpenAdvancedSky, NULL); childSetCommitCallback("EnvAdvancedWaterButton", &LLFloaterEnvSettings::onOpenAdvancedWater, NULL); childSetCommitCallback("EnvUseEstateTimeButton", &LLFloaterEnvSettings::onUseEstateTime, NULL); + getChild("EnvUseLocalTimeButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onUseLocalTime)); childSetCommitCallback("RegionWLOptIn", &LLFloaterEnvSettings::onUseRegionEnvironment, NULL); } @@ -155,23 +156,9 @@ void LLFloaterEnvSettings::syncMenu() // turn off Use Estate/Local Time buttons if already being used - if(LLWLParamManager::getInstance()->mAnimator.getUseLindenTime()) - { - childDisable("EnvUseEstateTimeButton"); - } - else - { - childEnable("EnvUseEstateTimeButton"); - } - - if(LLWLParamManager::getInstance()->mAnimator.getUseLocalTime()) - { - childDisable("EnvUseLocalTimeButton"); - } - else - { - childEnable("EnvUseLocalTimeButton"); - } + LLWLAnimator& anim = LLWLParamManager::getInstance()->mAnimator; + childSetEnabled("EnvUseEstateTimeButton", !anim.getIsRunning() || !anim.getUseLindenTime()); + childSetEnabled("EnvUseLocalTimeButton", !anim.getIsRunning() || !anim.getUseLocalTime()); if(!gPipeline.canUseVertexShaders()) { @@ -279,3 +266,10 @@ void LLFloaterEnvSettings::onUseEstateTime(void* userData1, void* userData2) LLWLParamManager::instance().mAnimator.activate(LLWLAnimator::TIME_LINDEN); } + +// static +void LLFloaterEnvSettings::onUseLocalTime() +{ + LLWLParamManager::getInstance()->mAnimator.setDayTime(LLWLAnimator::getLocalTime()); + LLWLParamManager::getInstance()->mAnimator.activate(LLWLAnimator::TIME_LOCAL); +} -- cgit v1.2.3 From 4b5eeb34601ac642194e245ef3928a3b9e56d3b8 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 7 Apr 2011 06:26:42 +0300 Subject: STORM-1142 ADDITIONAL_COMMIT Debugging improvements. --- indra/newview/llfloaterenvsettings.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterenvsettings.cpp') diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index d569159d6b..2fa022049d 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -113,6 +113,7 @@ void LLFloaterEnvSettings::initCallbacks(void) getChild("EnvUseLocalTimeButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onUseLocalTime)); childSetCommitCallback("RegionWLOptIn", &LLFloaterEnvSettings::onUseRegionEnvironment, NULL); + getChild("RegionWLOptIn")->setRightMouseDownCallback(boost::bind(&LLEnvManager::dumpScopes, &LLEnvManager::instance())); } -- cgit v1.2.3 From db6862e15b1ff6257593eab798250316a350cf73 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 19 Apr 2011 23:24:28 +0300 Subject: STORM-1174 FIX Moved "Use Region Environment Settings" to the "World -> Edit My Environment" menu. It has been a checkbox in the environment editor. --- indra/newview/llfloaterenvsettings.cpp | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'indra/newview/llfloaterenvsettings.cpp') 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(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("EnvUseLocalTimeButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onUseLocalTime)); - childSetCommitCallback("RegionWLOptIn", &LLFloaterEnvSettings::onUseRegionEnvironment, NULL); - getChild("RegionWLOptIn")->setRightMouseDownCallback(boost::bind(&LLEnvManager::dumpScopes, &LLEnvManager::instance())); + getChild("EnvUseEstateTimeButton")->setRightMouseDownCallback(boost::bind(&LLEnvManager::dumpScopes, &LLEnvManager::instance())); } -- cgit v1.2.3