diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-17 19:46:00 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-17 19:46:00 -0500 |
commit | a08467ae262549fe89a6ab3539582b3d015ad53f (patch) | |
tree | 0635965e3cbce94bd686de873d8a0b85f5755172 /indra/newview/llinventoryfunctions.cpp | |
parent | e1c839f16d521d5b7c4a8bf56120f4da2a28e114 (diff) | |
parent | b29b9c961900f98121ba80447e1e737cff0d4331 (diff) |
automated merge viewer2.0->viewer2.0
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 75218e98e0..8f4136c01f 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -338,3 +338,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; +} |