diff options
Diffstat (limited to 'linden/indra/newview/llfloaterwater.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterwater.cpp | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp index c42b12b..d2ea74e 100644 --- a/linden/indra/newview/llfloaterwater.cpp +++ b/linden/indra/newview/llfloaterwater.cpp | |||
@@ -168,7 +168,11 @@ void LLFloaterWater::initCallbacks(void) { | |||
168 | 168 | ||
169 | LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); | 169 | LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); |
170 | textCtrl->setDefaultImageAssetID(DEFAULT_WATER_NORMAL); | 170 | textCtrl->setDefaultImageAssetID(DEFAULT_WATER_NORMAL); |
171 | childSetCommitCallback("WaterNormalMap", onNormalMapPicked, NULL); | 171 | childSetCommitCallback("WaterNormalMap", onNormalMapPicked, NULL); |
172 | |||
173 | // next/prev buttons | ||
174 | childSetAction("next", onClickNext, this); | ||
175 | childSetAction("prev", onClickPrev, this); | ||
172 | } | 176 | } |
173 | 177 | ||
174 | void LLFloaterWater::onClickHelp(void* data) | 178 | void LLFloaterWater::onClickHelp(void* data) |
@@ -237,6 +241,12 @@ void LLFloaterWater::syncMenu() | |||
237 | 241 | ||
238 | LLWaterParamSet & current_params = param_mgr->mCurParams; | 242 | LLWaterParamSet & current_params = param_mgr->mCurParams; |
239 | 243 | ||
244 | LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); | ||
245 | if (comboBox->getSelectedItemLabel() != current_params.mName) | ||
246 | { | ||
247 | comboBox->setSimple(current_params.mName); | ||
248 | } | ||
249 | |||
240 | // blue horizon | 250 | // blue horizon |
241 | param_mgr->mFogColor = current_params.getVector4(param_mgr->mFogColor.mName, err); | 251 | param_mgr->mFogColor = current_params.getVector4(param_mgr->mFogColor.mName, err); |
242 | 252 | ||
@@ -727,3 +737,50 @@ void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl, void * userData) | |||
727 | sWaterMenu->syncMenu(); | 737 | sWaterMenu->syncMenu(); |
728 | } | 738 | } |
729 | 739 | ||
740 | void LLFloaterWater::onClickNext(void* user_data) | ||
741 | { | ||
742 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); | ||
743 | LLWaterParamSet& currentParams = param_mgr->mCurParams; | ||
744 | |||
745 | // find place of current param | ||
746 | std::map<std::string, LLWaterParamSet>::iterator mIt = | ||
747 | param_mgr->mParamList.find(currentParams.mName); | ||
748 | |||
749 | // if at the end, loop | ||
750 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; | ||
751 | if(mIt == last) | ||
752 | { | ||
753 | mIt = param_mgr->mParamList.begin(); | ||
754 | } | ||
755 | else | ||
756 | { | ||
757 | mIt++; | ||
758 | } | ||
759 | /*param_mgr->mAnimator.mIsRunning = false; | ||
760 | param_mgr->mAnimator.mUseLindenTime = false;*/ | ||
761 | param_mgr->loadPreset(mIt->first, true); | ||
762 | } | ||
763 | |||
764 | void LLFloaterWater::onClickPrev(void* user_data) | ||
765 | { | ||
766 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); | ||
767 | LLWaterParamSet & currentParams = param_mgr->mCurParams; | ||
768 | |||
769 | // find place of current param | ||
770 | std::map<std::string, LLWaterParamSet>::iterator mIt = | ||
771 | param_mgr->mParamList.find(currentParams.mName); | ||
772 | |||
773 | // if at the beginning, loop | ||
774 | if(mIt == param_mgr->mParamList.begin()) | ||
775 | { | ||
776 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; | ||
777 | mIt = last; | ||
778 | } | ||
779 | else | ||
780 | { | ||
781 | mIt--; | ||
782 | } | ||
783 | /*param_mgr->mAnimator.mIsRunning = false; | ||
784 | param_mgr->mAnimator.mUseLindenTime = false;*/ | ||
785 | param_mgr->loadPreset(mIt->first, true); | ||
786 | } | ||