diff options
author | Jacek Antonelli | 2009-10-13 20:20:37 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-10-13 20:20:37 -0500 |
commit | 20235c92e6e0deddf3c8582bbed75361e24ecc0d (patch) | |
tree | 754db362c0ad8060ceaa3ed24059e320f4b13f5c /linden/indra/newview/llfloaterwater.cpp | |
parent | Merge remote branch 'mccabe/next' into next (diff) | |
parent | Added history button for group chat as well (diff) | |
download | meta-impy-20235c92e6e0deddf3c8582bbed75361e24ecc0d.zip meta-impy-20235c92e6e0deddf3c8582bbed75361e24ecc0d.tar.gz meta-impy-20235c92e6e0deddf3c8582bbed75361e24ecc0d.tar.bz2 meta-impy-20235c92e6e0deddf3c8582bbed75361e24ecc0d.tar.xz |
Merge remote branch 'mccabe/next' into next
Diffstat (limited to 'linden/indra/newview/llfloaterwater.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterwater.cpp | 85 |
1 files changed, 77 insertions, 8 deletions
diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp index c42b12b..7e2f188 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 | ||
@@ -306,14 +316,26 @@ LLFloaterWater* LLFloaterWater::instance() | |||
306 | } | 316 | } |
307 | void LLFloaterWater::show() | 317 | void LLFloaterWater::show() |
308 | { | 318 | { |
309 | LLFloaterWater* water = instance(); | 319 | if (!sWaterMenu) |
310 | water->syncMenu(); | 320 | { |
311 | 321 | LLFloaterWater* water = instance(); | |
312 | // comment in if you want the menu to rebuild each time | 322 | water->syncMenu(); |
313 | //LLUICtrlFactory::getInstance()->buildFloater(water, "floater_water.xml"); | ||
314 | //water->initCallbacks(); | ||
315 | 323 | ||
316 | water->open(); | 324 | // comment in if you want the menu to rebuild each time |
325 | //LLUICtrlFactory::getInstance()->buildFloater(water, "floater_water.xml"); | ||
326 | //water->initCallbacks(); | ||
327 | } | ||
328 | else | ||
329 | { | ||
330 | if (sWaterMenu->getVisible()) | ||
331 | { | ||
332 | sWaterMenu->close(); | ||
333 | } | ||
334 | else | ||
335 | { | ||
336 | sWaterMenu->open(); | ||
337 | } | ||
338 | } | ||
317 | } | 339 | } |
318 | 340 | ||
319 | bool LLFloaterWater::isOpen() | 341 | bool LLFloaterWater::isOpen() |
@@ -727,3 +749,50 @@ void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl, void * userData) | |||
727 | sWaterMenu->syncMenu(); | 749 | sWaterMenu->syncMenu(); |
728 | } | 750 | } |
729 | 751 | ||
752 | void LLFloaterWater::onClickNext(void* user_data) | ||
753 | { | ||
754 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); | ||
755 | LLWaterParamSet& currentParams = param_mgr->mCurParams; | ||
756 | |||
757 | // find place of current param | ||
758 | std::map<std::string, LLWaterParamSet>::iterator mIt = | ||
759 | param_mgr->mParamList.find(currentParams.mName); | ||
760 | |||
761 | // if at the end, loop | ||
762 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; | ||
763 | if(mIt == last) | ||
764 | { | ||
765 | mIt = param_mgr->mParamList.begin(); | ||
766 | } | ||
767 | else | ||
768 | { | ||
769 | mIt++; | ||
770 | } | ||
771 | /*param_mgr->mAnimator.mIsRunning = false; | ||
772 | param_mgr->mAnimator.mUseLindenTime = false;*/ | ||
773 | param_mgr->loadPreset(mIt->first, true); | ||
774 | } | ||
775 | |||
776 | void LLFloaterWater::onClickPrev(void* user_data) | ||
777 | { | ||
778 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); | ||
779 | LLWaterParamSet & currentParams = param_mgr->mCurParams; | ||
780 | |||
781 | // find place of current param | ||
782 | std::map<std::string, LLWaterParamSet>::iterator mIt = | ||
783 | param_mgr->mParamList.find(currentParams.mName); | ||
784 | |||
785 | // if at the beginning, loop | ||
786 | if(mIt == param_mgr->mParamList.begin()) | ||
787 | { | ||
788 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; | ||
789 | mIt = last; | ||
790 | } | ||
791 | else | ||
792 | { | ||
793 | mIt--; | ||
794 | } | ||
795 | /*param_mgr->mAnimator.mIsRunning = false; | ||
796 | param_mgr->mAnimator.mUseLindenTime = false;*/ | ||
797 | param_mgr->loadPreset(mIt->first, true); | ||
798 | } | ||