diff options
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/llfloaterwater.cpp | 59 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterwater.h | 3 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_water.xml | 16 |
3 files changed, 72 insertions, 6 deletions
diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp index c42b12b..d2ea74e 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 | ||
@@ -727,3 +737,50 @@ void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl, void * userData) | |||
727 | sWaterMenu->syncMenu(); | 737 | sWaterMenu->syncMenu(); |
728 | } | 738 | } |
729 | 739 | ||
740 | void LLFloaterWater::onClickNext(void* user_data) | ||
741 | { | ||
742 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); | ||
743 | LLWaterParamSet& currentParams = param_mgr->mCurParams; | ||
744 | |||
745 | // find place of current param | ||
746 | std::map<std::string, LLWaterParamSet>::iterator mIt = | ||
747 | param_mgr->mParamList.find(currentParams.mName); | ||
748 | |||
749 | // if at the end, loop | ||
750 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; | ||
751 | if(mIt == last) | ||
752 | { | ||
753 | mIt = param_mgr->mParamList.begin(); | ||
754 | } | ||
755 | else | ||
756 | { | ||
757 | mIt++; | ||
758 | } | ||
759 | /*param_mgr->mAnimator.mIsRunning = false; | ||
760 | param_mgr->mAnimator.mUseLindenTime = false;*/ | ||
761 | param_mgr->loadPreset(mIt->first, true); | ||
762 | } | ||
763 | |||
764 | void LLFloaterWater::onClickPrev(void* user_data) | ||
765 | { | ||
766 | LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); | ||
767 | LLWaterParamSet & currentParams = param_mgr->mCurParams; | ||
768 | |||
769 | // find place of current param | ||
770 | std::map<std::string, LLWaterParamSet>::iterator mIt = | ||
771 | param_mgr->mParamList.find(currentParams.mName); | ||
772 | |||
773 | // if at the beginning, loop | ||
774 | if(mIt == param_mgr->mParamList.begin()) | ||
775 | { | ||
776 | std::map<std::string, LLWaterParamSet>::iterator last = param_mgr->mParamList.end(); --last; | ||
777 | mIt = last; | ||
778 | } | ||
779 | else | ||
780 | { | ||
781 | mIt--; | ||
782 | } | ||
783 | /*param_mgr->mAnimator.mIsRunning = false; | ||
784 | param_mgr->mAnimator.mUseLindenTime = false;*/ | ||
785 | param_mgr->loadPreset(mIt->first, true); | ||
786 | } | ||
diff --git a/linden/indra/newview/llfloaterwater.h b/linden/indra/newview/llfloaterwater.h index 5c1fced..40704f2 100644 --- a/linden/indra/newview/llfloaterwater.h +++ b/linden/indra/newview/llfloaterwater.h | |||
@@ -127,6 +127,9 @@ private: | |||
127 | static LLFloaterWater* sWaterMenu; | 127 | static LLFloaterWater* sWaterMenu; |
128 | 128 | ||
129 | static std::set<std::string> sDefaultPresets; | 129 | static std::set<std::string> sDefaultPresets; |
130 | |||
131 | static void onClickNext(void* user_data); | ||
132 | static void onClickPrev(void* user_data); | ||
130 | }; | 133 | }; |
131 | 134 | ||
132 | 135 | ||
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_water.xml b/linden/indra/newview/skins/default/xui/en-us/floater_water.xml index 9dcb96e..7038c93 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_water.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_water.xml | |||
@@ -11,17 +11,23 @@ | |||
11 | width="110"> | 11 | width="110"> |
12 | Water Presets: | 12 | Water Presets: |
13 | </text> | 13 | </text> |
14 | <combo_box allow_text_entry="false" bottom="-50" follows="left|top" height="18" | 14 | <combo_box allow_text_entry="false" bottom="-52" follows="left|top" height="18" |
15 | left_delta="110" max_chars="20" mouse_opaque="true" | 15 | left_delta="120" max_chars="20" mouse_opaque="true" |
16 | name="WaterPresetsCombo" width="150" /> | 16 | name="WaterPresetsCombo" width="150" /> |
17 | <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20" | ||
18 | label="" label_selected="" left_delta="-25" image_overlay="arrow_left.tga" | ||
19 | mouse_opaque="true" name="prev" scale_image="true" width="20" /> | ||
20 | <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20" | ||
21 | label="" label_selected="" left_delta="180" image_overlay="arrow_right.tga" | ||
22 | mouse_opaque="true" name="next" scale_image="true" width="20" /> | ||
17 | <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20" | 23 | <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20" |
18 | label="New" label_selected="New" left_delta="170" | 24 | label="New" label_selected="New" left_delta="40" |
19 | mouse_opaque="true" name="WaterNewPreset" scale_image="true" width="70" /> | 25 | mouse_opaque="true" name="WaterNewPreset" scale_image="true" width="70" /> |
20 | <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20" | 26 | <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20" |
21 | label="Save" label_selected="Save" left_delta="80" | 27 | label="Save" label_selected="Save" left_delta="70" |
22 | mouse_opaque="true" name="WaterSavePreset" scale_image="true" width="70" /> | 28 | mouse_opaque="true" name="WaterSavePreset" scale_image="true" width="70" /> |
23 | <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20" | 29 | <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20" |
24 | label="Delete" label_selected="Delete" left_delta="80" | 30 | label="Delete" label_selected="Delete" left_delta="70" |
25 | mouse_opaque="true" name="WaterDeletePreset" scale_image="true" width="70" /> | 31 | mouse_opaque="true" name="WaterDeletePreset" scale_image="true" width="70" /> |
26 | <tab_container bottom="-240" follows="left|top" height="180" left="0" | 32 | <tab_container bottom="-240" follows="left|top" height="180" left="0" |
27 | mouse_opaque="false" name="Water Tabs" tab_position="top" width="700"> | 33 | mouse_opaque="false" name="Water Tabs" tab_position="top" width="700"> |