diff options
Diffstat (limited to 'linden/indra/newview/llfloaterwater.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterwater.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp index c842a87..98b449b 100644 --- a/linden/indra/newview/llfloaterwater.cpp +++ b/linden/indra/newview/llfloaterwater.cpp | |||
@@ -41,12 +41,13 @@ | |||
41 | #include "llcolorswatch.h" | 41 | #include "llcolorswatch.h" |
42 | #include "llcheckboxctrl.h" | 42 | #include "llcheckboxctrl.h" |
43 | #include "lltexturectrl.h" | 43 | #include "lltexturectrl.h" |
44 | #include "llvieweruictrlfactory.h" | 44 | #include "lluictrlfactory.h" |
45 | #include "llviewercamera.h" | 45 | #include "llviewercamera.h" |
46 | #include "llcombobox.h" | 46 | #include "llcombobox.h" |
47 | #include "lllineeditor.h" | 47 | #include "lllineeditor.h" |
48 | #include "llfloaterdaycycle.h" | 48 | #include "llfloaterdaycycle.h" |
49 | #include "llboost.h" | 49 | #include "llboost.h" |
50 | #include "llmultisliderctrl.h" | ||
50 | 51 | ||
51 | #include "v4math.h" | 52 | #include "v4math.h" |
52 | #include "llviewerdisplay.h" | 53 | #include "llviewerdisplay.h" |
@@ -66,10 +67,10 @@ std::set<std::string> LLFloaterWater::sDefaultPresets; | |||
66 | 67 | ||
67 | LLFloaterWater::LLFloaterWater() : LLFloater("water floater") | 68 | LLFloaterWater::LLFloaterWater() : LLFloater("water floater") |
68 | { | 69 | { |
69 | gUICtrlFactory->buildFloater(this, "floater_water.xml"); | 70 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); |
70 | 71 | ||
71 | // add the combo boxes | 72 | // add the combo boxes |
72 | LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "WaterPresetsCombo"); | 73 | LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); |
73 | 74 | ||
74 | if(comboBox != NULL) { | 75 | if(comboBox != NULL) { |
75 | 76 | ||
@@ -150,7 +151,7 @@ void LLFloaterWater::initCallbacks(void) { | |||
150 | childSetCommitCallback("WaterBlurMult", onFloatControlMoved, ¶m_mgr->mBlurMultiplier); | 151 | childSetCommitCallback("WaterBlurMult", onFloatControlMoved, ¶m_mgr->mBlurMultiplier); |
151 | 152 | ||
152 | // Load/save | 153 | // Load/save |
153 | LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "WaterPresetsCombo"); | 154 | LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); |
154 | 155 | ||
155 | //childSetAction("WaterLoadPreset", onLoadPreset, comboBox); | 156 | //childSetAction("WaterLoadPreset", onLoadPreset, comboBox); |
156 | childSetAction("WaterNewPreset", onNewPreset, comboBox); | 157 | childSetAction("WaterNewPreset", onNewPreset, comboBox); |
@@ -166,7 +167,7 @@ void LLFloaterWater::initCallbacks(void) { | |||
166 | comboBox->setCommitCallback(onChangePresetName); | 167 | comboBox->setCommitCallback(onChangePresetName); |
167 | 168 | ||
168 | LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); | 169 | LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); |
169 | textCtrl->setDefaultImageAssetID(LLUUID(gViewerArt.getString("water_normal.tga"))); | 170 | textCtrl->setDefaultImageAssetID(DEFAULT_WATER_NORMAL); |
170 | childSetCommitCallback("WaterNormalMap", onNormalMapPicked, NULL); | 171 | childSetCommitCallback("WaterNormalMap", onNormalMapPicked, NULL); |
171 | } | 172 | } |
172 | 173 | ||
@@ -199,8 +200,7 @@ void LLFloaterWater::newPromptCallback(S32 option, const LLString& text, void* u | |||
199 | } | 200 | } |
200 | 201 | ||
201 | if(option == 0) { | 202 | if(option == 0) { |
202 | LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sWaterMenu, | 203 | LLComboBox* comboBox = sWaterMenu->getChild<LLComboBox>( "WaterPresetsCombo"); |
203 | "WaterPresetsCombo"); | ||
204 | 204 | ||
205 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); | 205 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); |
206 | 206 | ||
@@ -311,7 +311,7 @@ void LLFloaterWater::show() | |||
311 | water->syncMenu(); | 311 | water->syncMenu(); |
312 | 312 | ||
313 | // comment in if you want the menu to rebuild each time | 313 | // comment in if you want the menu to rebuild each time |
314 | //gUICtrlFactory->buildFloater(water, "floater_water.xml"); | 314 | //LLUICtrlFactory::getInstance()->buildFloater(water, "floater_water.xml"); |
315 | //water->initCallbacks(); | 315 | //water->initCallbacks(); |
316 | 316 | ||
317 | water->open(); | 317 | water->open(); |
@@ -604,8 +604,7 @@ void LLFloaterWater::onNewPreset(void* userData) | |||
604 | void LLFloaterWater::onSavePreset(void* userData) | 604 | void LLFloaterWater::onSavePreset(void* userData) |
605 | { | 605 | { |
606 | // get the name | 606 | // get the name |
607 | LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sWaterMenu, | 607 | LLComboBox* comboBox = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); |
608 | "WaterPresetsCombo"); | ||
609 | 608 | ||
610 | // don't save the empty name | 609 | // don't save the empty name |
611 | if(comboBox->getSelectedItemLabel() == "") | 610 | if(comboBox->getSelectedItemLabel() == "") |
@@ -647,8 +646,7 @@ void LLFloaterWater::saveAlertCallback(S32 option, void* userdata) | |||
647 | 646 | ||
648 | void LLFloaterWater::onDeletePreset(void* userData) | 647 | void LLFloaterWater::onDeletePreset(void* userData) |
649 | { | 648 | { |
650 | LLComboBox* combo_box = LLUICtrlFactory::getComboBoxByName(sWaterMenu, | 649 | LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); |
651 | "WaterPresetsCombo"); | ||
652 | 650 | ||
653 | if(combo_box->getSelectedValue().asString() == "") | 651 | if(combo_box->getSelectedValue().asString() == "") |
654 | { | 652 | { |
@@ -665,8 +663,7 @@ void LLFloaterWater::deleteAlertCallback(S32 option, void* userdata) | |||
665 | // if they choose delete, do it. Otherwise, don't do anything | 663 | // if they choose delete, do it. Otherwise, don't do anything |
666 | if(option == 0) | 664 | if(option == 0) |
667 | { | 665 | { |
668 | LLComboBox* combo_box = LLUICtrlFactory::getComboBoxByName(sWaterMenu, | 666 | LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); |
669 | "WaterPresetsCombo"); | ||
670 | LLFloaterDayCycle* day_cycle = NULL; | 667 | LLFloaterDayCycle* day_cycle = NULL; |
671 | LLComboBox* key_combo = NULL; | 668 | LLComboBox* key_combo = NULL; |
672 | LLMultiSliderCtrl* mult_sldr = NULL; | 669 | LLMultiSliderCtrl* mult_sldr = NULL; |
@@ -674,10 +671,8 @@ void LLFloaterWater::deleteAlertCallback(S32 option, void* userdata) | |||
674 | if(LLFloaterDayCycle::isOpen()) | 671 | if(LLFloaterDayCycle::isOpen()) |
675 | { | 672 | { |
676 | day_cycle = LLFloaterDayCycle::instance(); | 673 | day_cycle = LLFloaterDayCycle::instance(); |
677 | key_combo = LLUICtrlFactory::getComboBoxByName(day_cycle, | 674 | key_combo = day_cycle->getChild<LLComboBox>("WaterKeyPresets"); |
678 | "WaterKeyPresets"); | 675 | mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WaterDayCycleKeys"); |
679 | mult_sldr = LLUICtrlFactory::getMultiSliderByName(day_cycle, | ||
680 | "WaterDayCycleKeys"); | ||
681 | } | 676 | } |
682 | 677 | ||
683 | LLString name = combo_box->getSelectedValue().asString(); | 678 | LLString name = combo_box->getSelectedValue().asString(); |