diff options
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/llfloatertools.cpp | 81 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_tools.xml | 4 |
2 files changed, 50 insertions, 35 deletions
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 2fc4c71..73b6061 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp | |||
@@ -1041,44 +1041,55 @@ void LLFloaterTools::updateTreeGrassCombo(bool visible) | |||
1041 | { | 1041 | { |
1042 | if (visible) | 1042 | if (visible) |
1043 | { | 1043 | { |
1044 | LLPCode pcode = LLToolPlacer::getObjectType(); | 1044 | LLPCode pcode = LLToolPlacer::getObjectType(); |
1045 | std::map<std::string, S32>::iterator it, end; | 1045 | std::map<std::string, S32>::iterator it, end; |
1046 | std::string selected; | 1046 | std::string selected; |
1047 | if (pcode == LLToolPlacerPanel::sTree) | 1047 | LLTextBox* tree_grass_label = getChild<LLTextBox>("tree_grass_label"); |
1048 | { | 1048 | if (pcode == LLToolPlacerPanel::sTree) |
1049 | selected = gSavedSettings.getString("LastTree"); | 1049 | { |
1050 | it = LLVOTree::sSpeciesNames.begin(); | 1050 | tree_grass_label->setVisible(true); |
1051 | end = LLVOTree::sSpeciesNames.end(); | 1051 | LLButton* button = getChild<LLButton>("ToolTree"); |
1052 | } | 1052 | tree_grass_label->setText(button->getToolTip()); |
1053 | else if (pcode == LLToolPlacerPanel::sGrass) | 1053 | |
1054 | { | 1054 | selected = gSavedSettings.getString("LastTree"); |
1055 | selected = gSavedSettings.getString("LastGrass"); | 1055 | it = LLVOTree::sSpeciesNames.begin(); |
1056 | it = LLVOGrass::sSpeciesNames.begin(); | 1056 | end = LLVOTree::sSpeciesNames.end(); |
1057 | end = LLVOGrass::sSpeciesNames.end(); | 1057 | } |
1058 | } | 1058 | else if (pcode == LLToolPlacerPanel::sGrass) |
1059 | else | 1059 | { |
1060 | { | 1060 | tree_grass_label->setVisible(true); |
1061 | mComboTreesGrass->removeall(); | 1061 | LLButton* button = getChild<LLButton>("ToolGrass"); |
1062 | mComboTreesGrass->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label | 1062 | tree_grass_label->setText(button->getToolTip()); |
1063 | mComboTreesGrass->setEnabled(false); | 1063 | |
1064 | return; | 1064 | selected = gSavedSettings.getString("LastGrass"); |
1065 | } | 1065 | it = LLVOGrass::sSpeciesNames.begin(); |
1066 | end = LLVOGrass::sSpeciesNames.end(); | ||
1067 | } | ||
1068 | else | ||
1069 | { | ||
1070 | mComboTreesGrass->removeall(); | ||
1071 | mComboTreesGrass->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label | ||
1072 | mComboTreesGrass->setEnabled(false); | ||
1073 | mComboTreesGrass->setVisible(false); | ||
1074 | tree_grass_label->setVisible(false); | ||
1075 | return; | ||
1076 | } | ||
1066 | 1077 | ||
1067 | mComboTreesGrass->removeall(); | 1078 | mComboTreesGrass->removeall(); |
1068 | mComboTreesGrass->add("Random"); | 1079 | mComboTreesGrass->add("Random"); |
1069 | 1080 | ||
1070 | int select = 0, i = 0; | 1081 | int select = 0, i = 0; |
1071 | 1082 | ||
1072 | while (it != end) | 1083 | while (it != end) |
1073 | { | 1084 | { |
1074 | const std::string &species = it->first; | 1085 | const std::string &species = it->first; |
1075 | mComboTreesGrass->add(species); ++i; | 1086 | mComboTreesGrass->add(species); ++i; |
1076 | if (species == selected) select = i; | 1087 | if (species == selected) select = i; |
1077 | ++it; | 1088 | ++it; |
1078 | } | 1089 | } |
1079 | // if saved species not found, default to "Random" | 1090 | // if saved species not found, default to "Random" |
1080 | mComboTreesGrass->selectNthItem(select); | 1091 | mComboTreesGrass->selectNthItem(select); |
1081 | mComboTreesGrass->setEnabled(true); | 1092 | mComboTreesGrass->setEnabled(true); |
1082 | } | 1093 | } |
1083 | 1094 | ||
1084 | mComboTreesGrass->setVisible(visible); | 1095 | mComboTreesGrass->setVisible(visible); |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml index 6fc5374..b649614 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml | |||
@@ -227,6 +227,10 @@ | |||
227 | image_unselected="object_grass.tga" label="" label_selected="" | 227 | image_unselected="object_grass.tga" label="" label_selected="" |
228 | left_delta="23" mouse_opaque="true" name="ToolGrass" scale_image="TRUE" | 228 | left_delta="23" mouse_opaque="true" name="ToolGrass" scale_image="TRUE" |
229 | tool_tip="Grass" width="24" /> | 229 | tool_tip="Grass" width="24" /> |
230 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | ||
231 | bottom="-104" drop_shadow_visible="true" follows="left|top" | ||
232 | font="SansSerifSmall" h_pad="0" halign="left" height="16" right="-5" | ||
233 | mouse_opaque="true" name="tree_grass_label" v_pad="0" width="135" /> | ||
230 | <combo_box max_chars="20" enabled="false" allow_text_entry="false" name="trees_grass" | 234 | <combo_box max_chars="20" enabled="false" allow_text_entry="false" name="trees_grass" |
231 | height="18" width="135" right="-5" bottom="-122" | 235 | height="18" width="135" right="-5" bottom="-122" |
232 | follows="left|top" mouse_opaque="true" /> | 236 | follows="left|top" mouse_opaque="true" /> |