From a5453d45feaceb713c7cece76d88c2d2b8f825c6 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 23 Oct 2009 17:41:32 +0000 Subject: For EXT-1863 : "Wear" and "Take Off" for items should be properly greyed out depending on item worn state --- indra/newview/llinventorybridge.cpp | 22 ++++++++++++++++++++-- 1 file 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); -- cgit v1.2.3