summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-10-23 17:41:32 +0000
committerLoren Shih <seraph@lindenlab.com>2009-10-23 17:41:32 +0000
commita5453d45feaceb713c7cece76d88c2d2b8f825c6 (patch)
tree34bb52b2bb56aa0f4a78b8fce47003cb7955c797 /indra
parentb43771cad585cb9820941eb1b24b67390eaa9435 (diff)
For EXT-1863 : "Wear" and "Take Off" for items should be properly greyed out depending on item worn state
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llinventorybridge.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index bc1a3cd0af..ca9ebf8dc1 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4445,9 +4445,27 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
disabled_items.push_back(std::string("Wearable Edit"));
}
- if( item && (item->getType() == LLAssetType::AT_CLOTHING) )
+ // Disable wear and take off based on whether the item is worn.
+ if(item)
{
- items.push_back(std::string("Take Off"));
+ switch (item->getType())
+ {
+ case LLAssetType::AT_CLOTHING:
+ items.push_back(std::string("Take Off"));
+ case LLAssetType::AT_BODYPART:
+ if (gAgentWearables.isWearingItem(item->getUUID()))
+ {
+ disabled_items.push_back(std::string("Wearable Wear"));
+ disabled_items.push_back(std::string("Wearable Add"));
+ }
+ else
+ {
+ disabled_items.push_back(std::string("Take Off"));
+ }
+ break;
+ default:
+ break;
+ }
}
}
hideContextEntries(menu, items, disabled_items);