diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-14 09:46:37 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-14 09:46:37 +0100 |
commit | 13fdc6e45887fc99031b1267559912837ed1251e (patch) | |
tree | e0d4c37dad92181929062469108cc16e504d6d25 /indra/newview/llappearancemgr.cpp | |
parent | d7e4fa17e80072d609aaadaf060ee8f51f1069eb (diff) | |
parent | 93317037ee4ed4aa7155ae9253800f8977224f73 (diff) |
merge from PE's viewer-trunk
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 ad41a506fb..4d18ff57fe 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) |