diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-04-07 06:21:14 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-04-07 06:21:14 +0300 |
commit | 89d747221c15ce8eee19252291a0273871e8c986 (patch) | |
tree | a29c4138987475b90f1981e417f40697e7d31b65 | |
parent | a2c4bb80492132f7981a79e61bd8ddec95ad97dd (diff) |
STORM-1142 FIXED The "Use Estate Time" and "Use Local Time" buttons in the Environment Editor now work.
-rw-r--r-- | indra/newview/llfloaterenvsettings.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llfloaterenvsettings.h | 3 |
2 files changed, 14 insertions, 17 deletions
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<LLUICtrl>("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*); |