Commit ec6aff76 authored by NiranV's avatar NiranV

Added: Link and Face index display to edit tools selection count whenever only...

Added: Link and Face index display to edit tools selection count whenever only single links or faces are selected.
Fixed: Object selection count showing 0 objects being selected when "Edit linked" is enabled, make it show selected link prim count.
parent 071a6248
......@@ -519,10 +519,58 @@ void LLFloaterTools::refresh()
else
#endif
{
//BD - Selected Face / Link index.
bool is_link_select = mCheckSelectIndividual->getValue().asBoolean();
//LLObjectSelectionHandle selection = select_mgr->getSelection();
F32 link_cost = mObjectSelection->getSelectedLinksetCost();
S32 link_count = mObjectSelection->getRootObjectCount();
//BD - Selected Face / Link index.
S32 link_index = -1;
S32 face_index = -1;
bool is_face_select = LLToolMgr::getInstance()->getCurrentToolset()->getSelectedTool() == LLToolFace::getInstance();
if (is_link_select || is_face_select)
{
link_count = mObjectSelection->getObjectCount();
LLViewerObject* selected_object = mObjectSelection->getFirstObject();
if (selected_object)
{
if (selected_object && selected_object->getRootEdit())
{
LLViewerObject::child_list_t children = selected_object->getRootEdit()->getChildren();
children.push_front(selected_object->getRootEdit()); // need root in the list too
S32 i = 0;
bool selected = false;
for (LLViewerObject::child_list_t::iterator iter = children.begin(); iter != children.end(); ++iter)
{
if ((*iter)->isSelected())
{
link_index = selected ? -2 : i;
selected = true;
}
++i;
}
}
if (is_face_select)
{
bool selected = false;
for (S32 i = 0; i < selected_object->getNumTEs(); i++)
{
LLTextureEntry* te = selected_object->getTE(i);
if (te && te->isSelected())
{
face_index = selected ? -2 : i;
selected = true;
}
}
}
}
}
LLCrossParcelFunctor func;
if (mObjectSelection->applyToRootObjects(&func, true))
{
......@@ -549,9 +597,20 @@ void LLFloaterTools::refresh()
selection_args["OBJ_COUNT"] = llformat("%.1d", link_count);
selection_args["LAND_IMPACT"] = llformat("%.1d", (S32)link_cost);
//BD - Selected Face / Link index.
selection_args["FACE_IDX"] = llformat("%.1d", face_index);
selection_args["LINK_IDX"] = llformat("%.1d", link_index);
std::ostringstream selection_info;
selection_info << getString("status_selectcount", selection_args);
selection_info << getString(is_link_select ? "status_selectlinkcount" : "status_selectcount", selection_args);
//BD - Selected Face / Link index.
if (link_index >= 0)
selection_info << getString("status_selectlink", selection_args);
if (face_index >= 0)
selection_info << getString("status_selectface", selection_args);
mSelectionCount->setText(selection_info.str());
......
......@@ -68,6 +68,18 @@
name="status_selectcount">
[OBJ_COUNT] objects selected, land impact [LAND_IMPACT]
</floater.string>
<floater.string
name="status_selectlinkcount">
[OBJ_COUNT] links selected, land impact [LAND_IMPACT]
</floater.string>
<floater.string
name="status_selectlink">
, link [LINK_IDX]
</floater.string>
<floater.string
name="status_selectface">
, face [FACE_IDX]
</floater.string>
<floater.string
name="status_remaining_capacity">
Remaining capacity [LAND_CAPACITY].
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment