diff options
author | andreykproductengine <akleshchev@productengine.com> | 2014-07-08 18:20:47 +0300 |
---|---|---|
committer | andreykproductengine <akleshchev@productengine.com> | 2014-07-08 18:20:47 +0300 |
commit | 5af3c90a9e2eac10f78008c0e7af50c85726265b (patch) | |
tree | bdc09a864c093dff66270f99ae375e999dcc6617 /indra/newview/llinventorybridge.cpp | |
parent | 5ae64755f8b01bee831fad34dd2da6607a1a535e (diff) |
MAINT-4086 FIXED Limit the number items "Replace Current Outfit" or "Wear" applies to
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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 ); } |