diff options
author | Igor Borovkov <iborovkov@productengine.com> | 2010-04-09 15:07:42 +0300 |
---|---|---|
committer | Igor Borovkov <iborovkov@productengine.com> | 2010-04-09 15:07:42 +0300 |
commit | 43c85b0dfb4e7e7c9fdfc02954bbb0115ec344c4 (patch) | |
tree | 55de2ec227dbd322f7467edb29e535d1820e72cd /indra/newview/llappearancemgr.cpp | |
parent | 691237cee84b8dcb014e8b261eb8d918c9df31b7 (diff) |
done EXT-6716 Implement Add button functionality for adding a wearable to Current Outfit (Edit Outfit panel)
Added temporary PLUS button on the button bar under the top list of Edit Outfit panel
Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/203/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 40c1f89f3f..0bd95987d7 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -610,6 +610,38 @@ const LLUUID LLAppearanceMgr::getBaseOutfitUUID() return outfit_cat->getUUID(); } +bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_update) +{ + if (item_id_to_wear.isNull()) return false; + + //only the item from a user's inventory is allowed + if (!gInventory.isObjectDescendentOf(item_id_to_wear, gInventory.getRootFolderID())) return false; + + LLViewerInventoryItem* item_to_wear = gInventory.getItem(item_id_to_wear); + if (!item_to_wear) return false; + + switch (item_to_wear->getType()) + { + case LLAssetType::AT_CLOTHING: + case LLAssetType::AT_BODYPART: + // Don't wear anything until initial wearables are loaded, can + // destroy clothing items. + if (!gAgentWearables.areWearablesLoaded()) + { + LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); + return false; + } + addCOFItemLink(item_to_wear, do_update); + break; + case LLAssetType::AT_OBJECT: + rez_attachment(item_to_wear, NULL); + break; + default: return false;; + } + + return true; +} + // Update appearance from outfit folder. void LLAppearanceMgr::changeOutfit(bool proceed, const LLUUID& category, bool append) { |