FIRE-24142 - Show number of elements in object inventory
parent
b98cf49531
commit
62eab88bf7
|
|
@ -709,12 +709,43 @@ const std::string& LLTaskCategoryBridge::getDisplayName() const
|
|||
|
||||
if (cat)
|
||||
{
|
||||
// <FS:Ansariel> Make object root folder name localizable again
|
||||
// <FS:Zi> FIRE-24142 - Show number of elements in object inventory
|
||||
//mDisplayName.assign(cat->getName());
|
||||
if (cat->getParentUUID().isNull() && cat->getName() == "Contents")
|
||||
{
|
||||
mDisplayName.assign(LLTrans::getString("Contents"));
|
||||
LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID());
|
||||
if (object)
|
||||
{
|
||||
LLInventoryObject* inventory_root = object->getInventoryRoot();
|
||||
LLInventoryObject::object_list_t contents;
|
||||
|
||||
object->getInventoryContents(contents);
|
||||
S32 numElements = contents.size();
|
||||
|
||||
std::string elementsString = "FSObjectInventoryNoElements";
|
||||
if (numElements == 1)
|
||||
{
|
||||
elementsString = "FSObjectInventoryOneElement";
|
||||
}
|
||||
else
|
||||
{
|
||||
elementsString = "FSObjectInventoryElements";
|
||||
}
|
||||
|
||||
LLSD args;
|
||||
args["NUM_ELEMENTS"] = numElements;
|
||||
mDisplayName.assign(llformat("%s (%s)",
|
||||
LLTrans::getString("Contents").c_str(),
|
||||
LLTrans::getString(elementsString, args).c_str()));
|
||||
}
|
||||
// fallback in case something goes wrong with finding the inventory object
|
||||
else
|
||||
{
|
||||
// <FS:Ansariel> Make object root folder name localizable again
|
||||
mDisplayName.assign(LLTrans::getString("Contents"));
|
||||
}
|
||||
}
|
||||
// </FS:Zi>
|
||||
else
|
||||
{
|
||||
mDisplayName.assign(cat->getName());
|
||||
|
|
|
|||
|
|
@ -3208,4 +3208,9 @@ Your current position: [AVATAR_POS]
|
|||
<string name="FSAreaSearch_Cost_Label">L$[COST]</string>
|
||||
|
||||
<string name="ImportingWindlightBulk">Importing Windlights...</string>
|
||||
|
||||
<!-- <FS:Zi> FIRE-24142 - Show number of elements in object inventory -->
|
||||
<string name="FSObjectInventoryNoElements">No Elements</string>
|
||||
<string name="FSObjectInventoryOneElement">1 Element</string>
|
||||
<string name="FSObjectInventoryElements">[NUM_ELEMENTS] Elements</string>
|
||||
</strings>
|
||||
|
|
|
|||
Loading…
Reference in New Issue