summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2014-07-01 18:33:23 +0300
committerandreykproductengine <akleshchev@productengine.com>2014-07-01 18:33:23 +0300
commit6b40206279acb608166ae24852b83b1127310800 (patch)
treed74a8c866d8599a7bc5715c29d5ef08957bbc14f
parent614a0ab6bd899abe06f5b9f25ac36f44966702f0 (diff)
MAINT-4086 FIXED Limit the number items "Replace Current Outfit" or "Wear" applies to
-rwxr-xr-xindra/llui/llui.h1
-rwxr-xr-xindra/newview/lltooldraganddrop.cpp28
-rwxr-xr-xindra/newview/lltooldraganddrop.h1
-rwxr-xr-xindra/newview/skins/default/xui/en/strings.xml1
4 files changed, 31 insertions, 0 deletions
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index b162f25887..c727f75c4f 100755
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -86,6 +86,7 @@ enum EAcceptance
{
ACCEPT_POSTPONED, // we are asynchronously determining acceptance
ACCEPT_NO, // Uninformative, general purpose denial.
+ ACCEPT_NO_CUSTOM, // Denial with custom message.
ACCEPT_NO_LOCKED, // Operation would be valid, but permissions are set to disallow it.
ACCEPT_YES_COPY_SINGLE, // We'll take a copy of a single item
ACCEPT_YES_SINGLE, // Accepted. OK to drag and drop single item here.
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index eabf6f0497..575e5c5c52 100755
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -513,6 +513,7 @@ void LLToolDragAndDrop::onMouseCaptureLost()
mSource = SOURCE_AGENT;
mSourceID.setNull();
mObjectID.setNull();
+ mCustomMsg.clear();
}
BOOL LLToolDragAndDrop::handleMouseUp( S32 x, S32 y, MASK mask )
@@ -556,6 +557,12 @@ ECursorType LLToolDragAndDrop::acceptanceToCursor( EAcceptance acceptance )
mCursor = UI_CURSOR_NOLOCKED;
break;
+ case ACCEPT_NO_CUSTOM:
+ mToolTipMsg = mCustomMsg;
+ mCursor = UI_CURSOR_NO;
+ break;
+
+
case ACCEPT_NO:
mCursor = UI_CURSOR_NO;
break;
@@ -630,6 +637,7 @@ BOOL LLToolDragAndDrop::handleToolTip(S32 x, S32 y, MASK mask)
void LLToolDragAndDrop::handleDeselect()
{
mToolTipMsg.clear();
+ mCustomMsg.clear();
LLToolTipMgr::instance().blockToolTips();
}
@@ -2164,6 +2172,26 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
// TODO: investigate wearables may not be loaded at this point EXT-8231
}
+ U32 max_items = gSavedSettings.getU32("WearFolderLimit");
+ if (category->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(category->getUUID(),
+ cats,
+ items,
+ LLInventoryModel::EXCLUDE_TRASH,
+ not_worn);
+ if (items.size() > max_items)
+ {
+ LLStringUtil::format_map_t args;
+ args["AMOUNT"] = llformat("%d", max_items);
+ mCustomMsg = LLTrans::getString("TooltipTooManyWearables",args);
+ return ACCEPT_NO_CUSTOM;
+ }
+ }
+
if(mSource == SOURCE_AGENT)
{
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h
index 99b794ce58..de501ea32a 100755
--- a/indra/newview/lltooldraganddrop.h
+++ b/indra/newview/lltooldraganddrop.h
@@ -149,6 +149,7 @@ protected:
BOOL mDrop;
S32 mCurItemIndex;
std::string mToolTipMsg;
+ std::string mCustomMsg;
enddrag_signal_t mEndDragSignal;
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index fca4a5cddc..f0349f54b7 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -233,6 +233,7 @@ Please try logging in again in a minute.</string>
<string name="TooltipFlagNoScripts">No Scripts</string>
<string name="TooltipLand">Land:</string>
<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
+ <string name="TooltipTooManyWearables">You can't wear a folder containing more than [AMOUNT] items. You can change this limit in Advanced > Show Debug Settings > WearFolderLimit.</string>
<string name="TooltipPrice" value="L$[AMOUNT]: "/>
<string name="TooltipOutboxDragToWorld">You can not rez items in your merchant outbox</string>