aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterwater.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfloaterwater.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterwater.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp
index 98b449b..371f17a 100644
--- a/linden/indra/newview/llfloaterwater.cpp
+++ b/linden/indra/newview/llfloaterwater.cpp
@@ -65,7 +65,7 @@ LLFloaterWater* LLFloaterWater::sWaterMenu = NULL;
65 65
66std::set<std::string> LLFloaterWater::sDefaultPresets; 66std::set<std::string> LLFloaterWater::sDefaultPresets;
67 67
68LLFloaterWater::LLFloaterWater() : LLFloater("water floater") 68LLFloaterWater::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);
@@ -185,14 +185,15 @@ void LLFloaterWater::onClickHelp(void* data)
185 root_floater->addDependentFloater(dialogp); 185 root_floater->addDependentFloater(dialogp);
186 } 186 }
187 } 187 }
188 delete xml_alert;
188} 189}
189 190
190void LLFloaterWater::initHelpBtn(const char* name, const char* xml_alert) 191void LLFloaterWater::initHelpBtn(const std::string& name, const std::string& xml_alert)
191{ 192{
192 childSetAction(name, onClickHelp, (void*)xml_alert); 193 childSetAction(name, onClickHelp, new std::string(xml_alert));
193} 194}
194 195
195void LLFloaterWater::newPromptCallback(S32 option, const LLString& text, void* userData) 196void LLFloaterWater::newPromptCallback(S32 option, const std::string& text, void* userData)
196{ 197{
197 if(text == "") 198 if(text == "")
198 { 199 {
@@ -207,13 +208,12 @@ void LLFloaterWater::newPromptCallback(S32 option, const LLString& text, void* u
207 // add the current parameters to the list 208 // add the current parameters to the list
208 // see if it's there first 209 // see if it's there first
209 std::map<std::string, LLWaterParamSet>::iterator mIt = 210 std::map<std::string, LLWaterParamSet>::iterator mIt =
210 param_mgr->mParamList.find(text.c_str()); 211 param_mgr->mParamList.find(text);
211 212
212 // if not there, add a new one 213 // if not there, add a new one
213 if(mIt == param_mgr->mParamList.end()) 214 if(mIt == param_mgr->mParamList.end())
214 { 215 {
215 param_mgr->addParamSet(text.c_str(), 216 param_mgr->addParamSet(text, param_mgr->mCurParams);
216 param_mgr->mCurParams);
217 comboBox->add(text); 217 comboBox->add(text);
218 comboBox->sortByName(); 218 comboBox->sortByName();
219 219
@@ -537,9 +537,9 @@ void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, void* userData)
537 } 537 }
538 538
539 // set the sliders to the new vals 539 // set the sliders to the new vals
540 sWaterMenu->childSetValue(rName.c_str(), colorControl->mR); 540 sWaterMenu->childSetValue(rName, colorControl->mR);
541 sWaterMenu->childSetValue(gName.c_str(), colorControl->mG); 541 sWaterMenu->childSetValue(gName, colorControl->mG);
542 sWaterMenu->childSetValue(bName.c_str(), colorControl->mB); 542 sWaterMenu->childSetValue(bName, colorControl->mB);
543 } 543 }
544 544
545 // now update the current parameters and send them to shaders 545 // now update the current parameters and send them to shaders
@@ -597,7 +597,7 @@ void LLFloaterWater::onNormalMapPicked(LLUICtrl* ctrl, void* userData)
597 597
598void LLFloaterWater::onNewPreset(void* userData) 598void LLFloaterWater::onNewPreset(void* userData)
599{ 599{
600 gViewerWindow->alertXmlEditText("NewWaterPreset", LLString::format_map_t(), 600 gViewerWindow->alertXmlEditText("NewWaterPreset", LLStringUtil::format_map_t(),
601 NULL, NULL, newPromptCallback, NULL); 601 NULL, NULL, newPromptCallback, NULL);
602} 602}
603 603
@@ -617,7 +617,7 @@ void LLFloaterWater::onSavePreset(void* userData)
617 617
618 // check to see if it's a default and shouldn't be overwritten 618 // check to see if it's a default and shouldn't be overwritten
619 std::set<std::string>::iterator sIt = sDefaultPresets.find( 619 std::set<std::string>::iterator sIt = sDefaultPresets.find(
620 comboBox->getSelectedItemLabel().c_str()); 620 comboBox->getSelectedItemLabel());
621 if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets")) 621 if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets"))
622 { 622 {
623 gViewerWindow->alertXml("WLNoEditDefault"); 623 gViewerWindow->alertXml("WLNoEditDefault");
@@ -653,7 +653,7 @@ void LLFloaterWater::onDeletePreset(void* userData)
653 return; 653 return;
654 } 654 }
655 655
656 LLString::format_map_t args; 656 LLStringUtil::format_map_t args;
657 args["[SKY]"] = combo_box->getSelectedValue().asString(); 657 args["[SKY]"] = combo_box->getSelectedValue().asString();
658 gViewerWindow->alertXml("WLDeletePresetAlert", args, deleteAlertCallback, sWaterMenu); 658 gViewerWindow->alertXml("WLDeletePresetAlert", args, deleteAlertCallback, sWaterMenu);
659} 659}
@@ -675,10 +675,10 @@ void LLFloaterWater::deleteAlertCallback(S32 option, void* userdata)
675 mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WaterDayCycleKeys"); 675 mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WaterDayCycleKeys");
676 } 676 }
677 677
678 LLString name = combo_box->getSelectedValue().asString(); 678 std::string name = combo_box->getSelectedValue().asString();
679 679
680 // check to see if it's a default and shouldn't be deleted 680 // 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()); 681 std::set<std::string>::iterator sIt = sDefaultPresets.find(name);
682 if(sIt != sDefaultPresets.end()) 682 if(sIt != sDefaultPresets.end())
683 { 683 {
684 gViewerWindow->alertXml("WaterNoEditDefault"); 684 gViewerWindow->alertXml("WaterNoEditDefault");