diff options
Diffstat (limited to 'linden/indra/newview/llfloaterwater.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterwater.cpp | 105 |
1 files changed, 52 insertions, 53 deletions
diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp index 782c56e..9dd3aab 100644 --- a/linden/indra/newview/llfloaterwater.cpp +++ b/linden/indra/newview/llfloaterwater.cpp | |||
@@ -1,11 +1,11 @@ | |||
1 | /** | 1 | /** |
2 | * @file llfloaterwater.cpp | 2 | * @file llfloaterwater.cpp |
3 | * @brief LLFloaterWater class definition | 3 | * @brief LLFloaterWater class definition |
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2007-2009, Linden Research, Inc. | 7 | * Copyright (c) 2007-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
11 | * to you under the terms of the GNU General Public License, version 2.0 | 11 | * to you under the terms of the GNU General Public License, version 2.0 |
@@ -13,17 +13,17 @@ | |||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | 21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception |
22 | * | 22 | * |
23 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
24 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
25 | * and agree to abide by those obligations. | 25 | * and agree to abide by those obligations. |
26 | * | 26 | * |
27 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 27 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
29 | * COMPLETENESS OR PERFORMANCE. | 29 | * COMPLETENESS OR PERFORMANCE. |
@@ -62,6 +62,7 @@ | |||
62 | 62 | ||
63 | #include "llwaterparamset.h" | 63 | #include "llwaterparamset.h" |
64 | #include "llwaterparammanager.h" | 64 | #include "llwaterparammanager.h" |
65 | #include "llwlparammanager.h" | ||
65 | #include "llpostprocess.h" | 66 | #include "llpostprocess.h" |
66 | 67 | ||
67 | #include "wlfloaterwindlightsend.h" | 68 | #include "wlfloaterwindlightsend.h" |
@@ -75,15 +76,15 @@ std::set<std::string> LLFloaterWater::sDefaultPresets; | |||
75 | LLFloaterWater::LLFloaterWater() : LLFloater(std::string("water floater")) | 76 | LLFloaterWater::LLFloaterWater() : LLFloater(std::string("water floater")) |
76 | { | 77 | { |
77 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); | 78 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); |
78 | 79 | ||
79 | // add the combo boxes | 80 | // add the combo boxes |
80 | LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); | 81 | LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); |
81 | 82 | ||
82 | if(comboBox != NULL) { | 83 | if(comboBox != NULL) { |
83 | 84 | ||
84 | std::map<std::string, LLWaterParamSet>::iterator mIt = | 85 | std::map<std::string, LLWaterParamSet>::iterator mIt = |
85 | LLWaterParamManager::instance()->mParamList.begin(); | 86 | LLWaterParamManager::instance()->mParamList.begin(); |
86 | for(; mIt != LLWaterParamManager::instance()->mParamList.end(); mIt++) | 87 | for(; mIt != LLWaterParamManager::instance()->mParamList.end(); mIt++) |
87 | { | 88 | { |
88 | comboBox->add(mIt->first); | 89 | comboBox->add(mIt->first); |
89 | } | 90 | } |
@@ -117,7 +118,7 @@ void LLFloaterWater::initCallbacks(void) { | |||
117 | initHelpBtn("WaterFogColorHelp", "HelpWaterFogColor"); | 118 | initHelpBtn("WaterFogColorHelp", "HelpWaterFogColor"); |
118 | initHelpBtn("WaterFogDensityHelp", "HelpWaterFogDensity"); | 119 | initHelpBtn("WaterFogDensityHelp", "HelpWaterFogDensity"); |
119 | initHelpBtn("WaterUnderWaterFogModHelp", "HelpUnderWaterFogMod"); | 120 | initHelpBtn("WaterUnderWaterFogModHelp", "HelpUnderWaterFogMod"); |
120 | initHelpBtn("WaterGlowHelp", "HelpWaterGlow"); | 121 | initHelpBtn("WaterGlowHelp", "HelpWaterGlow"); |
121 | initHelpBtn("WaterNormalScaleHelp", "HelpWaterNormalScale"); | 122 | initHelpBtn("WaterNormalScaleHelp", "HelpWaterNormalScale"); |
122 | initHelpBtn("WaterFresnelScaleHelp", "HelpWaterFresnelScale"); | 123 | initHelpBtn("WaterFresnelScaleHelp", "HelpWaterFresnelScale"); |
123 | initHelpBtn("WaterFresnelOffsetHelp", "HelpWaterFresnelOffset"); | 124 | initHelpBtn("WaterFresnelOffsetHelp", "HelpWaterFresnelOffset"); |
@@ -134,7 +135,7 @@ void LLFloaterWater::initCallbacks(void) { | |||
134 | 135 | ||
135 | childSetCommitCallback("WaterFogColor", onWaterFogColorMoved, ¶m_mgr->mFogColor); | 136 | childSetCommitCallback("WaterFogColor", onWaterFogColorMoved, ¶m_mgr->mFogColor); |
136 | 137 | ||
137 | // | 138 | // |
138 | childSetCommitCallback("WaterGlow", onColorControlAMoved, ¶m_mgr->mFogColor); | 139 | childSetCommitCallback("WaterGlow", onColorControlAMoved, ¶m_mgr->mFogColor); |
139 | 140 | ||
140 | // fog density | 141 | // fog density |
@@ -212,11 +213,11 @@ bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& res | |||
212 | 213 | ||
213 | // add the current parameters to the list | 214 | // add the current parameters to the list |
214 | // see if it's there first | 215 | // see if it's there first |
215 | std::map<std::string, LLWaterParamSet>::iterator mIt = | 216 | std::map<std::string, LLWaterParamSet>::iterator mIt = |
216 | param_mgr->mParamList.find(text); | 217 | param_mgr->mParamList.find(text); |
217 | 218 | ||
218 | // if not there, add a new one | 219 | // if not there, add a new one |
219 | if(mIt == param_mgr->mParamList.end()) | 220 | if(mIt == param_mgr->mParamList.end()) |
220 | { | 221 | { |
221 | param_mgr->addParamSet(text, param_mgr->mCurParams); | 222 | param_mgr->addParamSet(text, param_mgr->mCurParams); |
222 | comboBox->add(text); | 223 | comboBox->add(text); |
@@ -227,8 +228,8 @@ bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& res | |||
227 | param_mgr->savePreset(text); | 228 | param_mgr->savePreset(text); |
228 | 229 | ||
229 | // otherwise, send a message to the user | 230 | // otherwise, send a message to the user |
230 | } | 231 | } |
231 | else | 232 | else |
232 | { | 233 | { |
233 | LLNotifications::instance().add("ExistsWaterPresetAlert"); | 234 | LLNotifications::instance().add("ExistsWaterPresetAlert"); |
234 | } | 235 | } |
@@ -261,13 +262,13 @@ void LLFloaterWater::syncMenu() | |||
261 | colCtrl->set(col); | 262 | colCtrl->set(col); |
262 | 263 | ||
263 | // fog and wavelets | 264 | // fog and wavelets |
264 | param_mgr->mFogDensity.mExp = | 265 | param_mgr->mFogDensity.mExp = |
265 | log(current_params.getFloat(param_mgr->mFogDensity.mName, err)) / | 266 | log(current_params.getFloat(param_mgr->mFogDensity.mName, err)) / |
266 | log(param_mgr->mFogDensity.mBase); | 267 | log(param_mgr->mFogDensity.mBase); |
267 | param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); | 268 | param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); |
268 | childSetValue("WaterFogDensity", param_mgr->mFogDensity.mExp); | 269 | childSetValue("WaterFogDensity", param_mgr->mFogDensity.mExp); |
269 | 270 | ||
270 | param_mgr->mUnderWaterFogMod.mX = | 271 | param_mgr->mUnderWaterFogMod.mX = |
271 | current_params.getFloat(param_mgr->mUnderWaterFogMod.mName, err); | 272 | current_params.getFloat(param_mgr->mUnderWaterFogMod.mName, err); |
272 | childSetValue("WaterUnderWaterFogMod", param_mgr->mUnderWaterFogMod.mX); | 273 | childSetValue("WaterUnderWaterFogMod", param_mgr->mUnderWaterFogMod.mX); |
273 | 274 | ||
@@ -433,14 +434,14 @@ void LLFloaterWater::onColorControlRMoved(LLUICtrl* ctrl, void* userData) | |||
433 | colorControl->mR = sldrCtrl->getValueF32(); | 434 | colorControl->mR = sldrCtrl->getValueF32(); |
434 | 435 | ||
435 | // move i if it's the max | 436 | // move i if it's the max |
436 | if(colorControl->mR >= colorControl->mG | 437 | if(colorControl->mR >= colorControl->mG |
437 | && colorControl->mR >= colorControl->mB | 438 | && colorControl->mR >= colorControl->mB |
438 | && colorControl->mHasSliderName) | 439 | && colorControl->mHasSliderName) |
439 | { | 440 | { |
440 | colorControl->mI = colorControl->mR; | 441 | colorControl->mI = colorControl->mR; |
441 | std::string name = colorControl->mSliderName; | 442 | std::string name = colorControl->mSliderName; |
442 | name.append("I"); | 443 | name.append("I"); |
443 | 444 | ||
444 | sWaterMenu->childSetValue(name, colorControl->mR); | 445 | sWaterMenu->childSetValue(name, colorControl->mR); |
445 | } | 446 | } |
446 | 447 | ||
@@ -457,7 +458,7 @@ void LLFloaterWater::onColorControlGMoved(LLUICtrl* ctrl, void* userData) | |||
457 | colorControl->mG = sldrCtrl->getValueF32(); | 458 | colorControl->mG = sldrCtrl->getValueF32(); |
458 | 459 | ||
459 | // move i if it's the max | 460 | // move i if it's the max |
460 | if(colorControl->mG >= colorControl->mR | 461 | if(colorControl->mG >= colorControl->mR |
461 | && colorControl->mG >= colorControl->mB | 462 | && colorControl->mG >= colorControl->mB |
462 | && colorControl->mHasSliderName) | 463 | && colorControl->mHasSliderName) |
463 | { | 464 | { |
@@ -517,9 +518,9 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, void* userData) | |||
517 | WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); | 518 | WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); |
518 | 519 | ||
519 | colorControl->mI = sldrCtrl->getValueF32(); | 520 | colorControl->mI = sldrCtrl->getValueF32(); |
520 | 521 | ||
521 | // only for sliders where we pass a name | 522 | // only for sliders where we pass a name |
522 | if(colorControl->mHasSliderName) | 523 | if(colorControl->mHasSliderName) |
523 | { | 524 | { |
524 | // set it to the top | 525 | // set it to the top |
525 | F32 maxVal = std::max(std::max(colorControl->mR, colorControl->mG), colorControl->mB); | 526 | F32 maxVal = std::max(std::max(colorControl->mR, colorControl->mG), colorControl->mB); |
@@ -541,7 +542,7 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, void* userData) | |||
541 | colorControl->mR = 0; | 542 | colorControl->mR = 0; |
542 | colorControl->mG = 0; | 543 | colorControl->mG = 0; |
543 | colorControl->mB = 0; | 544 | colorControl->mB = 0; |
544 | 545 | ||
545 | // if all at the start | 546 | // if all at the start |
546 | // set them all to the intensity | 547 | // set them all to the intensity |
547 | } | 548 | } |
@@ -597,7 +598,7 @@ void LLFloaterWater::onFloatControlMoved(LLUICtrl* ctrl, void* userData) | |||
597 | void LLFloaterWater::onWaterFogColorMoved(LLUICtrl* ctrl, void* userData) | 598 | void LLFloaterWater::onWaterFogColorMoved(LLUICtrl* ctrl, void* userData) |
598 | { | 599 | { |
599 | LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl); | 600 | LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl); |
600 | WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); | 601 | WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData); |
601 | *colorControl = swatch->get(); | 602 | *colorControl = swatch->get(); |
602 | 603 | ||
603 | colorControl->update(LLWaterParamManager::instance()->mCurParams); | 604 | colorControl->update(LLWaterParamManager::instance()->mCurParams); |
@@ -652,7 +653,7 @@ void LLFloaterWater::onSavePreset(LLUICtrl* ctrl, void* userData) | |||
652 | } | 653 | } |
653 | 654 | ||
654 | if (ctrl->getValue().asString() == "save_inventory_item") | 655 | if (ctrl->getValue().asString() == "save_inventory_item") |
655 | { | 656 | { |
656 | // Check if this is already a notecard. | 657 | // Check if this is already a notecard. |
657 | if(LLWaterParamManager::instance()->mCurParams.mInventoryID.notNull()) | 658 | if(LLWaterParamManager::instance()->mCurParams.mInventoryID.notNull()) |
658 | { | 659 | { |
@@ -662,13 +663,13 @@ void LLFloaterWater::onSavePreset(LLUICtrl* ctrl, void* userData) | |||
662 | { | 663 | { |
663 | // Make sure we have a ".ww" extension. | 664 | // Make sure we have a ".ww" extension. |
664 | std::string name = comboBox->getSelectedItemLabel(); | 665 | std::string name = comboBox->getSelectedItemLabel(); |
665 | if(name.length() > 2 && name.compare(name.length() - 3, 3, ".ww") != 0) | 666 | if(!LLWLParamManager::isWaterSettingsNotecard(name)) |
666 | { | 667 | { |
667 | name += ".ww"; | 668 | name += ".ww"; |
668 | } | 669 | } |
669 | LLPointer<KVFloaterWaterNotecardCreatedCallback> cb = new KVFloaterWaterNotecardCreatedCallback(); | 670 | LLPointer<KVFloaterWaterNotecardCreatedCallback> cb = new KVFloaterWaterNotecardCreatedCallback(); |
670 | // Create a notecard and then save it. | 671 | // Create a notecard and then save it. |
671 | create_inventory_item(gAgent.getID(), | 672 | create_inventory_item(gAgent.getID(), |
672 | gAgent.getSessionID(), | 673 | gAgent.getSessionID(), |
673 | LLUUID::null, | 674 | LLUUID::null, |
674 | LLTransactionID::tnull, | 675 | LLTransactionID::tnull, |
@@ -679,7 +680,7 @@ void LLFloaterWater::onSavePreset(LLUICtrl* ctrl, void* userData) | |||
679 | NOT_WEARABLE, | 680 | NOT_WEARABLE, |
680 | PERM_ITEM_UNRESTRICTED, | 681 | PERM_ITEM_UNRESTRICTED, |
681 | cb); | 682 | cb); |
682 | 683 | ||
683 | } | 684 | } |
684 | } | 685 | } |
685 | else if (ctrl->getValue().asString() == "send_to_server_item") | 686 | else if (ctrl->getValue().asString() == "send_to_server_item") |
@@ -690,13 +691,13 @@ void LLFloaterWater::onSavePreset(LLUICtrl* ctrl, void* userData) | |||
690 | } | 691 | } |
691 | else | 692 | else |
692 | { | 693 | { |
693 | LLWaterParamManager::instance()->mCurParams.mName = | 694 | LLWaterParamManager::instance()->mCurParams.mName = |
694 | comboBox->getSelectedItemLabel(); | 695 | comboBox->getSelectedItemLabel(); |
695 | 696 | ||
696 | // check to see if it's a default and shouldn't be overwritten | 697 | // check to see if it's a default and shouldn't be overwritten |
697 | std::set<std::string>::iterator sIt = sDefaultPresets.find( | 698 | std::set<std::string>::iterator sIt = sDefaultPresets.find( |
698 | comboBox->getSelectedItemLabel()); | 699 | comboBox->getSelectedItemLabel()); |
699 | if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets")) | 700 | if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets")) |
700 | { | 701 | { |
701 | LLNotifications::instance().add("WLNoEditDefault"); | 702 | LLNotifications::instance().add("WLNoEditDefault"); |
702 | return; | 703 | return; |
@@ -710,7 +711,7 @@ bool LLFloaterWater::saveNotecardCallback(const LLSD& notification, const LLSD& | |||
710 | { | 711 | { |
711 | S32 option = LLNotification::getSelectedOption(notification, response); | 712 | S32 option = LLNotification::getSelectedOption(notification, response); |
712 | // if they choose save, do it. Otherwise, don't do anything | 713 | // if they choose save, do it. Otherwise, don't do anything |
713 | if(option == 0) | 714 | if(option == 0) |
714 | { | 715 | { |
715 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); | 716 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); |
716 | param_mgr->setParamSet(param_mgr->mCurParams.mName, param_mgr->mCurParams); | 717 | param_mgr->setParamSet(param_mgr->mCurParams.mName, param_mgr->mCurParams); |
@@ -723,12 +724,12 @@ bool LLFloaterWater::saveAlertCallback(const LLSD& notification, const LLSD& res | |||
723 | { | 724 | { |
724 | S32 option = LLNotification::getSelectedOption(notification, response); | 725 | S32 option = LLNotification::getSelectedOption(notification, response); |
725 | // if they choose save, do it. Otherwise, don't do anything | 726 | // if they choose save, do it. Otherwise, don't do anything |
726 | if(option == 0) | 727 | if(option == 0) |
727 | { | 728 | { |
728 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); | 729 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); |
729 | 730 | ||
730 | param_mgr->setParamSet( | 731 | param_mgr->setParamSet( |
731 | param_mgr->mCurParams.mName, | 732 | param_mgr->mCurParams.mName, |
732 | param_mgr->mCurParams); | 733 | param_mgr->mCurParams); |
733 | 734 | ||
734 | // comment this back in to save to file | 735 | // comment this back in to save to file |
@@ -755,38 +756,36 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r | |||
755 | { | 756 | { |
756 | S32 option = LLNotification::getSelectedOption(notification, response); | 757 | S32 option = LLNotification::getSelectedOption(notification, response); |
757 | // if they choose delete, do it. Otherwise, don't do anything | 758 | // if they choose delete, do it. Otherwise, don't do anything |
758 | if(option == 0) | 759 | if(option == 0) |
759 | { | 760 | { |
760 | LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); | 761 | LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); |
761 | LLFloaterDayCycle* day_cycle = NULL; | 762 | LLFloaterDayCycle* day_cycle = NULL; |
762 | LLComboBox* key_combo = NULL; | 763 | LLComboBox* key_combo = NULL; |
763 | LLMultiSliderCtrl* mult_sldr = NULL; | ||
764 | 764 | ||
765 | if(LLFloaterDayCycle::isOpen()) | 765 | if(LLFloaterDayCycle::isOpen()) |
766 | { | 766 | { |
767 | day_cycle = LLFloaterDayCycle::instance(); | 767 | day_cycle = LLFloaterDayCycle::instance(); |
768 | key_combo = day_cycle->getChild<LLComboBox>("WaterKeyPresets"); | 768 | key_combo = day_cycle->getChild<LLComboBox>("WaterKeyPresets"); |
769 | mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WaterDayCycleKeys"); | ||
770 | } | 769 | } |
771 | 770 | ||
772 | std::string name = combo_box->getSelectedValue().asString(); | 771 | std::string name = combo_box->getSelectedValue().asString(); |
773 | 772 | ||
774 | // check to see if it's a default and shouldn't be deleted | 773 | // check to see if it's a default and shouldn't be deleted |
775 | std::set<std::string>::iterator sIt = sDefaultPresets.find(name); | 774 | std::set<std::string>::iterator sIt = sDefaultPresets.find(name); |
776 | if(sIt != sDefaultPresets.end()) | 775 | if(sIt != sDefaultPresets.end()) |
777 | { | 776 | { |
778 | LLNotifications::instance().add("WaterNoEditDefault"); | 777 | LLNotifications::instance().add("WaterNoEditDefault"); |
779 | return false; | 778 | return false; |
780 | } | 779 | } |
781 | 780 | ||
782 | LLWaterParamManager::instance()->removeParamSet(name, true); | 781 | LLWaterParamManager::instance()->removeParamSet(name, true); |
783 | 782 | ||
784 | // remove and choose another | 783 | // remove and choose another |
785 | S32 new_index = combo_box->getCurrentIndex(); | 784 | S32 new_index = combo_box->getCurrentIndex(); |
786 | 785 | ||
787 | combo_box->remove(name); | 786 | combo_box->remove(name); |
788 | 787 | ||
789 | if(key_combo != NULL) | 788 | if(key_combo != NULL) |
790 | { | 789 | { |
791 | key_combo->remove(name); | 790 | key_combo->remove(name); |
792 | 791 | ||
@@ -795,12 +794,12 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r | |||
795 | } | 794 | } |
796 | 795 | ||
797 | // pick the previously selected index after delete | 796 | // pick the previously selected index after delete |
798 | if(new_index > 0) | 797 | if(new_index > 0) |
799 | { | 798 | { |
800 | new_index--; | 799 | new_index--; |
801 | } | 800 | } |
802 | 801 | ||
803 | if(combo_box->getItemCount() > 0) | 802 | if(combo_box->getItemCount() > 0) |
804 | { | 803 | { |
805 | combo_box->setCurrentByIndex(new_index); | 804 | combo_box->setCurrentByIndex(new_index); |
806 | } | 805 | } |
@@ -812,12 +811,12 @@ bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& r | |||
812 | void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl, void * userData) | 811 | void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl, void * userData) |
813 | { | 812 | { |
814 | LLComboBox * combo_box = static_cast<LLComboBox*>(ctrl); | 813 | LLComboBox * combo_box = static_cast<LLComboBox*>(ctrl); |
815 | 814 | ||
816 | if(combo_box->getSimple() == "") | 815 | if(combo_box->getSimple() == "") |
817 | { | 816 | { |
818 | return; | 817 | return; |
819 | } | 818 | } |
820 | 819 | ||
821 | LLWaterParamManager::instance()->loadPreset( | 820 | LLWaterParamManager::instance()->loadPreset( |
822 | combo_box->getSelectedValue().asString()); | 821 | combo_box->getSelectedValue().asString()); |
823 | sWaterMenu->syncMenu(); | 822 | sWaterMenu->syncMenu(); |
@@ -829,12 +828,12 @@ void LLFloaterWater::onClickNext(void* user_data) | |||
829 | LLWaterParamSet& currentParams = param_mgr->mCurParams; | 828 | LLWaterParamSet& currentParams = param_mgr->mCurParams; |
830 | 829 | ||
831 | // find place of current param | 830 | // find place of current param |
832 | std::map<std::string, LLWaterParamSet>::iterator mIt = | 831 | std::map<std::string, LLWaterParamSet>::iterator mIt = |
833 | param_mgr->mParamList.find(currentParams.mName); | 832 | param_mgr->mParamList.find(currentParams.mName); |
834 | 833 | ||
835 | // if at the end, loop | 834 | // if at the end, loop |
836 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; | 835 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; |
837 | if(mIt == last) | 836 | if(mIt == last) |
838 | { | 837 | { |
839 | mIt = param_mgr->mParamList.begin(); | 838 | mIt = param_mgr->mParamList.begin(); |
840 | } | 839 | } |
@@ -853,11 +852,11 @@ void LLFloaterWater::onClickPrev(void* user_data) | |||
853 | LLWaterParamSet & currentParams = param_mgr->mCurParams; | 852 | LLWaterParamSet & currentParams = param_mgr->mCurParams; |
854 | 853 | ||
855 | // find place of current param | 854 | // find place of current param |
856 | std::map<std::string, LLWaterParamSet>::iterator mIt = | 855 | std::map<std::string, LLWaterParamSet>::iterator mIt = |
857 | param_mgr->mParamList.find(currentParams.mName); | 856 | param_mgr->mParamList.find(currentParams.mName); |
858 | 857 | ||
859 | // if at the beginning, loop | 858 | // if at the beginning, loop |
860 | if(mIt == param_mgr->mParamList.begin()) | 859 | if(mIt == param_mgr->mParamList.begin()) |
861 | { | 860 | { |
862 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; | 861 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; |
863 | mIt = last; | 862 | mIt = last; |