summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterenvsettings.cpp28
-rw-r--r--indra/newview/llfloaterenvsettings.h3
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*);