SH-808 Selectively enable/disable features in edit tools

master
leyla_linden 2011-01-19 11:38:34 -08:00
parent b5e67321c3
commit ca1c1eea78
4 changed files with 38 additions and 0 deletions

View File

@ -231,6 +231,10 @@ void LLComboBox::resetDirty()
}
}
bool LLComboBox::itemExists(const std::string& name)
{
return mList->getItemByLabel(name);
}
// add item "name" to menu
LLScrollListItem* LLComboBox::add(const std::string& name, EAddPosition pos, BOOL enabled)

View File

@ -134,6 +134,7 @@ public:
LLScrollListItem* addSeparator(EAddPosition pos = ADD_BOTTOM);
BOOL remove( S32 index ); // remove item by index, return TRUE if found and removed
void removeall() { clearRows(); }
bool itemExists(const std::string& name);
void sortByName(BOOL ascending = TRUE); // Sort the entries in the combobox by name

View File

@ -463,6 +463,13 @@ void LLFloaterTools::refresh()
childSetEnabled("linked_set_cost", have_selection);
childSetEnabled("object_cost", have_selection);
bool enable_mesh = gSavedSettings.getBOOL("MeshEnabled");
getChildView("linked_set_count")->setVisible(enable_mesh);
getChildView("linked_set_cost")->setVisible(enable_mesh);
getChildView("object_count")->setVisible(enable_mesh);
getChildView("object_cost")->setVisible(enable_mesh);
// Refresh child tabs
mPanelPermissions->refresh();
mPanelObject->refresh();

View File

@ -1910,6 +1910,32 @@ void LLPanelObject::refresh()
{
mRootObject = NULL;
}
bool enable_mesh = gSavedSettings.getBOOL("MeshEnabled");
getChildView("label physicsshapetype")->setVisible(enable_mesh);
getChildView("Physics Shape Type Combo Ctrl")->setVisible(enable_mesh);
getChildView("Physics Gravity")->setVisible(enable_mesh);
getChildView("Physics Material Override")->setVisible(enable_mesh);
getChildView("Physics Friction")->setVisible(enable_mesh);
getChildView("Physics Density")->setVisible(enable_mesh);
getChildView("Physics Restitution")->setVisible(enable_mesh);
// if mesh isn't enabled we want to the scale max to be 10
getChild<LLSpinCtrl>("Scale X")->setMaxValue(enable_mesh ? 64 : 10);
getChild<LLSpinCtrl>("Scale Y")->setMaxValue(enable_mesh ? 64 : 10);
getChild<LLSpinCtrl>("Scale Z")->setMaxValue(enable_mesh ? 64 : 10);
LLComboBox* sculpt_combo = getChild<LLComboBox>("sculpt type control");
BOOL found = sculpt_combo->itemExists("Mesh");
if (enable_mesh && !found)
{
sculpt_combo->add("Mesh");
}
else if (!enable_mesh && found)
{
sculpt_combo->remove("Mesh");
}
}