From d9e61bc4f9c1e8085a314ab9ad15c698d3dddb1e Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 31 Aug 2010 16:33:37 +0200 Subject: [PATCH] - fixed : Add to/Replace Outfit removes newly worn attachments on completion -> additional fix for http://jira.secondlife.com/browse/VWR-18512 -> moved to Appearance-Misc branch as well, we'll remove it from RLVa as soon as we make RLVa dependant on it --HG-- branch : RLVa --- indra/newview/llappearancemgr.cpp | 29 ++++++++++++++++++++++++++++- indra/newview/llappearancemgr.h | 26 ++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 81b893ef9a..c775a8668b 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1885,6 +1885,29 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) remove_non_link_items(obj_items); remove_non_link_items(gest_items); +// [RLVa:KB] - Checked: 2010-08-31 (RLVa-1.2.1c) | Added: RLVa-1.2.1c + // Include attachments which should be in COF but don't have their link created yet + if (isAgentAvatarValid()) + { + uuid_vec_t::iterator itPendingObjLink = mPendingObjLinks.begin(); + while (itPendingObjLink != mPendingObjLinks.end()) + { + const LLUUID& idItem = *itPendingObjLink; + if (!gAgentAvatarp->isWearingAttachment(idItem)) + { + mPendingObjLinks.erase(itPendingObjLink++); + continue; + } + + LLViewerInventoryItem* pItem = gInventory.getItem(idItem); + if (pItem) + obj_items.push_back(pItem); + + ++itPendingObjLink; + } + } +// [/RLVa:KB] + dumpItemArray(wear_items,"asset_dump: wear_item"); dumpItemArray(obj_items,"asset_dump: obj_item"); @@ -2906,7 +2929,11 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) // we have to pass do_update = true to call LLAppearanceMgr::updateAppearanceFromCOF. // it will trigger gAgentWariables.notifyLoadingFinished() // But it is not acceptable solution. See EXT-7777 - LLAppearanceMgr::addCOFItemLink(item_id, false); // Add COF link for item. +// LLAppearanceMgr::addCOFItemLink(item_id, false); // Add COF link for item. +// [RLVa:KB] - Checked: 2010-08-31 (RLVa-1.2.1c) | Added: RLVa-1.2.1c + mPendingObjLinks.push_back(item_id); + LLAppearanceMgr::addCOFItemLink(item_id, false, new LLRegisterAttachmentCallback()); // Add COF link for item. +// [/RLVa:KB] } else { diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index bf95ec88a8..78abe5a0cc 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -224,6 +224,19 @@ private: std::auto_ptr mUnlockOutfitTimer; +// [RLVa:KB] - Checked: 2010-08-31 (RLVa-1.2.1c) | Added: RLVa-1.2.1c +public: + void onRegisterAttachmentComplete(const LLUUID& idItem) + { + const LLUUID& idItemBase = gInventory.getLinkedItemID(idItem); + uuid_vec_t::const_iterator itPendingObjLink = std::find(mPendingObjLinks.begin(), mPendingObjLinks.end(), idItemBase); + if (itPendingObjLink != mPendingObjLinks.end()) + mPendingObjLinks.erase(itPendingObjLink); + } +private: + uuid_vec_t mPendingObjLinks; +// [/RLVa:KB] + ////////////////////////////////////////////////////////////////////////////////// // Item-specific convenience functions public: @@ -250,6 +263,19 @@ private: bool mUpdateBaseOrder; }; +// [RLVa:KB] - Checked: 2010-08-31 (RLVa-1.2.1c) | Added: RLVa-1.2.1c +class LLRegisterAttachmentCallback : public LLInventoryCallback +{ +public: + LLRegisterAttachmentCallback() {} + /*virtual*/ ~LLRegisterAttachmentCallback() {} + + /*virtual*/ void fire(const LLUUID& idItem) + { + LLAppearanceMgr::instance().onRegisterAttachmentComplete(idItem); + } +}; +// [/RLVa:KB] #define SUPPORT_ENSEMBLES 0