diff options
author | Igor Borovkov <iborovkov@productengine.com> | 2010-04-13 13:37:14 +0300 |
---|---|---|
committer | Igor Borovkov <iborovkov@productengine.com> | 2010-04-13 13:37:14 +0300 |
commit | 613b4e9361df55da3863a546c806493d48f848f3 (patch) | |
tree | 56925b69c44857339f662358c02f87476f20d442 /indra/newview/llappearancemgr.cpp | |
parent | ab246784b069913363e544ab3c9a9fb615e0c71d (diff) |
done EXT-6675 Fix TRASH btn on Edit Outfit panel to remove an item from avatar (from COF)
Trash button removes from avatar a selected item only of "clothing" and "object" types
Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/209/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 4a30ba3066..b6fc33e9a2 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -42,8 +42,10 @@ #include "llinventoryfunctions.h" #include "llinventoryobserver.h" #include "llnotificationsutil.h" +#include "llselectmgr.h" #include "llsidepanelappearance.h" #include "llsidetray.h" +#include "llviewerobjectlist.h" #include "llvoavatar.h" #include "llvoavatarself.h" #include "llviewerregion.h" @@ -1587,6 +1589,39 @@ void LLAppearanceMgr::wearBaseOutfit() updateCOF(base_outfit_id); } +void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) +{ + LLViewerInventoryItem * item_to_remove = gInventory.getItem(id_to_remove); + if (!item_to_remove) return; + + switch (item_to_remove->getType()) + { + case LLAssetType::AT_CLOTHING: + if (get_is_item_worn(id_to_remove)) + { + //*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future + LLWearableBridge::removeItemFromAvatar(item_to_remove); + } + break; + case LLAssetType::AT_OBJECT: + gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); + gMessageSystem->nextBlockFast(_PREHASH_ObjectData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_to_remove->getLinkedUUID()); + gMessageSystem->sendReliable( gAgent.getRegion()->getHost()); + + { + // this object might have been selected, so let the selection manager know it's gone now + LLViewerObject *found_obj = gObjectList.findObject(item_to_remove->getLinkedUUID()); + if (found_obj) + { + LLSelectMgr::getInstance()->remove(found_obj); + }; + } + default: break; + } +} + //#define DUMP_CAT_VERBOSE void LLAppearanceMgr::dumpCat(const LLUUID& cat_id, const std::string& msg) |