Merge with siana/future
This commit is contained in:
@@ -87,6 +87,8 @@
|
||||
|
||||
#include "qtoolalign.h" //Thank Qarl!
|
||||
|
||||
#include "llvograss.h"
|
||||
#include "llvotree.h"
|
||||
|
||||
// Globals
|
||||
LLFloaterTools *gFloaterTools = NULL;
|
||||
@@ -295,6 +297,8 @@ BOOL LLFloaterTools::postBuild()
|
||||
llwarns << "Tool button not found! DOA Pending." << llendl;
|
||||
}
|
||||
}
|
||||
mComboTreesGrass = getChild<LLComboBox>("trees_grass");
|
||||
childSetCommitCallback("trees_grass", onSelectTreesGrass, (void*)0);
|
||||
mCheckCopySelection = getChild<LLCheckBoxCtrl>("checkbox copy selection");
|
||||
childSetValue("checkbox copy selection",(BOOL)gSavedSettings.getBOOL("CreateToolCopySelection"));
|
||||
mCheckSticky = getChild<LLCheckBoxCtrl>("checkbox sticky");
|
||||
@@ -392,6 +396,7 @@ LLFloaterTools::LLFloaterTools()
|
||||
mBtnDuplicate(NULL),
|
||||
mBtnDuplicateInPlace(NULL),
|
||||
|
||||
mComboTreesGrass(NULL),
|
||||
mCheckSticky(NULL),
|
||||
mCheckCopySelection(NULL),
|
||||
mCheckCopyCenters(NULL),
|
||||
@@ -721,6 +726,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
|
||||
|
||||
mBtnCreate ->setToggleState( tool == LLToolCompCreate::getInstance() );
|
||||
|
||||
updateTreeGrassCombo(create_visible);
|
||||
|
||||
if (mCheckCopySelection
|
||||
&& mCheckCopySelection->get())
|
||||
{
|
||||
@@ -1058,3 +1065,77 @@ void LLFloaterTools::onFocusReceived()
|
||||
LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
|
||||
LLFloater::onFocusReceived();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterTools::onSelectTreesGrass(LLUICtrl*, void*)
|
||||
{
|
||||
const std::string &selected = gFloaterTools->mComboTreesGrass->getValue();
|
||||
LLPCode pcode = LLToolPlacer::getObjectType();
|
||||
if (pcode == LLToolPlacerPanel::sTree)
|
||||
{
|
||||
gSavedSettings.setString("LastTree", selected);
|
||||
}
|
||||
else if (pcode == LLToolPlacerPanel::sGrass)
|
||||
{
|
||||
gSavedSettings.setString("LastGrass", selected);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterTools::updateTreeGrassCombo(bool visible)
|
||||
{
|
||||
LLTextBox* tree_grass_label = getChild<LLTextBox>("tree_grass_label");
|
||||
if (visible)
|
||||
{
|
||||
LLPCode pcode = LLToolPlacer::getObjectType();
|
||||
std::map<std::string, S32>::iterator it, end;
|
||||
std::string selected;
|
||||
if (pcode == LLToolPlacerPanel::sTree)
|
||||
{
|
||||
tree_grass_label->setVisible(visible);
|
||||
LLButton* button = getChild<LLButton>("ToolTree");
|
||||
tree_grass_label->setText(button->getToolTip());
|
||||
|
||||
selected = gSavedSettings.getString("LastTree");
|
||||
it = LLVOTree::sSpeciesNames.begin();
|
||||
end = LLVOTree::sSpeciesNames.end();
|
||||
}
|
||||
else if (pcode == LLToolPlacerPanel::sGrass)
|
||||
{
|
||||
tree_grass_label->setVisible(visible);
|
||||
LLButton* button = getChild<LLButton>("ToolGrass");
|
||||
tree_grass_label->setText(button->getToolTip());
|
||||
|
||||
selected = gSavedSettings.getString("LastGrass");
|
||||
it = LLVOGrass::sSpeciesNames.begin();
|
||||
end = LLVOGrass::sSpeciesNames.end();
|
||||
}
|
||||
else
|
||||
{
|
||||
mComboTreesGrass->removeall();
|
||||
mComboTreesGrass->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label
|
||||
mComboTreesGrass->setEnabled(false);
|
||||
mComboTreesGrass->setVisible(false);
|
||||
tree_grass_label->setVisible(false);
|
||||
return;
|
||||
}
|
||||
|
||||
mComboTreesGrass->removeall();
|
||||
mComboTreesGrass->add("Random");
|
||||
|
||||
int select = 0, i = 0;
|
||||
|
||||
while (it != end)
|
||||
{
|
||||
const std::string &species = it->first;
|
||||
mComboTreesGrass->add(species); ++i;
|
||||
if (species == selected) select = i;
|
||||
++it;
|
||||
}
|
||||
// if saved species not found, default to "Random"
|
||||
mComboTreesGrass->selectNthItem(select);
|
||||
mComboTreesGrass->setEnabled(true);
|
||||
}
|
||||
|
||||
mComboTreesGrass->setVisible(visible);
|
||||
tree_grass_label->setVisible(visible);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user