summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2014-07-08 18:20:47 +0300
committerandreykproductengine <akleshchev@productengine.com>2014-07-08 18:20:47 +0300
commit5af3c90a9e2eac10f78008c0e7af50c85726265b (patch)
treebdc09a864c093dff66270f99ae375e999dcc6617 /indra
parent5ae64755f8b01bee831fad34dd2da6607a1a535e (diff)
MAINT-4086 FIXED Limit the number items "Replace Current Outfit" or "Wear" applies to
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llappearancemgr.cpp14
-rwxr-xr-xindra/newview/llinventorybridge.cpp22
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml8
3 files changed, 30 insertions, 14 deletions
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
@@ -5376,6 +5376,14 @@ Do you want to replace it with the selected object?
</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"
name="DoNotDisturbModePay"