summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2009-12-18 13:24:29 -0600
committerDave Parks <davep@lindenlab.com>2009-12-18 13:24:29 -0600
commit6aa71844a8949ab3c75b6cbe1a5f8cb811aa27b8 (patch)
treee73b1d2847a33c7568688f85265913a69d1711a2 /indra/newview/llinventoryfunctions.cpp
parent5015886e1763887f534321790d56b6cee5a75dfa (diff)
parentd5b53eb483ec042d83859ec957dce7699c7469aa (diff)
Merge with viewer-2-0
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 01c7f0974d..ce4255448f 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -341,3 +341,33 @@ LLUIImagePtr get_item_icon(LLAssetType::EType asset_type,
const std::string& icon_name = get_item_icon_name(asset_type, inventory_type, attachment_point, item_is_multi );
return LLUI::getUIImage(icon_name);
}
+
+BOOL get_is_item_worn(const LLUUID& id)
+{
+ const LLViewerInventoryItem* item = gInventory.getItem(id);
+ if (!item)
+ return FALSE;
+
+ switch(item->getType())
+ {
+ case LLAssetType::AT_OBJECT:
+ {
+ const LLVOAvatarSelf* my_avatar = gAgent.getAvatarObject();
+ if(my_avatar && my_avatar->isWearingAttachment(item->getLinkedUUID()))
+ return TRUE;
+ break;
+ }
+ case LLAssetType::AT_BODYPART:
+ case LLAssetType::AT_CLOTHING:
+ if(gAgentWearables.isWearingItem(item->getLinkedUUID()))
+ return TRUE;
+ break;
+ case LLAssetType::AT_GESTURE:
+ if (LLGestureManager::instance().isGestureActive(item->getLinkedUUID()))
+ return TRUE;
+ break;
+ default:
+ break;
+ }
+ return FALSE;
+}