summaryrefslogtreecommitdiff
path: root/indra/newview/llwearableitemslist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llwearableitemslist.cpp')
-rw-r--r--indra/newview/llwearableitemslist.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index fe8c09e329..8ea731cf10 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -569,7 +569,7 @@ bool LLWearableItemTypeNameComparator::sortAssetTypeByName(LLAssetType::EType it
}
return const_it->second.mSortAssetTypeByName;
-}
+ }
bool LLWearableItemTypeNameComparator::sortWearableTypeByName(LLAssetType::EType item_type) const
{
@@ -579,7 +579,7 @@ bool LLWearableItemTypeNameComparator::sortWearableTypeByName(LLAssetType::EType
{
llwarns<<"Absent information about sorting items of "<<LLAssetType::getDesc(item_type)<<" type"<<llendl;
return true;
- }
+}
return const_it->second.mSortWearableTypeByName;
}
@@ -769,6 +769,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
U32 n_links = 0; // number of links among the selected items
U32 n_editable = 0; // number of editable items among the selected ones
+ bool can_be_worn = false;
+
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
LLUUID id = *it;
@@ -804,16 +806,22 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
{
++n_already_worn;
}
+
+ // if any in trash
+ if (!can_be_worn)
+ {
+ can_be_worn = get_can_item_be_worn(item->getLinkedUUID());
+ }
} // for
bool standalone = mParent ? mParent->isStandalone() : false;
// *TODO: eliminate multiple traversals over the menu items
- setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0);
+ 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);
+ 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_replace", n_worn == 0 && n_already_worn != 0);
+ 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);
setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1);