From 5af3c90a9e2eac10f78008c0e7af50c85726265b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 8 Jul 2014 18:20:47 +0300 Subject: MAINT-4086 FIXED Limit the number items "Replace Current Outfit" or "Wear" applies to --- indra/newview/llappearancemgr.cpp | 14 -------------- indra/newview/llinventorybridge.cpp | 22 ++++++++++++++++++++++ .../newview/skins/default/xui/en/notifications.xml | 8 ++++++++ 3 files changed, 30 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 61b8071cf9..8e5b0516fb 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -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; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3b9d5e0c3d..e0fbb655a9 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -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 ); } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 0607576fe6..1bc533f701 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5375,6 +5375,14 @@ Do you want to replace it with the selected object? + + You can't wear a folder containing more than [AMOUNT] items. You can change this limit in Advanced > Show Debug Settings > WearFolderLimit. + fail + +