diff options
author | AndreyL ProductEngine <andreylproductengine@lindenlab.com> | 2014-05-29 10:57:16 +0300 |
---|---|---|
committer | AndreyL ProductEngine <andreylproductengine@lindenlab.com> | 2014-05-29 10:57:16 +0300 |
commit | fadf35b90a96475cc2af31eab08a982641a6db0e (patch) | |
tree | d3b7c49d6454f6beee99a3db2cd66c7d9d8d5c27 /indra/newview | |
parent | a7b523b36a79bdb1ec8701ce20df4fb60fead1bf (diff) |
MAINT-4086 FIXED Limit the number items "Replace Current Outfit" or "Wear" applies to
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 11 | ||||
-rwxr-xr-x | indra/newview/llappearancemgr.cpp | 16 | ||||
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 4 |
3 files changed, 31 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c2555efbb5..f2f457f575 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -15154,6 +15154,17 @@ <key>Value</key> <string /> </map> + <key>WearFolderLimit</key> + <map> + <key>Comment</key> + <string>Limits number of items in the folder that can be replaced/added to current outfit</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>U32</string> + <key>Value</key> + <integer>125</integer> + </map> </map> </llsd> diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index b7fe96727f..c76652c650 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1621,6 +1621,14 @@ bool LLAppearanceMgr::getCanAddToCOF(const LLUUID& outfit_cat_id) items, 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; } @@ -1647,6 +1655,14 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) items, 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 feb7a0e904..fbaee68cf8 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3639,6 +3639,10 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& { disabled_items.push_back(std::string("Replace Outfit")); } + if (!LLAppearanceMgr::getCanAddToCOF(mUUID)) + { + disabled_items.push_back(std::string("Add To Outfit")); + } items.push_back(std::string("Outfit Separator")); } } |