summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2009-11-24 14:39:39 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2009-11-24 14:39:39 -0500
commitc812c616ea0ba6531b3fe7f75efc815081cd0c2e (patch)
tree2d966b5ba9fae58a3369055fadd6192b417c7f46 /indra/newview/llappearancemgr.cpp
parentfc6cfc27bec61ac1f66c1304cc7b54f19157584e (diff)
parenta22bb00530bb779d8e5bb40b68e55767604d88dc (diff)
merge
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index bdb3c6e24e..6288088210 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -363,6 +363,35 @@ LLUUID LLAppearanceManager::getCOF()
return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
}
+
+const LLViewerInventoryItem* LLAppearanceManager::getCurrentOutfitLink()
+{
+ const LLUUID& current_outfit_cat = getCOF();
+ LLInventoryModel::cat_array_t cat_array;
+ LLInventoryModel::item_array_t item_array;
+ // Can't search on FT_OUTFIT since links to categories return FT_CATEGORY for type since they don't
+ // return preferred type.
+ LLIsType is_category( LLAssetType::AT_CATEGORY );
+ gInventory.collectDescendentsIf(current_outfit_cat,
+ cat_array,
+ item_array,
+ false,
+ is_category,
+ false);
+ for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin();
+ iter != item_array.end();
+ iter++)
+ {
+ const LLViewerInventoryItem *item = (*iter);
+ const LLViewerInventoryCategory *cat = item->getLinkedCategory();
+ if (cat && cat->getPreferredType() == LLFolderType::FT_OUTFIT)
+ {
+ return item;
+ }
+ }
+ return NULL;
+}
+
// Update appearance from outfit folder.
void LLAppearanceManager::changeOutfit(bool proceed, const LLUUID& category, bool append)
{