MAINT-4086 FIXED Limit the number items "Replace Current Outfit" or "Wear" applies to
parent
5ae64755f8
commit
5af3c90a9e
|
|
@ -1716,13 +1716,6 @@ bool LLAppearanceMgr::getCanAddToCOF(const LLUUID& outfit_cat_id)
|
|||
LLInventoryModel::EXCLUDE_TRASH,
|
||||
not_worn);
|
||||
|
||||
U32 max_items = gSavedSettings.getU32("WearFolderLimit");
|
||||
if (items.size() > max_items)
|
||||
{
|
||||
LL_WARNS() << "Folder contains more wearables than allowed to wear by WearFolderLimit setting" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
return items.size() > 0;
|
||||
}
|
||||
|
||||
|
|
@ -1750,13 +1743,6 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id)
|
|||
LLInventoryModel::EXCLUDE_TRASH,
|
||||
is_worn);
|
||||
|
||||
U32 max_items = gSavedSettings.getU32("WearFolderLimit");
|
||||
if (items.size() > max_items)
|
||||
{
|
||||
LL_WARNS() << "Folder contains more wearables than allowed to wear by WearFolderLimit setting" << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
return items.size() > 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3754,6 +3754,28 @@ void LLFolderBridge::modifyOutfit(BOOL append)
|
|||
LLViewerInventoryCategory* cat = getCategory();
|
||||
if(!cat) return;
|
||||
|
||||
// checking amount of items to wear
|
||||
U32 max_items = gSavedSettings.getU32("WearFolderLimit");
|
||||
if (cat->getDescendentCount() > max_items)
|
||||
{
|
||||
LLInventoryModel::cat_array_t cats;
|
||||
LLInventoryModel::item_array_t items;
|
||||
LLFindWearablesEx not_worn(/*is_worn=*/ false, /*include_body_parts=*/ false);
|
||||
gInventory.collectDescendentsIf(cat->getUUID(),
|
||||
cats,
|
||||
items,
|
||||
LLInventoryModel::EXCLUDE_TRASH,
|
||||
not_worn);
|
||||
|
||||
if (items.size() > max_items)
|
||||
{
|
||||
LLSD args;
|
||||
args["AMOUNT"] = llformat("%d", max_items);
|
||||
LLNotificationsUtil::add("TooManyWearables", args);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LLAppearanceMgr::instance().wearInventoryCategory( cat, FALSE, append );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5375,6 +5375,14 @@ Do you want to replace it with the selected object?
|
|||
</form>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="TooManyWearables"
|
||||
type="alertmodal">
|
||||
You can't wear a folder containing more than [AMOUNT] items. You can change this limit in Advanced > Show Debug Settings > WearFolderLimit.
|
||||
<tag>fail</tag>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alert.tga"
|
||||
label="Do Not Disturb Mode Warning"
|
||||
|
|
|
|||
Loading…
Reference in New Issue