diff options
Diffstat (limited to 'linden/indra/newview/llfloaterwater.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterwater.cpp | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp index 98b449b..025562a 100644 --- a/linden/indra/newview/llfloaterwater.cpp +++ b/linden/indra/newview/llfloaterwater.cpp | |||
@@ -65,7 +65,7 @@ LLFloaterWater* LLFloaterWater::sWaterMenu = NULL; | |||
65 | 65 | ||
66 | std::set<std::string> LLFloaterWater::sDefaultPresets; | 66 | std::set<std::string> LLFloaterWater::sDefaultPresets; |
67 | 67 | ||
68 | LLFloaterWater::LLFloaterWater() : LLFloater("water floater") | 68 | LLFloaterWater::LLFloaterWater() : LLFloater(std::string("water floater")) |
69 | { | 69 | { |
70 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); | 70 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); |
71 | 71 | ||
@@ -85,14 +85,14 @@ LLFloaterWater::LLFloaterWater() : LLFloater("water floater") | |||
85 | comboBox->selectByValue(LLSD("Default")); | 85 | comboBox->selectByValue(LLSD("Default")); |
86 | } | 86 | } |
87 | 87 | ||
88 | LLString def_water = getString("WLDefaultWaterNames"); | 88 | std::string def_water = getString("WLDefaultWaterNames"); |
89 | 89 | ||
90 | // no editing or deleting of the blank string | 90 | // no editing or deleting of the blank string |
91 | sDefaultPresets.insert(""); | 91 | sDefaultPresets.insert(""); |
92 | boost_tokenizer tokens(def_water, boost::char_separator<char>(":")); | 92 | boost_tokenizer tokens(def_water, boost::char_separator<char>(":")); |
93 | for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) | 93 | for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) |
94 | { | 94 | { |
95 | LLString tok(*token_iter); | 95 | std::string tok(*token_iter); |
96 | sDefaultPresets.insert(tok); | 96 | sDefaultPresets.insert(tok); |
97 | } | 97 | } |
98 | 98 | ||
@@ -175,8 +175,8 @@ void LLFloaterWater::onClickHelp(void* data) | |||
175 | { | 175 | { |
176 | LLFloaterWater* self = LLFloaterWater::instance(); | 176 | LLFloaterWater* self = LLFloaterWater::instance(); |
177 | 177 | ||
178 | const char* xml_alert = (const char*) data; | 178 | const std::string* xml_alert = (std::string*)data; |
179 | LLAlertDialog* dialogp = gViewerWindow->alertXml(xml_alert); | 179 | LLAlertDialog* dialogp = gViewerWindow->alertXml(*xml_alert); |
180 | if (dialogp) | 180 | if (dialogp) |
181 | { | 181 | { |
182 | LLFloater* root_floater = gFloaterView->getParentFloater(self); | 182 | LLFloater* root_floater = gFloaterView->getParentFloater(self); |
@@ -187,12 +187,12 @@ void LLFloaterWater::onClickHelp(void* data) | |||
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
190 | void LLFloaterWater::initHelpBtn(const char* name, const char* xml_alert) | 190 | void LLFloaterWater::initHelpBtn(const std::string& name, const std::string& xml_alert) |
191 | { | 191 | { |
192 | childSetAction(name, onClickHelp, (void*)xml_alert); | 192 | childSetAction(name, onClickHelp, new std::string(xml_alert)); |
193 | } | 193 | } |
194 | 194 | ||
195 | void LLFloaterWater::newPromptCallback(S32 option, const LLString& text, void* userData) | 195 | void LLFloaterWater::newPromptCallback(S32 option, const std::string& text, void* userData) |
196 | { | 196 | { |
197 | if(text == "") | 197 | if(text == "") |
198 | { | 198 | { |
@@ -207,13 +207,12 @@ void LLFloaterWater::newPromptCallback(S32 option, const LLString& text, void* u | |||
207 | // add the current parameters to the list | 207 | // add the current parameters to the list |
208 | // see if it's there first | 208 | // see if it's there first |
209 | std::map<std::string, LLWaterParamSet>::iterator mIt = | 209 | std::map<std::string, LLWaterParamSet>::iterator mIt = |
210 | param_mgr->mParamList.find(text.c_str()); | 210 | param_mgr->mParamList.find(text); |
211 | 211 | ||
212 | // if not there, add a new one | 212 | // if not there, add a new one |
213 | if(mIt == param_mgr->mParamList.end()) | 213 | if(mIt == param_mgr->mParamList.end()) |
214 | { | 214 | { |
215 | param_mgr->addParamSet(text.c_str(), | 215 | param_mgr->addParamSet(text, param_mgr->mCurParams); |
216 | param_mgr->mCurParams); | ||
217 | comboBox->add(text); | 216 | comboBox->add(text); |
218 | comboBox->sortByName(); | 217 | comboBox->sortByName(); |
219 | 218 | ||
@@ -537,9 +536,9 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, void* userData) | |||
537 | } | 536 | } |
538 | 537 | ||
539 | // set the sliders to the new vals | 538 | // set the sliders to the new vals |
540 | sWaterMenu->childSetValue(rName.c_str(), colorControl->mR); | 539 | sWaterMenu->childSetValue(rName, colorControl->mR); |
541 | sWaterMenu->childSetValue(gName.c_str(), colorControl->mG); | 540 | sWaterMenu->childSetValue(gName, colorControl->mG); |
542 | sWaterMenu->childSetValue(bName.c_str(), colorControl->mB); | 541 | sWaterMenu->childSetValue(bName, colorControl->mB); |
543 | } | 542 | } |
544 | 543 | ||
545 | // now update the current parameters and send them to shaders | 544 | // now update the current parameters and send them to shaders |
@@ -597,7 +596,7 @@ void LLFloaterWater::onNormalMapPicked(LLUICtrl* ctrl, void* userData) | |||
597 | 596 | ||
598 | void LLFloaterWater::onNewPreset(void* userData) | 597 | void LLFloaterWater::onNewPreset(void* userData) |
599 | { | 598 | { |
600 | gViewerWindow->alertXmlEditText("NewWaterPreset", LLString::format_map_t(), | 599 | gViewerWindow->alertXmlEditText("NewWaterPreset", LLStringUtil::format_map_t(), |
601 | NULL, NULL, newPromptCallback, NULL); | 600 | NULL, NULL, newPromptCallback, NULL); |
602 | } | 601 | } |
603 | 602 | ||
@@ -617,7 +616,7 @@ void LLFloaterWater::onSavePreset(void* userData) | |||
617 | 616 | ||
618 | // check to see if it's a default and shouldn't be overwritten | 617 | // check to see if it's a default and shouldn't be overwritten |
619 | std::set<std::string>::iterator sIt = sDefaultPresets.find( | 618 | std::set<std::string>::iterator sIt = sDefaultPresets.find( |
620 | comboBox->getSelectedItemLabel().c_str()); | 619 | comboBox->getSelectedItemLabel()); |
621 | if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets")) | 620 | if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets")) |
622 | { | 621 | { |
623 | gViewerWindow->alertXml("WLNoEditDefault"); | 622 | gViewerWindow->alertXml("WLNoEditDefault"); |
@@ -653,7 +652,7 @@ void LLFloaterWater::onDeletePreset(void* userData) | |||
653 | return; | 652 | return; |
654 | } | 653 | } |
655 | 654 | ||
656 | LLString::format_map_t args; | 655 | LLStringUtil::format_map_t args; |
657 | args["[SKY]"] = combo_box->getSelectedValue().asString(); | 656 | args["[SKY]"] = combo_box->getSelectedValue().asString(); |
658 | gViewerWindow->alertXml("WLDeletePresetAlert", args, deleteAlertCallback, sWaterMenu); | 657 | gViewerWindow->alertXml("WLDeletePresetAlert", args, deleteAlertCallback, sWaterMenu); |
659 | } | 658 | } |
@@ -675,10 +674,10 @@ void LLFloaterWater::deleteAlertCallback(S32 option, void* userdata) | |||
675 | mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WaterDayCycleKeys"); | 674 | mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WaterDayCycleKeys"); |
676 | } | 675 | } |
677 | 676 | ||
678 | LLString name = combo_box->getSelectedValue().asString(); | 677 | std::string name = combo_box->getSelectedValue().asString(); |
679 | 678 | ||
680 | // check to see if it's a default and shouldn't be deleted | 679 | // check to see if it's a default and shouldn't be deleted |
681 | std::set<std::string>::iterator sIt = sDefaultPresets.find(name.c_str()); | 680 | std::set<std::string>::iterator sIt = sDefaultPresets.find(name); |
682 | if(sIt != sDefaultPresets.end()) | 681 | if(sIt != sDefaultPresets.end()) |
683 | { | 682 | { |
684 | gViewerWindow->alertXml("WaterNoEditDefault"); | 683 | gViewerWindow->alertXml("WaterNoEditDefault"); |