Add translatability to Selected prims/objects and Link number text
Also clean up this area's code a bit.
This commit is contained in:
@@ -538,36 +538,41 @@ void LLFloaterTools::refresh()
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
F32 link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost();
|
auto selection = LLSelectMgr::getInstance()->getSelection();
|
||||||
S32 link_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount();
|
F32 link_cost = selection->getSelectedLinksetCost();
|
||||||
|
S32 link_count = selection->getRootObjectCount();
|
||||||
|
S32 prim_count = selection->getObjectCount();
|
||||||
|
auto child = getChild<LLUICtrl>("link_num_obj_count");
|
||||||
// Added in Link Num value -HgB
|
// Added in Link Num value -HgB
|
||||||
S32 prim_count = LLSelectMgr::getInstance()->getEditSelection()->getObjectCount();
|
|
||||||
std::string value_string;
|
std::string value_string;
|
||||||
bool edit_linked(gSavedSettings.getBOOL("EditLinkedParts"));
|
bool edit_linked(mCheckSelectIndividual->getValue());
|
||||||
if (edit_linked && prim_count == 1) //Selecting a single prim in "Edit Linked" mode, show link number
|
|
||||||
{
|
{
|
||||||
link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost();
|
else if (edit_linked && prim_count == 1) //Selecting a single prim in "Edit Linked" mode, show link number
|
||||||
childSetTextArg("link_num_obj_count", "[DESC]", std::string("Link number:"));
|
{
|
||||||
|
link_cost = selection->getSelectedObjectCost();
|
||||||
|
child->setTextArg("[DESC]", getString("Link number:"));
|
||||||
|
|
||||||
LLViewerObject* selected = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
|
if (LLViewerObject* selected = selection->getFirstObject())
|
||||||
if (selected && selected->getRootEdit())
|
|
||||||
{
|
{
|
||||||
LLViewerObject::child_list_t children = selected->getRootEdit()->getChildren();
|
if (auto root = selected->getRootEdit())
|
||||||
if (children.empty())
|
|
||||||
{
|
{
|
||||||
value_string = "0"; // An unlinked prim is "link 0".
|
LLViewerObject::child_list_t children = root->getChildren();
|
||||||
}
|
if (children.empty())
|
||||||
else
|
|
||||||
{
|
|
||||||
children.push_front(selected->getRootEdit()); // need root in the list too
|
|
||||||
S32 index = 1;
|
|
||||||
for (LLViewerObject::child_list_t::iterator iter = children.begin(); iter != children.end(); ++iter, ++index)
|
|
||||||
{
|
{
|
||||||
if ((*iter)->isSelected())
|
value_string = "0"; // An unlinked prim is "link 0".
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
children.push_front(selected->getRootEdit()); // need root in the list too
|
||||||
|
S32 index = 1;
|
||||||
|
for (const auto& child : children)
|
||||||
{
|
{
|
||||||
LLResMgr::getInstance()->getIntegerString(value_string, index);
|
++index;
|
||||||
break;
|
if (child->isSelected())
|
||||||
|
{
|
||||||
|
LLResMgr::getInstance()->getIntegerString(value_string, index);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -575,16 +580,16 @@ void LLFloaterTools::refresh()
|
|||||||
}
|
}
|
||||||
else if (edit_linked)
|
else if (edit_linked)
|
||||||
{
|
{
|
||||||
childSetTextArg("link_num_obj_count", "[DESC]", std::string("Selected prims:"));
|
child->setTextArg("[DESC]", getString("Selected prims:"));
|
||||||
LLResMgr::getInstance()->getIntegerString(value_string, prim_count);
|
LLResMgr::getInstance()->getIntegerString(value_string, prim_count);
|
||||||
link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost();
|
link_cost = selection->getSelectedObjectCost();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
childSetTextArg("link_num_obj_count", "[DESC]", std::string("Selected objects:"));
|
child->setTextArg("[DESC]", getString("Selected objects:"));
|
||||||
LLResMgr::getInstance()->getIntegerString(value_string, link_count);
|
LLResMgr::getInstance()->getIntegerString(value_string, link_count);
|
||||||
}
|
}
|
||||||
childSetTextArg("link_num_obj_count", "[NUM]", value_string);
|
child->setTextArg("[NUM]", value_string);
|
||||||
|
|
||||||
/* Singu Note: We're not using this yet because we have no place to put it
|
/* Singu Note: We're not using this yet because we have no place to put it
|
||||||
LLCrossParcelFunctor func;
|
LLCrossParcelFunctor func;
|
||||||
@@ -610,18 +615,17 @@ void LLFloaterTools::refresh()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLStringUtil::format_map_t selection_args;
|
auto sel_count = getChild<LLTextBox>("selection_count");
|
||||||
selection_args["OBJ_COUNT"] = llformat("%.1d", prim_count);
|
bool have_selection = !selection->isEmpty();
|
||||||
selection_args["LAND_IMPACT"] = llformat(edit_linked ? "%.2f" : "%.0f", link_cost);
|
if (have_selection)
|
||||||
|
{
|
||||||
|
LLStringUtil::format_map_t selection_args;
|
||||||
|
selection_args["OBJ_COUNT"] = llformat("%.1d", prim_count);
|
||||||
|
selection_args["LAND_IMPACT"] = llformat(edit_linked ? "%.2f" : "%.0f", link_cost);
|
||||||
|
|
||||||
std::ostringstream selection_info;
|
sel_count->setText(getString("status_selectcount", selection_args));
|
||||||
|
}
|
||||||
selection_info << getString("status_selectcount", selection_args);
|
sel_count->setVisible(have_selection);
|
||||||
|
|
||||||
getChild<LLTextBox>("selection_count")->setText(selection_info.str());
|
|
||||||
|
|
||||||
bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty();
|
|
||||||
childSetVisible("selection_count", have_selection);
|
|
||||||
//childSetVisible("remaining_capacity", have_selection);
|
//childSetVisible("remaining_capacity", have_selection);
|
||||||
childSetVisible("selection_empty", !have_selection);
|
childSetVisible("selection_empty", !have_selection);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,9 @@
|
|||||||
<floater.string name="status_selectcount">
|
<floater.string name="status_selectcount">
|
||||||
Primitives: [OBJ_COUNT], LI: [LAND_IMPACT]
|
Primitives: [OBJ_COUNT], LI: [LAND_IMPACT]
|
||||||
</floater.string>
|
</floater.string>
|
||||||
|
<string name="Link number:" value="Link number:"/>
|
||||||
|
<string name="Selected prims:" value="Selected prims:"/>
|
||||||
|
<string name="Selected objects:" value="Selected objects:"/>
|
||||||
<floater.string
|
<floater.string
|
||||||
name="status_remaining_capacity">
|
name="status_remaining_capacity">
|
||||||
Remaining capacity [LAND_CAPACITY].
|
Remaining capacity [LAND_CAPACITY].
|
||||||
|
|||||||
Reference in New Issue
Block a user