diff --git a/.hgpatchinfo/Appearance-Misc.dep b/.hgpatchinfo/Appearance-Misc.dep new file mode 100644 index 0000000000000000000000000000000000000000..c35c8183622b3f77c100d8413991cd2be6a6cd5e --- /dev/null +++ b/.hgpatchinfo/Appearance-Misc.dep @@ -0,0 +1 @@ +0b89ef4d64f98ddbaae83b280cf60934e0690dad \ No newline at end of file diff --git a/.hgpatchinfo/Appearance-Misc.desc b/.hgpatchinfo/Appearance-Misc.desc new file mode 100644 index 0000000000000000000000000000000000000000..dbc5fa8caeaf73ee365768dd5fde89ee0191bd90 --- /dev/null +++ b/.hgpatchinfo/Appearance-Misc.desc @@ -0,0 +1,21 @@ +[Appearance/Misc] +- fixed : LLAppearanceMgr::filterWearableItems() doesn't properly filter body parts +- fixed : LLWearableList::processGetAssetReply() creates multiple LLWearable instances for the same asset UUID + -> fix for http://jira.secondlife.com/browse/VWR-20608 +- fixed : attachments sometimes detach only to instantly get reattached after logon +- fixed : Add to/Replace Outfit removes newly worn attachments on completion + -> fix for http://jira.secondlife.com/browse/VWR-18512 +- fixed : attachments that attach and then instantly detach don't have their COF link removed +- fixed : multiple LLWearableHoldingPattern instances lead to "COF corruption" +- fixed : get_is_item_worn() shouldn't make the assumption that items in COFs are always worn +- fixed : drag-and-drop wear behaviour of an attachment onto self isn't consistant with the drag-and-drop behaviour of wearables + -> normal-drop : replace wear + -> Ctrl-drop : add wear +- fixed : LLAppearanceMgr::registerAttachment() fails to (re)add a link for worn attachments that aren't linked to in COF at log-on +- fixed : LLViewerObject::getAttachmentItemID() sometimes returns the NULL UUID for the avatar's own attachments +- fixed : LLAppearanceMgr::updateAppearanceFromCOF() doesn't properly filter items collected from folder links + -> create an outfit with a folder link + "Replace Outfit" == wearables that exist in both COF and the linked folder will end up worn multiple times +- changed : enable "Replace Current Outfit" on the base outfit if it's marked dirty +- changed : "RenderUnloadedAvatar" no longer affects the user's own avatar + -> side-effect of the fix above due to the change to LLVOAvatar::isFullyLoaded() +- added : InitialWearablesLoadedSignal signal which is emitted *once* when the initial wearables are loaded diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index 618e2a1941bc8768765a0d91c61159bf87fd0e02..65afb0addec66dcad0294b77bcef6d41bce2a042 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -92,7 +92,10 @@ LLWearableDictionary::LLWearableDictionary() addEntry(LLWearableType::WT_ALPHA, new WearableEntry("alpha", "New Alpha", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_ALPHA, FALSE, TRUE)); addEntry(LLWearableType::WT_TATTOO, new WearableEntry("tattoo", "New Tattoo", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_TATTOO, FALSE, TRUE)); - addEntry(LLWearableType::WT_PHYSICS, new WearableEntry("physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, TRUE)); +// addEntry(LLWearableType::WT_PHYSICS, new WearableEntry("physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, TRUE)); +// [SL:KB] - Patch: Appearance-Misc | Checked: 2011-05-29 (Catznip-2.6) + addEntry(LLWearableType::WT_PHYSICS, new WearableEntry("physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, FALSE)); +// [/SL:KB] addEntry(LLWearableType::WT_INVALID, new WearableEntry("invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, FALSE, FALSE)); addEntry(LLWearableType::WT_NONE, new WearableEntry("none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, FALSE, FALSE)); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 1edbbe2a2e8cf4ca6f49a7a817b99796fc5d7f96..9c749d49d590db490d00c12f5d683feeb712f931 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -55,6 +55,9 @@ LLAgentWearables gAgentWearables; BOOL LLAgentWearables::mInitialWearablesUpdateReceived = FALSE; +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1) +bool LLAgentWearables::mInitialWearablesLoaded = false; +// [/SL:KB] using namespace LLAvatarAppearanceDefines; @@ -1305,6 +1308,13 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; checkWearablesLoaded(); +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-09-22 (Catznip-2.2) + if (!mInitialWearablesLoaded) + { + mInitialWearablesLoaded = true; + mInitialWearablesLoadedSignal(); + } +// [/SL:KB] notifyLoadingFinished(); queryWearableCache(); updateServer(); @@ -1526,7 +1536,10 @@ void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &ty // Combines userRemoveMulipleAttachments() and userAttachMultipleAttachments() logic to // get attachments into desired state with minimal number of adds/removes. -void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array) +//void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array) +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2) +void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array, bool attach_only) +// [/SL:KB] { // Possible cases: // already wearing but not in request set -> take off. @@ -1591,7 +1604,13 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj // llinfos << "remove " << remove_count << " add " << add_count << llendl; // Remove everything in objects_to_remove - userRemoveMultipleAttachments(objects_to_remove); +// userRemoveMultipleAttachments(objects_to_remove); +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2) + if (!attach_only) + { + userRemoveMultipleAttachments(objects_to_remove); + } +// [/SL:KB] // Add everything in items_to_add userAttachMultipleAttachments(items_to_add); @@ -1893,6 +1912,13 @@ bool LLAgentWearables::changeInProgress() const return mCOFChangeInProgress; } +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1) +boost::signals2::connection LLAgentWearables::addInitialWearablesLoadedCallback(loaded_callback_t cb) +{ + return mInitialWearablesLoadedSignal.connect(cb); +} +// [/SL:KB] + void LLAgentWearables::notifyLoadingStarted() { mCOFChangeInProgress = true; diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 5be4648636792a5c883750c57b635b1ea5abb46a..2b2a16799508d2ee21c63a867f1c08a9ced45b70 100755 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -76,6 +76,9 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable BOOL isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const; BOOL areWearablesLoaded() const; +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1) + bool areInitalWearablesLoaded() const { return mInitialWearablesLoaded; } +// [/SL:KB] bool isCOFChangeInProgress() const { return mCOFChangeInProgress; } void updateWearablesLoaded(); void checkWearablesLoaded() const; @@ -198,7 +201,11 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable typedef std::vector<LLViewerObject*> llvo_vec_t; - static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array); +// static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array); +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2) + // Not the best way to go about this but other attempts changed far too much LL code to be a viable solution + static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array, bool attach_only = false); +// [/SL:KB] static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array); static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array); @@ -216,6 +223,9 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable typedef boost::function<void()> loaded_callback_t; typedef boost::signals2::signal<void()> loaded_signal_t; boost::signals2::connection addLoadedCallback(loaded_callback_t cb); +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1) + boost::signals2::connection addInitialWearablesLoadedCallback(loaded_callback_t cb); +// [/SL:KB] bool changeInProgress() const; void notifyLoadingStarted(); @@ -224,12 +234,18 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable private: loading_started_signal_t mLoadingStartedSignal; // should be called before wearables are changed loaded_signal_t mLoadedSignal; // emitted when all agent wearables get loaded +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1) + loaded_signal_t mInitialWearablesLoadedSignal; // emitted once when the initial wearables are loaded +// [/SL:KB] //-------------------------------------------------------------------- // Member variables //-------------------------------------------------------------------- private: static BOOL mInitialWearablesUpdateReceived; +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.2) + static bool mInitialWearablesLoaded; +// [/SL:KB] BOOL mWearablesLoaded; std::set<LLUUID> mItemsAwaitingWearableUpdate; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fd9236c8b384cf6403edb779c320396cc1a80e04..f10a44e8ebbca29ab478494b4bce4990270de93c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -584,11 +584,15 @@ class LLWearableHoldingPattern void onWearableAssetFetch(LLViewerWearable *wearable); void onAllComplete(); +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) + bool pollStopped(); +// [/SL:KB] + typedef std::list<LLFoundData> found_list_t; found_list_t& getFoundList(); void eraseTypeToLink(LLWearableType::EType type); void eraseTypeToRecover(LLWearableType::EType type); - void setObjItems(const LLInventoryModel::item_array_t& items); +// void setObjItems(const LLInventoryModel::item_array_t& items); void setGestItems(const LLInventoryModel::item_array_t& items); bool isMostRecent(); void handleLateArrivals(); @@ -596,7 +600,7 @@ class LLWearableHoldingPattern private: found_list_t mFoundList; - LLInventoryModel::item_array_t mObjItems; +// LLInventoryModel::item_array_t mObjItems; LLInventoryModel::item_array_t mGestItems; typedef std::set<S32> type_set_t; type_set_t mTypesToRecover; @@ -667,10 +671,11 @@ void LLWearableHoldingPattern::eraseTypeToRecover(LLWearableType::EType type) mTypesToRecover.erase(type); } -void LLWearableHoldingPattern::setObjItems(const LLInventoryModel::item_array_t& items) -{ - mObjItems = items; -} +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-06-19 (Catznip-2.1) +//void LLWearableHoldingPattern::setObjItems(const LLInventoryModel::item_array_t& items) +//{ +// mObjItems = items; +//} void LLWearableHoldingPattern::setGestItems(const LLInventoryModel::item_array_t& items) { @@ -776,12 +781,14 @@ void LLWearableHoldingPattern::onAllComplete() LL_INFOS("Avatar") << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; LLAppearanceMgr::instance().updateAgentWearables(this, false); - // Update attachments to match those requested. - if (isAgentAvatarValid()) - { - LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL; - LLAgentWearables::userUpdateAttachments(mObjItems); - } +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.1) +// // Update attachments to match those requested. +// if (isAgentAvatarValid()) +// { +// LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL; +// llinfos << "Updating " << mObjItems.count() << " attachments" << llendl; +// LLAgentWearables::userUpdateAttachments(mObjItems); +// } if (isFetchCompleted() && isMissingCompleted()) { @@ -815,6 +822,12 @@ bool LLWearableHoldingPattern::pollFetchCompletion() { // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) + // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves + doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollStopped, this)); + return true; +// [/SL:KB] } bool completed = isFetchCompleted(); @@ -885,6 +898,11 @@ void recovered_item_cb(const LLUUID& item_id, LLWearableType::EType type, LLView { // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) + // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves + return; +// [/SL:KB] } LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << type << LL_ENDL; @@ -955,12 +973,31 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() } } +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) +bool LLWearableHoldingPattern::pollStopped() +{ + // We have to keep on polling until we're sure that all callbacks have completed or they'll cause a crash + if ( (isFetchCompleted()) && (isMissingCompleted()) ) + { + delete this; + return true; + } + return false; +} +// [/SL:KB] + bool LLWearableHoldingPattern::pollMissingWearables() { if (!isMostRecent()) { // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) + // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves + doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollStopped, this)); + return true; +// [/SL:KB] } bool timed_out = isTimedOut(); @@ -1621,7 +1658,10 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) } // Check whether it's the base outfit. - if (outfit_cat_id.isNull() || outfit_cat_id == getBaseOutfitUUID()) +// if (outfit_cat_id.isNull() || outfit_cat_id == getBaseOutfitUUID()) +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-21 (Catznip-2.1) + if ( (outfit_cat_id.isNull()) || ((outfit_cat_id == getBaseOutfitUUID()) && (!isOutfitDirty())) ) +// [/SL:KB] { return false; } @@ -1705,7 +1745,10 @@ void LLAppearanceMgr::filterWearableItems( S32 size = items_by_type[i].size(); if (size <= 0) continue; - S32 start_index = llmax(0,size-max_per_type); +// S32 start_index = llmax(0,size-max_per_type); +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-05-11 (Catznip-2.0) + S32 start_index = llmax(0, size - ((LLAssetType::AT_BODYPART == LLWearableType::getAssetType((LLWearableType::EType)i)) ? 1 : max_per_type)); +// [/SL:KB[ for (S32 j = start_index; j<size; j++) { items.push_back(items_by_type[i][j]); @@ -2032,10 +2075,47 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) remove_non_link_items(wear_items); remove_non_link_items(obj_items); remove_non_link_items(gest_items); +// [SL:KB] - Patch: Apperance-Misc | Checked: 2010-11-24 (Catznip-2.4) + // Since we're following folder links we might have picked up new duplicates, or exceeded MAX_CLOTHING_PER_TYPE + removeDuplicateItems(wear_items); + removeDuplicateItems(obj_items); + removeDuplicateItems(gest_items); + filterWearableItems(wear_items, LLAgentWearables::MAX_CLOTHING_PER_TYPE); +// [/SL:KB] dumpItemArray(wear_items,"asset_dump: wear_item"); dumpItemArray(obj_items,"asset_dump: obj_item"); +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2) + // Update attachments to match those requested. + if (isAgentAvatarValid()) + { + // Include attachments which should be in COF but don't have their link created yet + uuid_vec_t::iterator itPendingAttachLink = mPendingAttachLinks.begin(); + while (itPendingAttachLink != mPendingAttachLinks.end()) + { + const LLUUID& idItem = *itPendingAttachLink; + if ( (!gAgentAvatarp->isWearingAttachment(idItem)) || (isLinkInCOF(idItem)) ) + { + itPendingAttachLink = mPendingAttachLinks.erase(itPendingAttachLink); + continue; + } + + LLViewerInventoryItem* pItem = gInventory.getItem(idItem); + if (pItem) + { + obj_items.push_back(pItem); + } + + ++itPendingAttachLink; + } + + // Don't remove attachments until avatar is fully loaded (should reduce random attaching/detaching/reattaching at log-on) + LL_DEBUGS("Avatar") << self_av_string() << "Updating " << obj_items.count() << " attachments" << LL_ENDL; + LLAgentWearables::userUpdateAttachments(obj_items, !gAgentAvatarp->isFullyLoaded()); + } +// [/SL:KB] + if(!wear_items.count()) { LLNotificationsUtil::add("CouldNotPutOnOutfit"); @@ -2048,7 +2128,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) LLWearableHoldingPattern* holder = new LLWearableHoldingPattern; - holder->setObjItems(obj_items); +// holder->setObjItems(obj_items); holder->setGestItems(gest_items); // Note: can't do normal iteration, because if all the @@ -3558,6 +3638,12 @@ void LLAppearanceMgr::setAttachmentInvLinkEnable(bool val) { LL_DEBUGS("Avatar") << "setAttachmentInvLinkEnable => " << (int) val << llendl; mAttachmentInvLinkEnabled = val; +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.2) + if (mAttachmentInvLinkEnabled) + { + linkPendingAttachments(); + } +// [/SL:KB] } void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg) @@ -3580,13 +3666,24 @@ void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg) void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) { gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.2) + if (isLinkInCOF(item_id)) + { + return; + } + mPendingAttachLinks.push_back(item_id); +// [/SL:KB] if (mAttachmentInvLinkEnabled) { // 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. +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.2) + LLPointer<LLInventoryCallback> cb = new LLRegisterAttachmentCallback(); + LLAppearanceMgr::addCOFItemLink(item_id, false, cb); // Add COF link for item. +// [/SL:KB] } else { @@ -3597,6 +3694,13 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) { gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.2) + uuid_vec_t::iterator itPendingAttachLink = std::find(mPendingAttachLinks.begin(), mPendingAttachLinks.end(), item_id); + if (itPendingAttachLink != mPendingAttachLinks.end()) + { + mPendingAttachLinks.erase(itPendingAttachLink); + } +// [/SL:KB] if (mAttachmentInvLinkEnabled) { @@ -3608,6 +3712,44 @@ void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) } } +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.2) +void LLAppearanceMgr::linkPendingAttachments() +{ + LLPointer<LLInventoryCallback> cb = NULL; + for (uuid_vec_t::const_iterator itPendingAttachLink = mPendingAttachLinks.begin(); + itPendingAttachLink != mPendingAttachLinks.end(); ++itPendingAttachLink) + { + const LLUUID& idAttachItem = *itPendingAttachLink; + if ( (gAgentAvatarp->isWearingAttachment(idAttachItem)) && (!isLinkInCOF(idAttachItem)) ) + { + if (!cb) + { + cb = new LLRegisterAttachmentCallback(); + } + LLAppearanceMgr::addCOFItemLink(idAttachItem, false, cb); + } + } +} + +void LLAppearanceMgr::onRegisterAttachmentComplete(const LLUUID& idItem) +{ + const LLUUID& idItemBase = gInventory.getLinkedItemID(idItem); + + // Remove the attachment from the pending list + uuid_vec_t::iterator itPendingAttachLink = std::find(mPendingAttachLinks.begin(), mPendingAttachLinks.end(), idItemBase); + if (itPendingAttachLink != mPendingAttachLinks.end()) + { + mPendingAttachLinks.erase(itPendingAttachLink); + } + + // It may have been detached already in which case we should remove the COF link + if ( (isAgentAvatarValid()) && (!gAgentAvatarp->isWearingAttachment(idItemBase)) ) + { + removeCOFItemLinks(idItemBase); + } +} +// [/SL:KB] + BOOL LLAppearanceMgr::getIsInCOF(const LLUUID& obj_id) const { return gInventory.isObjectDescendentOf(obj_id, getCOF()); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 46252afbde14799662de45582dbf63150c1f819d..0251153d9e44f701e33273b21188a29101d76de0 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -239,6 +239,14 @@ class LLAppearanceMgr: public LLSingleton<LLAppearanceMgr> std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer; +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.1) +public: + void linkPendingAttachments(); + void onRegisterAttachmentComplete(const LLUUID& idItem); +private: + uuid_vec_t mPendingAttachLinks; +// [/SL:KB] + ////////////////////////////////////////////////////////////////////////////////// // Item-specific convenience functions public: @@ -265,6 +273,16 @@ class LLUpdateAppearanceOnDestroy: public LLInventoryCallback bool mUpdateBaseOrder; }; +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.1) +class LLRegisterAttachmentCallback : public LLInventoryCallback +{ +public: + /*virtual*/ void fire(const LLUUID& idItem) + { + LLAppearanceMgr::instance().onRegisterAttachmentComplete(idItem); + } +}; +// [/SL:KB] #define SUPPORT_ENSEMBLES 0 diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 80ef506272c31337945466c4433ec18d9cf42929..44b387cd5d852072184d10dd2e615fb3b31ac74d 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3524,6 +3524,9 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& // BAP change once we're no longer treating regular categories as ensembles. const bool is_ensemble = (type == LLFolderType::FT_NONE || LLFolderType::lookupIsEnsembleType(type)); +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-11-24 (Catznip-2.4) + const bool is_outfit = (type == LLFolderType::FT_OUTFIT); +// [/SL:KB] // Only enable calling-card related options for non-system folders. if (!is_system_folder) @@ -3582,7 +3585,11 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& { disabled_items.push_back(std::string("Remove From Outfit")); } - if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) +// if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-11-24 (Catznip-2.4) + if ( ((is_outfit) && (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID))) || + ((!is_outfit) && (gAgentWearables.isCOFChangeInProgress())) ) +// [/SL:KB] { disabled_items.push_back(std::string("Replace Outfit")); } @@ -5246,7 +5253,11 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) else if(item && item->isFinished()) { // must be in library. copy it to our inventory and put it on. - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0)); +// LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0)); +// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2013-02-04 (Catznip-3.4) + // "Wear" from inventory replaces, so library items should too + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0, true)); +// [/SL;KB] copy_inventory_item( gAgent.getID(), item->getPermissions().getOwner(), @@ -5765,56 +5776,56 @@ void LLWearableBridge::wearAddOnAvatar() } // static -void LLWearableBridge::onWearOnAvatarArrived( LLViewerWearable* wearable, void* userdata ) -{ - LLUUID* item_id = (LLUUID*) userdata; - if(wearable) - { - LLViewerInventoryItem* item = NULL; - item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); - if(item) - { - if(item->getAssetUUID() == wearable->getAssetID()) - { - gAgentWearables.setWearableItem(item, wearable); - gInventory.notifyObservers(); - //self->getFolderItem()->refreshFromRoot(); - } - else - { - llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; - } - } - } - delete item_id; -} +//void LLWearableBridge::onWearOnAvatarArrived( LLViewerWearable* wearable, void* userdata ) +//{ +// LLUUID* item_id = (LLUUID*) userdata; +// if(wearable) +// { +// LLViewerInventoryItem* item = NULL; +// item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); +// if(item) +// { +// if(item->getAssetUUID() == wearable->getAssetID()) +// { +// gAgentWearables.setWearableItem(item, wearable); +// gInventory.notifyObservers(); +// //self->getFolderItem()->refreshFromRoot(); +// } +// else +// { +// llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; +// } +// } +// } +// delete item_id; +//} // static // BAP remove the "add" code path once everything is fully COF-ified. -void LLWearableBridge::onWearAddOnAvatarArrived( LLViewerWearable* wearable, void* userdata ) -{ - LLUUID* item_id = (LLUUID*) userdata; - if(wearable) - { - LLViewerInventoryItem* item = NULL; - item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); - if(item) - { - if(item->getAssetUUID() == wearable->getAssetID()) - { - bool do_append = true; - gAgentWearables.setWearableItem(item, wearable, do_append); - gInventory.notifyObservers(); - //self->getFolderItem()->refreshFromRoot(); - } - else - { - llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; - } - } - } - delete item_id; -} +//void LLWearableBridge::onWearAddOnAvatarArrived( LLViewerWearable* wearable, void* userdata ) +//{ +// LLUUID* item_id = (LLUUID*) userdata; +// if(wearable) +// { +// LLViewerInventoryItem* item = NULL; +// item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); +// if(item) +// { +// if(item->getAssetUUID() == wearable->getAssetID()) +// { +// bool do_append = true; +// gAgentWearables.setWearableItem(item, wearable, do_append); +// gInventory.notifyObservers(); +// //self->getFolderItem()->refreshFromRoot(); +// } +// else +// { +// llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; +// } +// } +// } +// delete item_id; +//} // static BOOL LLWearableBridge::canEditOnAvatar(void* user_data) diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 517153e1710c440955989e411b3e7ac3d75bcec4..59cdf938c993dca1604b109d6dcda634fbdd1d48 100755 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -509,10 +509,10 @@ class LLWearableBridge : public LLItemBridge static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu static BOOL canWearOnAvatar( void* userdata ); - static void onWearOnAvatarArrived( LLViewerWearable* wearable, void* userdata ); +// static void onWearOnAvatarArrived( LLViewerWearable* wearable, void* userdata ); void wearOnAvatar(); - static void onWearAddOnAvatarArrived( LLViewerWearable* wearable, void* userdata ); +// static void onWearAddOnAvatarArrived( LLViewerWearable* wearable, void* userdata ); void wearAddOnAvatar(); static BOOL canEditOnAvatar( void* userdata ); // Access to editOnAvatar() from menu diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f1a4889f5ac141728fb2b565b31383207ede20c2..c1314f6505b9d66741d814006549c6fba6fdda23 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -233,10 +233,11 @@ BOOL get_is_item_worn(const LLUUID& id) return FALSE; // Consider the item as worn if it has links in COF. - if (LLAppearanceMgr::instance().isLinkInCOF(id)) - { - return TRUE; - } +// [SL:KB] - The code below causes problems across the board so it really just needs to go +// if (LLAppearanceMgr::instance().isLinkInCOF(id)) +// { +// return TRUE; +// } switch(item->getType()) { diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index ef7d0cd81bb13dfd514bc3a526d83c0a38156a45..8bf021b0b269b9090df7155da319487a81d3006a 100755 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1786,7 +1786,11 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( { if(mSource == SOURCE_LIBRARY) { - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0)); +// LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0)); +// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-2.2) + // Make this behave consistent with dad3dWearItem + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0, !(mask & MASK_CONTROL))); +// [/SL:KB] copy_inventory_item( gAgent.getID(), item->getPermissions().getOwner(), @@ -1797,7 +1801,11 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( } else { - rez_attachment(item, 0); +// rez_attachment(item, 0); +// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-2.2) + // Make this behave consistent with dad3dWearItem + rez_attachment(item, 0, !(mask & MASK_CONTROL)); +// [/SL:KB] } } return ACCEPT_YES_SINGLE; diff --git a/indra/newview/llviewerattachmenu.cpp b/indra/newview/llviewerattachmenu.cpp index 3975292ed3a6e7871384b9d21cebbfbf39876008..2d015fc8c1f4b681708ba1828a67e6ea1705ddb2 100755 --- a/indra/newview/llviewerattachmenu.cpp +++ b/indra/newview/llviewerattachmenu.cpp @@ -121,7 +121,10 @@ void LLViewerAttachMenu::attachObjects(const uuid_vec_t& items, const std::strin else if(item && item->isFinished()) { // must be in library. copy it to our inventory and put it on. - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp)); +// LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp)); +// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2013-02-04 (Catznip-3.4) + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp, false)); +// [/SL;KB] copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(), diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index fff9821e86d0efa81fc939cd278529443f4be0b7..b45a00e92a08374e6a72972d92e79c8c982ccb33 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -964,7 +964,10 @@ void LLInventoryCallbackManager::fire(U32 callback_id, const LLUUID& item_id) } } -void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp) +//void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp) +// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-3.4) +void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp, bool replace) +// [/SL:KB] { if (inv_item.isNull()) return; @@ -972,7 +975,10 @@ void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachme LLViewerInventoryItem *item = gInventory.getItem(inv_item); if (item) { - rez_attachment(item, attachmentp); +// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-3.4) + rez_attachment(item, attachmentp, replace); +// [/SL:KB] +// rez_attachment(item, attachmentp); } } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index ab19a12014f7948484c0c5f298facc4f2e28352f..6e8aeec2568e4bb91f36fe03b87053833810cd85 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -245,7 +245,10 @@ class LLInventoryCallback : public LLRefCount class LLViewerJointAttachment; -void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp); +// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-3.4) +void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp, bool replace); +// [/SL:KB] +//void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp); void activate_gesture_cb(const LLUUID& inv_item); diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index 3a04bbed4f9d0209113b0ce3adb2a04cc40e00a3..66a69127211436e3a44e0bd052560bf16477e775 100755 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -166,7 +166,7 @@ void LLViewerJointAttachment::setupDrawable(LLViewerObject *object) //----------------------------------------------------------------------------- BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) { - object->extractAttachmentItemID(); +// object->extractAttachmentItemID(); // Same object reattached if (isObjectAttached(object)) @@ -177,6 +177,11 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) // re-connect object to the joint correctly } +// [SL:KB] - Patch: Appearance-Misc | Checked: 2011-01-13 (Catznip-2.4) + // LLViewerJointAttachment::removeObject() sets the object's item to the NULL UUID so we need to extract it *after* the block above + object->extractAttachmentItemID(); +// [/SL:KB] + // Two instances of the same inventory item attached -- // Request detach, and kill the object in the meantime. if (getAttachedObject(object->getAttachmentItemID())) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fe035a0a7f9374644164491d180e624d4546230b..4b4412d64b35ffbc46786a044f39a8e1fb4a6075 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6258,7 +6258,11 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) BOOL LLVOAvatar::isFullyLoaded() const { - return (mRenderUnloadedAvatar || mFullyLoaded); +// return (mRenderUnloadedAvatar || mFullyLoaded); +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2) + // Changes to LLAppearanceMgr::updateAppearanceFromCOF() expect this function to actually return mFullyLoaded for gAgentAvatarp + return (mRenderUnloadedAvatar && !isSelf()) ||(mFullyLoaded); +// [/SL:KB] } bool LLVOAvatar::isTooComplex() const diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index ef1a953f59d5c2d7ec47115dd50edc17fd57e8a0..3eea3968bba440283a3e89ad49ef5d6d1bbe7085 100755 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -98,7 +98,23 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID { BOOL isNewWearable = FALSE; LLWearableArrivedData* data = (LLWearableArrivedData*) userdata; - LLViewerWearable* wearable = NULL; // NULL indicates failure +// LLViewerWearable* wearable = NULL; // NULL indicates failure +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-08-13 (Catznip-2.1) + LLViewerWearable* wearable = get_if_there(LLWearableList::instance().mList, uuid, (LLViewerWearable*)NULL); + if (wearable) + { + LL_DEBUGS("Wearable") << "processGetAssetReply()" << LL_ENDL; + LL_DEBUGS("Wearable") << wearable << LL_ENDL; + + if(data->mCallback) + { + data->mCallback(wearable, data->mUserdata); + } + delete data; + + return; + } +// [/SL:KB] LLAvatarAppearance *avatarp = data->mAvatarp; if( !filename )