summaryrefslogtreecommitdiff
path: root/indra/newview/llwearableitemslist.cpp
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-08-09 17:17:49 -0700
committerMonroe Linden <monroe@lindenlab.com>2010-08-09 17:17:49 -0700
commit235afd7836d74305292067cd6c29fe0192d6201d (patch)
tree2cb0f2f9c817b9f70db8e115aaf69990555210ea /indra/newview/llwearableitemslist.cpp
parentc90a90407c30415bf9700d3b037a0b8918e261d3 (diff)
parent011c3686a6e10edfe40adb67105298033188c1d6 (diff)
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience
Diffstat (limited to 'indra/newview/llwearableitemslist.cpp')
-rw-r--r--indra/newview/llwearableitemslist.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index c9130b56b4..194213f880 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -863,12 +863,13 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
} // for
bool standalone = mParent ? mParent->isStandalone() : false;
+ bool wear_add_visible = mask & (MASK_CLOTHING|MASK_ATTACHMENT) && n_worn == 0 && can_be_worn && (n_already_worn != 0 || mask & MASK_ATTACHMENT);
// *TODO: eliminate multiple traversals over the menu items
setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && can_be_worn);
setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0);
- setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0 && can_be_worn);
- setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0);
+ setMenuItemVisible(menu, "wear_add", wear_add_visible);
+ setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()));
setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && can_be_worn);
//visible only when one item selected and this item is worn
setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1);
@@ -984,7 +985,18 @@ bool LLWearableItemsList::ContextMenu::canAddWearable(const LLUUID& item_id)
// TODO: investigate wearables may not be loaded at this point EXT-8231
LLViewerInventoryItem* item = gInventory.getItem(item_id);
- if (!item || item->getType() != LLAssetType::AT_CLOTHING)
+ if (!item)
+ {
+ return false;
+ }
+
+ if (item->getType() == LLAssetType::AT_OBJECT)
+ {
+ // *TODO: is this the right check?
+ return isAgentAvatarValid() && gAgentAvatarp->canAttachMoreObjects();
+ }
+
+ if (item->getType() != LLAssetType::AT_CLOTHING)
{
return false;
}