aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-06-10 12:00:18 -0700
committerMcCabe Maxsted2009-06-10 12:00:18 -0700
commit51120aae8e4a810cc18a016328c0522b93f8534c (patch)
tree421bc04f4f6d35fedf1d536546c0f446a110c235 /linden/indra/newview/llfloatertools.cpp
parentApplied MJM's tree and grass pulldown list from the Hippo Viewer (diff)
downloadmeta-impy-51120aae8e4a810cc18a016328c0522b93f8534c.zip
meta-impy-51120aae8e4a810cc18a016328c0522b93f8534c.tar.gz
meta-impy-51120aae8e4a810cc18a016328c0522b93f8534c.tar.bz2
meta-impy-51120aae8e4a810cc18a016328c0522b93f8534c.tar.xz
Added pulldown label and fixed combobox not hiding
Diffstat (limited to 'linden/indra/newview/llfloatertools.cpp')
-rw-r--r--linden/indra/newview/llfloatertools.cpp81
1 files changed, 46 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);