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 +++++++++++----------------- indra/newview/llfloaterenvsettings.h | 3 +++ 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'indra/newview') 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); +} diff --git a/indra/newview/llfloaterenvsettings.h b/indra/newview/llfloaterenvsettings.h index d6a5fe1e8b..440c73961f 100644 --- a/indra/newview/llfloaterenvsettings.h +++ b/indra/newview/llfloaterenvsettings.h @@ -71,6 +71,9 @@ public: /// sync time with the server static void onUseEstateTime(void* userData1, void* userData2); + /// sync time with local clock + static void onUseLocalTime(); + // opt-in for region Windlight settings //static void onUseRegionEnvironment(LLUICtrl* ctrl, void* userData); static void onUseRegionEnvironment(LLUICtrl*, void*); -- cgit v1.2.3