diff options
Diffstat (limited to 'linden/indra/newview/llfloaterwindlight.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterwindlight.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterwindlight.cpp b/linden/indra/newview/llfloaterwindlight.cpp index 37cd4ef..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 | |||
63 | LLFloaterWindLight* LLFloaterWindLight::sWindLight = NULL; | 64 | LLFloaterWindLight* LLFloaterWindLight::sWindLight = NULL; |
64 | 65 | ||
65 | std::set<std::string> LLFloaterWindLight::sDefaultPresets; | 66 | std::set<std::string> LLFloaterWindLight::sDefaultPresets; |
@@ -227,6 +228,10 @@ void LLFloaterWindLight::initCallbacks(void) { | |||
227 | // Dome | 228 | // Dome |
228 | childSetCommitCallback("WLGamma", onFloatControlMoved, ¶m_mgr->mWLGamma); | 229 | childSetCommitCallback("WLGamma", onFloatControlMoved, ¶m_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 | ||
232 | void LLFloaterWindLight::onClickHelp(void* data) | 237 | void LLFloaterWindLight::onClickHelp(void* data) |
@@ -317,6 +322,15 @@ void LLFloaterWindLight::syncMenu() | |||
317 | LLWLParamSet& currentParams = param_mgr->mCurParams; | 322 | LLWLParamSet& currentParams = param_mgr->mCurParams; |
318 | //std::map<std::string, LLVector4> & currentParams = param_mgr->mCurParams.mParamValues; | 323 | //std::map<std::string, LLVector4> & currentParams = param_mgr->mCurParams.mParamValues; |
319 | 324 | ||
325 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | ||
326 | // Fixes LL "bug" (preset name isn't kept synchronized) | ||
327 | LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); | ||
328 | if (comboBox->getSelectedItemLabel() != currentParams.mName) | ||
329 | { | ||
330 | comboBox->setSimple(currentParams.mName); | ||
331 | } | ||
332 | // [/RLVa:KB] | ||
333 | |||
320 | // blue horizon | 334 | // blue horizon |
321 | param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err); | 335 | param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err); |
322 | childSetValue("WLBlueHorizonR", param_mgr->mBlueHorizon.r / 2.0); | 336 | childSetValue("WLBlueHorizonR", param_mgr->mBlueHorizon.r / 2.0); |
@@ -992,3 +1006,51 @@ void LLFloaterWindLight::deactivateAnimator() | |||
992 | LLWLParamManager::instance()->mAnimator.mIsRunning = false; | 1006 | LLWLParamManager::instance()->mAnimator.mIsRunning = false; |
993 | LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; | 1007 | LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; |
994 | } | 1008 | } |
1009 | |||
1010 | void 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 | |||
1034 | void 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 | } | ||