From 5fc0cd9bf7d0c7f97bb63c5f887cce27e27a05f9 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 25 May 2011 08:55:03 -0400 Subject: storm-1156: remove "test day" controls and associated code --- indra/newview/llfloaterdaycycle.cpp | 134 --------------------- indra/newview/llfloaterdaycycle.h | 18 --- .../default/xui/en/floater_day_cycle_options.xml | 119 ------------------ 3 files changed, 271 deletions(-) diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp index eb429d7803..ebf7b98148 100644 --- a/indra/newview/llfloaterdaycycle.cpp +++ b/indra/newview/llfloaterdaycycle.cpp @@ -114,47 +114,16 @@ void LLFloaterDayCycle::initCallbacks(void) childSetCommitCallback("WLCurKeyMin", onKeyTimeChanged, NULL); childSetCommitCallback("WLKeyPresets", onKeyPresetChanged, NULL); - childSetCommitCallback("WLLengthOfDayHour", onTimeRateChanged, NULL); - childSetCommitCallback("WLLengthOfDayMin", onTimeRateChanged, NULL); - childSetCommitCallback("WLLengthOfDaySec", onTimeRateChanged, NULL); - childSetAction("WLUseLindenTime", onUseLindenTime, NULL); - childSetAction("WLAnimSky", onRunAnimSky, NULL); - childSetAction("WLStopAnimSky", onStopAnimSky, NULL); - - childSetAction("WLLoadDayCycle", onLoadDayCycle, NULL); - childSetAction("WLSaveDayCycle", onSaveDayCycle, NULL); - childSetAction("WLAddKey", onAddKey, NULL); childSetAction("WLDeleteKey", onDeleteKey, NULL); } void LLFloaterDayCycle::syncMenu() { -// std::map & currentParams = LLWLParamManager::getInstance()->mCurParams.mParamValues; - // set time LLMultiSliderCtrl* sldr = LLFloaterDayCycle::sDayCycle->getChild("WLTimeSlider"); sldr->setCurSliderValue((F32)LLWLParamManager::getInstance()->mAnimator.getDayTime() * sHoursPerDay); - LLSpinCtrl* secSpin = sDayCycle->getChild("WLLengthOfDaySec"); - LLSpinCtrl* minSpin = sDayCycle->getChild("WLLengthOfDayMin"); - LLSpinCtrl* hourSpin = sDayCycle->getChild("WLLengthOfDayHour"); - - F32 curRate; - F32 hours, min, sec; - - // get the current rate - curRate = LLWLParamManager::getInstance()->mDay.mDayRate; - hours = (F32)((int)(curRate / 60 / 60)); - curRate -= (hours * 60 * 60); - min = (F32)((int)(curRate / 60)); - curRate -= (min * 60); - sec = curRate; - - hourSpin->setValue(hours); - minSpin->setValue(min); - secSpin->setValue(sec); - // turn off Use Estate Time button if it's already being used if( LLWLParamManager::getInstance()->mAnimator.getUseLindenTime()) { @@ -309,81 +278,6 @@ void LLFloaterDayCycle::onClose(bool app_quitting) } } -void LLFloaterDayCycle::onRunAnimSky(void* userData) -{ - // if no keys, do nothing - if(sSliderToKey.size() == 0) - { - return; - } - - LLMultiSliderCtrl* sldr; - sldr = sDayCycle->getChild("WLDayCycleKeys"); - llassert_always(sSliderToKey.size() == sldr->getValue().size()); - - LLMultiSliderCtrl* tSldr = sDayCycle->getChild("WLTimeSlider"); - - sPreviousTimeType = LLWLParamManager::getInstance()->mAnimator.getTimeType(); - - // turn off linden time - LLWLParamManager::getInstance()->mAnimator.setTimeType(LLWLAnimator::TIME_CUSTOM); - - // set the param manager's track to the new one - LLWLParamManager::getInstance()->resetAnimator(tSldr->getCurSliderValue() / sHoursPerDay, true); - - llassert_always(LLWLParamManager::getInstance()->mAnimator.mTimeTrack.size() == sldr->getValue().size()); -} - -void LLFloaterDayCycle::onStopAnimSky(void* userData) -{ - // if no keys, do nothing - if(sSliderToKey.size() == 0) { - return; - } - - LLWLParamManager::getInstance()->mAnimator.deactivate(); // turn off animation and using linden time - LLMultiSliderCtrl* tSldr = sDayCycle->getChild("WLTimeSlider"); - LLWLParamManager::getInstance()->resetAnimator(tSldr->getCurSliderValue() / sHoursPerDay, false); - LLWLParamManager::getInstance()->mAnimator.setTimeType(sPreviousTimeType); -} - -void LLFloaterDayCycle::onUseLindenTime(void* userData) -{ - LLFloaterWindLight* wlfloater = LLFloaterReg::findTypedInstance("env_windlight"); - if (wlfloater) - { - LLComboBox* box = wlfloater->getChild("WLPresetsCombo"); - box->selectByValue(""); - } - LLWLParamManager::getInstance()->mAnimator.deactivate(); -} - -void LLFloaterDayCycle::onLoadDayCycle(void* userData) -{ - LLWLParamManager::getInstance()->mDay.loadDayCycleFromFile("Default.xml"); - - // sync it all up - syncSliderTrack(); - syncMenu(); - - // set the param manager's track to the new one - LLMultiSliderCtrl* tSldr; - tSldr = sDayCycle->getChild( - "WLTimeSlider"); - LLWLParamManager::getInstance()->resetAnimator( - tSldr->getCurSliderValue() / sHoursPerDay, false); - - // and draw it - LLWLParamManager::getInstance()->mAnimator.update( - LLWLParamManager::getInstance()->mCurParams); -} - -void LLFloaterDayCycle::onSaveDayCycle(void* userData) -{ - LLWLParamManager::getInstance()->mDay.saveDayCycle("Default.xml"); -} - - void LLFloaterDayCycle::onTimeSliderMoved(LLUICtrl* ctrl, void* userData) { LLMultiSliderCtrl* sldr = sDayCycle->getChild( @@ -501,34 +395,6 @@ void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl, void* userData) syncTrack(); } -void LLFloaterDayCycle::onTimeRateChanged(LLUICtrl* ctrl, void* userData) -{ - // get the time - LLSpinCtrl* secSpin = sDayCycle->getChild( - "WLLengthOfDaySec"); - - LLSpinCtrl* minSpin = sDayCycle->getChild( - "WLLengthOfDayMin"); - - LLSpinCtrl* hourSpin = sDayCycle->getChild( - "WLLengthOfDayHour"); - - F32 hour; - hour = (F32)hourSpin->getValue().asReal(); - F32 min; - min = (F32)minSpin->getValue().asReal(); - F32 sec; - sec = (F32)secSpin->getValue().asReal(); - - F32 time = 60.0f * 60.0f * hour + 60.0f * min + sec; - if(time <= 0) { - time = 1; - } - LLWLParamManager::getInstance()->mDay.mDayRate = time; - - syncTrack(); -} - void LLFloaterDayCycle::onAddKey(void* userData) { LLComboBox* comboBox = sDayCycle->getChild( diff --git a/indra/newview/llfloaterdaycycle.h b/indra/newview/llfloaterdaycycle.h index b09d1d5bf4..1454298269 100644 --- a/indra/newview/llfloaterdaycycle.h +++ b/indra/newview/llfloaterdaycycle.h @@ -83,15 +83,6 @@ public: /// if you change the combo box, change the frame static void onKeyPresetChanged(LLUICtrl* ctrl, void* userData); - /// run this when user says to run the sky animation - static void onRunAnimSky(void* userData); - - /// run this when user says to stop the sky animation - static void onStopAnimSky(void* userData); - - /// if you change the combo box, change the frame - static void onTimeRateChanged(LLUICtrl* ctrl, void* userData); - /// add a new key on slider static void onAddKey(void* userData); @@ -101,15 +92,6 @@ public: /// delete a key frame static void onDeleteKey(void* userData); - /// button to load day - static void onLoadDayCycle(void* userData); - - /// button to save day - static void onSaveDayCycle(void* userData); - - /// toggle for Linden time - static void onUseLindenTime(void* userData); - //// menu management diff --git a/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml index b54dc87d24..59cdb295ef 100644 --- a/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml +++ b/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml @@ -411,125 +411,6 @@ left="12" top="101" width="240" /> - - Length of Cycle: - - - - - - Preview : - -