aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterwindlight.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterwindlight.cpp')
-rw-r--r--linden/indra/newview/llfloaterwindlight.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterwindlight.cpp b/linden/indra/newview/llfloaterwindlight.cpp
index 4b0dd04..9936f3b 100644
--- a/linden/indra/newview/llfloaterwindlight.cpp
+++ b/linden/indra/newview/llfloaterwindlight.cpp
@@ -60,6 +60,7 @@
60 60
61#undef max 61#undef max
62 62
63
63LLFloaterWindLight* LLFloaterWindLight::sWindLight = NULL; 64LLFloaterWindLight* LLFloaterWindLight::sWindLight = NULL;
64 65
65std::set<std::string> LLFloaterWindLight::sDefaultPresets; 66std::set<std::string> LLFloaterWindLight::sDefaultPresets;
@@ -227,6 +228,10 @@ void LLFloaterWindLight::initCallbacks(void) {
227 // Dome 228 // Dome
228 childSetCommitCallback("WLGamma", onFloatControlMoved, &param_mgr->mWLGamma); 229 childSetCommitCallback("WLGamma", onFloatControlMoved, &param_mgr->mWLGamma);
229 childSetCommitCallback("WLStarAlpha", onStarAlphaMoved, NULL); 230 childSetCommitCallback("WLStarAlpha", onStarAlphaMoved, NULL);
231
232 // next/prev buttons
233 childSetAction("next", onClickNext, this);
234 childSetAction("prev", onClickPrev, this);
230} 235}
231 236
232void LLFloaterWindLight::onClickHelp(void* data) 237void LLFloaterWindLight::onClickHelp(void* data)
@@ -1001,3 +1006,51 @@ void LLFloaterWindLight::deactivateAnimator()
1001 LLWLParamManager::instance()->mAnimator.mIsRunning = false; 1006 LLWLParamManager::instance()->mAnimator.mIsRunning = false;
1002 LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; 1007 LLWLParamManager::instance()->mAnimator.mUseLindenTime = false;
1003} 1008}
1009
1010void LLFloaterWindLight::onClickNext(void* user_data)
1011{
1012 LLWLParamManager * param_mgr = LLWLParamManager::instance();
1013 LLWLParamSet& currentParams = param_mgr->mCurParams;
1014
1015 // find place of current param
1016 std::map<std::string, LLWLParamSet>::iterator mIt =
1017 param_mgr->mParamList.find(currentParams.mName);
1018
1019 // if at the end, loop
1020 std::map<std::string, LLWLParamSet>::iterator last = param_mgr->mParamList.end(); --last;
1021 if(mIt == last)
1022 {
1023 mIt = param_mgr->mParamList.begin();
1024 }
1025 else
1026 {
1027 mIt++;
1028 }
1029 param_mgr->mAnimator.mIsRunning = false;
1030 param_mgr->mAnimator.mUseLindenTime = false;
1031 param_mgr->loadPreset(mIt->first, true);
1032}
1033
1034void LLFloaterWindLight::onClickPrev(void* user_data)
1035{
1036 LLWLParamManager * param_mgr = LLWLParamManager::instance();
1037 LLWLParamSet& currentParams = param_mgr->mCurParams;
1038
1039 // find place of current param
1040 std::map<std::string, LLWLParamSet>::iterator mIt =
1041 param_mgr->mParamList.find(currentParams.mName);
1042
1043 // if at the beginning, loop
1044 if(mIt == param_mgr->mParamList.begin())
1045 {
1046 std::map<std::string, LLWLParamSet>::iterator last = param_mgr->mParamList.end(); --last;
1047 mIt = last;
1048 }
1049 else
1050 {
1051 mIt--;
1052 }
1053 param_mgr->mAnimator.mIsRunning = false;
1054 param_mgr->mAnimator.mUseLindenTime = false;
1055 param_mgr->loadPreset(mIt->first, true);
1056}