diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2010-06-07 13:16:39 -0700 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2010-06-07 13:16:39 -0700 |
commit | 09e1f88cc6a7dc0f52ad9d620a27cd54b4af021c (patch) | |
tree | af6fb655a9dff65772855d1bf9d67b1f6acb0f01 /indra/newview/llagentwearables.cpp | |
parent | 71f39136795609700a6eb46aad7b0f1397a860d0 (diff) | |
parent | 474832b084891df42d731e6d48770b9e969d7b2a (diff) |
Automated merge with ssh://hg.lindenlab.com/palange/viewer-2-0
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r-- | indra/newview/llagentwearables.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index e5796f8e63..d2a01aba16 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1974,6 +1974,32 @@ bool LLAgentWearables::moveWearable(const LLViewerInventoryItem* item, bool clos } // static +void LLAgentWearables::createWearable(LLWearableType::EType type, bool wear, const LLUUID& parent_id) +{ + LLWearable* wearable = LLWearableList::instance().createNewWearable(type); + LLAssetType::EType asset_type = wearable->getAssetType(); + LLInventoryType::EType inv_type = LLInventoryType::IT_WEARABLE; + LLPointer<LLInventoryCallback> cb = wear ? new WearOnAvatarCallback : NULL; + LLUUID folder_id; + + if (parent_id.notNull()) + { + folder_id = parent_id; + } + else + { + LLFolderType::EType folder_type = LLFolderType::assetTypeToFolderType(asset_type); + folder_id = gInventory.findCategoryUUIDForType(folder_type); + } + + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + folder_id, wearable->getTransactionID(), wearable->getName(), + wearable->getDescription(), asset_type, inv_type, wearable->getType(), + wearable->getPermissions().getMaskNextOwner(), + cb); +} + +// static void LLAgentWearables::editWearable(const LLUUID& item_id) { LLViewerInventoryItem* item; |