From 894f649da792173ad456b3591dc8afe7a269cc78 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 28 Aug 2010 17:43:04 +0200 Subject: [PATCH 1/8] [Appearance/Misc] --HG-- branch : Appearance-Misc --- .hgpatchinfo/Appearance-Misc.dep | 1 + 1 file changed, 1 insertion(+) create mode 100644 .hgpatchinfo/Appearance-Misc.dep diff --git a/.hgpatchinfo/Appearance-Misc.dep b/.hgpatchinfo/Appearance-Misc.dep new file mode 100644 index 0000000000..1b77f49183 --- /dev/null +++ b/.hgpatchinfo/Appearance-Misc.dep @@ -0,0 +1 @@ +e7794a7b9728b07b5d3e1796dd578777396b21f4 \ No newline at end of file From baa6794d0ca6df87401fea55af7d5575051fc15a Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 28 Aug 2010 20:40:14 +0200 Subject: [PATCH 2/8] [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 - changed : deprecated removeItemFromAvatar() in favour of having LLAppearanceMgr::removeItemFromAvatar() handle it directly/correctly -> wearables can't be worn/removed in 2.X without the viewer already having an LLWearable instance for it anyway - added : InitialWearablesLoadedSignal signal which is emitted *once* when the initial wearables are loaded - fixed : attachments sometimes detach only to instantly get reattached after logon - added : LegacyMultiAttachmentSupport debug setting to route "secondary attachment points" to the primary attachment point -> maps secondary attachment point range [39,68] onto [1,30] -> only dislays "secondary attachment points" correctly for *other* avatars (by design) --HG-- branch : Appearance-Misc --- .hgpatchinfo/Appearance-Misc.desc | 11 ++++++++ indra/newview/app_settings/settings.xml | 11 ++++++++ indra/newview/llagentwearables.cpp | 17 +++++++++++++ indra/newview/llagentwearables.h | 12 +++++++++ indra/newview/llappearancemgr.cpp | 34 +++++++++++++++++++++---- indra/newview/llinventorybridge.cpp | 18 +++++++++++++ indra/newview/llinventorybridge.h | 8 +++--- indra/newview/llvoavatar.cpp | 8 +++++- indra/newview/llwearablelist.cpp | 14 ++++++++-- 9 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 .hgpatchinfo/Appearance-Misc.desc diff --git a/.hgpatchinfo/Appearance-Misc.desc b/.hgpatchinfo/Appearance-Misc.desc new file mode 100644 index 0000000000..73ba073384 --- /dev/null +++ b/.hgpatchinfo/Appearance-Misc.desc @@ -0,0 +1,11 @@ +[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 +- changed : deprecated removeItemFromAvatar() in favour of having LLAppearanceMgr::removeItemFromAvatar() handle it directly/correctly + -> wearables can't be worn/removed in 2.X without the viewer already having an LLWearable instance for it anyway +- added : InitialWearablesLoadedSignal signal which is emitted *once* when the initial wearables are loaded +- fixed : attachments sometimes detach only to instantly get reattached after logon +- added : LegacyMultiAttachmentSupport debug setting to route "secondary attachment points" to the primary attachment point + -> maps secondary attachment point range [39,68] onto [1,30] + -> only dislays "secondary attachment points" correctly for *other* avatars (by design) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 07418d1b5e..fce5c2ecce 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4394,6 +4394,17 @@ Value 0 + LegacyMultiAttachmentSupport + + Comment + Converts legacy "secondary attachment points" to multi-attachments for other avatars + Persist + 1 + Type + Boolean + Value + 0 + LimitDragDistance Comment diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 4c2caae2c6..d7d2cadfe6 100644 --- 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.2a) | Added: Catznip-2.1.1d +bool LLAgentWearables::mInitialWearablesLoaded = false; +// [/SL:KB] using namespace LLVOAvatarDefines; @@ -2097,9 +2100,23 @@ boost::signals2::connection LLAgentWearables::addLoadedCallback(loaded_callback_ return mLoadedSignal.connect(cb); } +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1.2a) | Added: Catznip-2.1.1d +boost::signals2::connection LLAgentWearables::addInitialWearablesLoadedCallback(loaded_callback_t cb) +{ + return mInitialWearablesLoadedSignal.connect(cb); +} +// [/SL:KB] + void LLAgentWearables::notifyLoadingStarted() { mCOFChangeInProgress = true; +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1.2a) | Added: Catznip-2.1.1d + if (!mInitialWearablesLoaded) + { + mInitialWearablesLoaded = true; + mInitialWearablesLoadedSignal(); + } +// [/SL:KB] mLoadingStartedSignal(); } diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index d7e77a5a5b..45829f2b66 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -76,6 +76,9 @@ public: BOOL isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const; BOOL areWearablesLoaded() const; +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1.2a) | Added: Catznip-2.1.1d + bool areInitalWearablesLoaded() const { return mInitialWearablesLoaded; } +// [/SL:KB] bool isCOFChangeInProgress() const { return mCOFChangeInProgress; } void updateWearablesLoaded(); void checkWearablesLoaded() const; @@ -234,6 +237,9 @@ public: typedef boost::function loaded_callback_t; typedef boost::signals2::signal loaded_signal_t; boost::signals2::connection addLoadedCallback(loaded_callback_t cb); +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1.2a) | Added: Catznip-2.1.1d + boost::signals2::connection addInitialWearablesLoadedCallback(loaded_callback_t cb); +// [/SL:KB] void notifyLoadingStarted(); void notifyLoadingFinished(); @@ -241,6 +247,9 @@ public: 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.2a) | Added: Catznip-2.1.1d + loaded_signal_t mInitialWearablesLoadedSignal; // emitted once when the initial wearables are loaded +// [/SL:KB] //-------------------------------------------------------------------- // Member variables @@ -251,6 +260,9 @@ private: wearableentry_map_t mWearableDatas; static BOOL mInitialWearablesUpdateReceived; +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.1.2a) | Added: Catznip-2.1.1d + static bool mInitialWearablesLoaded; +// [/SL:KB] BOOL mWearablesLoaded; std::set mItemsAwaitingWearableUpdate; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 94286fd799..80d260caba 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -458,7 +458,11 @@ void LLWearableHoldingPattern::onAllComplete() LLAppearanceMgr::instance().updateAgentWearables(this, false); // Update attachments to match those requested. - if (isAgentAvatarValid()) +// if (isAgentAvatarValid()) +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-08-14 (Catznip-2.1.2a) | Modified: Catznip-2.1.1d + // Don't update attachments until initial wearables have loaded (should reduce random attaching/detaching/reattaching at log-on) + if ( (isAgentAvatarValid()) && (gAgentWearables.areInitalWearablesLoaded()) ) +// [/SL:KB] { llinfos << "Updating " << mObjItems.count() << " attachments" << llendl; LLAgentWearables::userUpdateAttachments(mObjItems); @@ -1359,7 +1363,11 @@ 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.1.2a) | Added: Catznip-2.0.0h + 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; jgetType()) { case LLAssetType::AT_CLOTHING: - if (get_is_item_worn(id_to_remove)) +// 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); +// } +// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.1.2a) | Added: Catznip-2.1.1d { - //*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future - LLWearableBridge::removeItemFromAvatar(item_to_remove); + /*const*/ LLWearable* pWearable = gAgentWearables.getWearableFromItemID(item_to_remove->getLinkedUUID()); + if ( (pWearable) && (LLAssetType::AT_BODYPART != pWearable->getAssetType()) ) + { + U32 idxWearable = gAgentWearables.getWearableIndex(pWearable); + if (idxWearable < LLAgentWearables::MAX_CLOTHING_PER_TYPE) + { + gAgentWearables.removeWearable(pWearable->getType(), false, idxWearable); + + LLAppearanceMgr::instance().removeCOFItemLinks(item_to_remove->getLinkedUUID(), false); + gInventory.notifyObservers(); + } + } } +// [/SL:KB] break; case LLAssetType::AT_OBJECT: LLVOAvatarSelf::detachAttachmentIntoInventory(item_to_remove->getLinkedUUID()); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index aff0bc4099..81174730c7 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4316,11 +4316,16 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ continue; if (get_is_item_worn(item->getUUID())) { +/* LLWearableList::instance().getAsset(item->getAssetUUID(), item->getName(), item->getType(), LLWearableBridge::onRemoveFromAvatarArrived, new OnRemoveStruct(item->getLinkedUUID())); +*/ +// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.1.2a) | Added: Catznip-2.1.1d + LLAppearanceMgr::instance().removeItemFromAvatar(item->getUUID()); +// [/SL:KB] } } } @@ -4551,6 +4556,7 @@ void LLWearableBridge::wearAddOnAvatar() } // static +/* void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userdata ) { LLUUID* item_id = (LLUUID*) userdata; @@ -4574,9 +4580,11 @@ void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userda } delete item_id; } +*/ // static // BAP remove the "add" code path once everything is fully COF-ified. +/* void LLWearableBridge::onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata ) { LLUUID* item_id = (LLUUID*) userdata; @@ -4601,6 +4609,7 @@ void LLWearableBridge::onWearAddOnAvatarArrived( LLWearable* wearable, void* use } delete item_id; } +*/ // static BOOL LLWearableBridge::canEditOnAvatar(void* user_data) @@ -4638,6 +4647,7 @@ BOOL LLWearableBridge::canRemoveFromAvatar(void* user_data) } // static +/* void LLWearableBridge::onRemoveFromAvatar(void* user_data) { LLWearableBridge* self = (LLWearableBridge*)user_data; @@ -4656,8 +4666,10 @@ void LLWearableBridge::onRemoveFromAvatar(void* user_data) } } } +*/ // static +/* void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, void* userdata) { @@ -4685,6 +4697,7 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, delete on_remove_struct; } +*/ // static void LLWearableBridge::removeAllClothesFromAvatar() @@ -4721,11 +4734,16 @@ void LLWearableBridge::removeItemFromAvatar(LLViewerInventoryItem *item) { if (item) { +/* LLWearableList::instance().getAsset(item->getAssetUUID(), item->getName(), item->getType(), LLWearableBridge::onRemoveFromAvatarArrived, new OnRemoveStruct(item->getUUID())); +*/ +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-08-13 (Catznip-2.1.2a) | Added: Catznip-2.1.1d + LLAppearanceMgr::instance().removeItemFromAvatar(item->getUUID()); +// [/SL:KB] } } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 14abdd76b9..2e3535eea6 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -470,10 +470,10 @@ public: static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu static BOOL canWearOnAvatar( void* userdata ); - static void onWearOnAvatarArrived( LLWearable* wearable, void* userdata ); +// static void onWearOnAvatarArrived( LLWearable* wearable, void* userdata ); void wearOnAvatar(); - static void onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata ); +// static void onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata ); void wearAddOnAvatar(); static BOOL canEditOnAvatar( void* userdata ); // Access to editOnAvatar() from menu @@ -481,8 +481,8 @@ public: void editOnAvatar(); static BOOL canRemoveFromAvatar( void* userdata ); - static void onRemoveFromAvatar( void* userdata ); - static void onRemoveFromAvatarArrived( LLWearable* wearable, void* userdata ); +// static void onRemoveFromAvatar( void* userdata ); +// static void onRemoveFromAvatarArrived( LLWearable* wearable, void* userdata ); static void removeItemFromAvatar(LLViewerInventoryItem *item); static void removeAllClothesFromAvatar(); void removeFromAvatar(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9af1198df1..8b9a511f9d 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5585,7 +5585,13 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi if (!attachment) { llwarns << "Object attachment point invalid: " << attachmentID << llendl; - attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) +// attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) +// [SL:KB] - Patch: Appearance-LegacyMultiAttachment | Checked: 2010-08-28 (Catznip-2.1.2a) | Added: Catznip2.1.2a + S32 idxAttachPt = 1; + if ( (!isSelf()) && (gSavedSettings.getBOOL("LegacyMultiAttachmentSupport")) && (attachmentID > 38) && (attachmentID <= 68) ) + idxAttachPt = attachmentID - 38; + attachment = get_if_there(mAttachmentPoints, idxAttachPt, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) +// [/SL:KB] } return attachment; diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index ddbcdfc3f7..d88e7531fc 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -95,8 +95,18 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID { BOOL isNewWearable = FALSE; LLWearableArrivedData* data = (LLWearableArrivedData*) userdata; - LLWearable* wearable = NULL; // NULL indicates failure - +// LLWearable* wearable = NULL; // NULL indicates failure +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-08-13 (Catznip-2.1.2a) | Added: Catznip-2.1.1d + LLWearable* wearable = get_if_there(LLWearableList::instance().mList, uuid, (LLWearable*)NULL); + if (wearable) + { + if(data->mCallback) + data->mCallback(wearable, data->mUserdata); + delete data; + return; + } +// [/SL:KB] + if( !filename ) { LL_WARNS("Wearable") << "Bad Wearable Asset: missing file." << LL_ENDL; From 646926e00b6502de24584372827d274a6d5201b5 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 31 Aug 2010 16:30:14 +0200 Subject: [PATCH 3/8] [Appearance/Misc] - fixed : Add to/Replace Outfit removes newly worn attachments on completion -> (partial) fix for http://jira.secondlife.com/browse/VWR-18512 -> copies over from RLVa since it's really just a viewer (appearance) bug --HG-- branch : Appearance-Misc --- indra/newview/llappearancemgr.cpp | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 80d260caba..191bf85cef 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -291,8 +291,13 @@ public: private: found_list_t mFoundList; +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.1.2a) | Added: Catznip-2.1.2a + // Fix for http://jira.secondlife.com/browse/VWR-18512 +/* LLInventoryModel::item_array_t mObjItems; LLInventoryModel::item_array_t mGestItems; +*/ +// [/SL:KB] typedef std::set type_set_t; type_set_t mTypesToRecover; type_set_t mTypesToLink; @@ -357,6 +362,9 @@ void LLWearableHoldingPattern::eraseTypeToRecover(LLWearableType::EType type) mTypesToRecover.erase(type); } +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-06-19 (Catznip-2.1.2a) | Added: Catznip-2.1.2a +// Fix for http://jira.secondlife.com/browse/VWR-18512 +/* void LLWearableHoldingPattern::setObjItems(const LLInventoryModel::item_array_t& items) { mObjItems = items; @@ -366,6 +374,8 @@ void LLWearableHoldingPattern::setGestItems(const LLInventoryModel::item_array_t { mGestItems = items; } +*/ +// [/SL:KB] bool LLWearableHoldingPattern::isFetchCompleted() { @@ -435,6 +445,9 @@ void LLWearableHoldingPattern::onAllComplete() } // Activate all gestures in this folder +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.1.2a) | Added: Catznip-2.1.2a + // Fix for http://jira.secondlife.com/browse/VWR-18512 +/* if (mGestItems.count() > 0) { llinfos << "Activating " << mGestItems.count() << " gestures" << llendl; @@ -452,11 +465,16 @@ void LLWearableHoldingPattern::onAllComplete() gInventory.notifyObservers(); } } +*/ +// [/SL:KB] // Update wearables. llinfos << "Updating agent wearables with " << mResolved << " wearable items " << llendl; LLAppearanceMgr::instance().updateAgentWearables(this, false); +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.1.2a) | Added: Catznip-2.1.2a + // Fix for http://jira.secondlife.com/browse/VWR-18512 +/* // Update attachments to match those requested. // if (isAgentAvatarValid()) // [SL:KB] - Patch: Appearance-Misc | Checked: 2010-08-14 (Catznip-2.1.2a) | Modified: Catznip-2.1.1d @@ -467,6 +485,8 @@ void LLWearableHoldingPattern::onAllComplete() llinfos << "Updating " << mObjItems.count() << " attachments" << llendl; LLAgentWearables::userUpdateAttachments(mObjItems); } +*/ +// [/SL:KB] if (isFetchCompleted() && isMissingCompleted()) { @@ -1708,11 +1728,49 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) //preparing the list of wearables in the correct order for LLAgentWearables sortItemsByActualDescription(wear_items); +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.1.2a) | Added: Catznip-2.1.2a + // Fix for http://jira.secondlife.com/browse/VWR-18512 [code below copied from LLWearableHoldingPattern::pollCompletion()] + + // Activate all gestures in this folder + if (gest_items.count() > 0) + { + llinfos << "Activating " << gest_items.count() << " gestures" << llendl; + + LLGestureMgr::instance().activateGestures(gest_items); + + // Update the inventory item labels to reflect the fact + // they are active. + LLViewerInventoryCategory* catp = + gInventory.getCategory(LLAppearanceMgr::instance().getCOF()); + + if (catp) + { + gInventory.updateCategory(catp); + gInventory.notifyObservers(); + } + } + + // Update attachments to match those requested. +// if (isAgentAvatarValid()) +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-08-14 (Catznip-2.1.2a) | Modified: Catznip-2.1.1d + // Don't update attachments until initial wearables have loaded (should reduce random attaching/detaching/reattaching at log-on) + if ( (isAgentAvatarValid()) && (gAgentWearables.areInitalWearablesLoaded()) ) +// [/SL:KB] + { + llinfos << "Updating " << obj_items.count() << " attachments" << llendl; + LLAgentWearables::userUpdateAttachments(obj_items); + } +// [/SL:KB] LLWearableHoldingPattern* holder = new LLWearableHoldingPattern; +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.1.2a) | Added: Catznip-2.1.2a + // Fix for http://jira.secondlife.com/browse/VWR-18512 +/* holder->setObjItems(obj_items); holder->setGestItems(gest_items); +*/ +// [/SL:KB] // Note: can't do normal iteration, because if all the // wearables can be resolved immediately, then the From 0477d49012822b14bd55c049a5bacd79346c87d8 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 31 Aug 2010 16:37:24 +0200 Subject: [PATCH 4/8] [Appearance/Misc] - fixed : Add to/Replace Outfit removes newly worn attachments on completion -> additional fix for http://jira.secondlife.com/browse/VWR-18512 -> copied over from RLVa since it's really just a viewer (appearance) bug --HG-- branch : Appearance-Misc --- 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 191bf85cef..4d01bf2c86 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1716,6 +1716,29 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) remove_non_link_items(obj_items); remove_non_link_items(gest_items); +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.1.2a) | Added: Catznip-2.1.2a + // 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; + } + } +// [/SL:KB] + dumpItemArray(wear_items,"asset_dump: wear_item"); dumpItemArray(obj_items,"asset_dump: obj_item"); @@ -2758,7 +2781,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. +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.1.2a) | Added: Catznip-2.1.2a + mPendingObjLinks.push_back(item_id); + LLAppearanceMgr::addCOFItemLink(item_id, false, new LLRegisterAttachmentCallback()); // Add COF link for item. +// [/SL:KB] } else { diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 78c2142ea5..8f573441a1 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -215,6 +215,19 @@ private: std::auto_ptr mUnlockOutfitTimer; +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.1.2a) | Added: Catznip-2.1.2a +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; +// [/SL:KB] + ////////////////////////////////////////////////////////////////////////////////// // Item-specific convenience functions public: @@ -241,6 +254,19 @@ private: bool mUpdateBaseOrder; }; +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.1.2a) | Added: Catznip-2.1.2a +class LLRegisterAttachmentCallback : public LLInventoryCallback +{ +public: + LLRegisterAttachmentCallback() {} + /*virtual*/ ~LLRegisterAttachmentCallback() {} + + /*virtual*/ void fire(const LLUUID& idItem) + { + LLAppearanceMgr::instance().onRegisterAttachmentComplete(idItem); + } +}; +// [/SL:KB] #define SUPPORT_ENSEMBLES 0 From 105ac7346455f84ed16f0b07749ad688e29b4ba6 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 4 Sep 2010 04:07:10 +0200 Subject: [PATCH 5/8] [Appearance/Misc] - fixed : LLWearableBridge::removeAllClothesFromAvatar() doesn't remove all clothing from the avatar --HG-- branch : Appearance-Misc --- indra/newview/llinventorybridge.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 81174730c7..78327a25fb 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4708,7 +4708,10 @@ void LLWearableBridge::removeAllClothesFromAvatar() if (itype == LLWearableType::WT_SHAPE || itype == LLWearableType::WT_SKIN || itype == LLWearableType::WT_HAIR || itype == LLWearableType::WT_EYES) continue; - for (S32 index = gAgentWearables.getWearableCount(itype)-1; index >= 0 ; --index) +// for (S32 index = gAgentWearables.getWearableCount(itype)-1; index >= 0 ; --index) +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-04 (Catznip-2.1.2a) | Added: Catznip-2.1.2a + for (S32 index = gAgentWearables.getWearableCount((LLWearableType::EType)itype)-1; index >= 0 ; --index) +// [/SL:KB] { LLViewerInventoryItem *item = dynamic_cast( gAgentWearables.getWearableInventoryItem((LLWearableType::EType)itype, index)); From 91cd437a358c0e07e03467e663638872c2fb3659 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 4 Sep 2010 04:07:40 +0200 Subject: [PATCH 6/8] [Appearance/Misc] - fixed : crash in LLAppearanceMgr::updateAppearanceFromCOF() due to "Appearance-SyncAttach" patch --HG-- branch : Appearance-Misc --- indra/newview/llappearancemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 134231422d..d5e8f3da30 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1726,7 +1726,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) const LLUUID& idItem = *itPendingObjLink; if (!gAgentAvatarp->isWearingAttachment(idItem)) { - mPendingObjLinks.erase(itPendingObjLink++); + itPendingObjLink = mPendingObjLinks.erase(itPendingObjLink); continue; } From be4ef986756bc8a128f0e4ea8e528330ca92c8ea Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 6 Sep 2010 06:25:30 +0200 Subject: [PATCH 7/8] [Appearance/Misc] - fixed : VS2005 compiler issue (calling std::vector::erase with a const_iterator) --HG-- branch : Appearance-Misc --- indra/newview/llappearancemgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 2349f6cc23..d77d726b74 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -222,7 +222,7 @@ 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); + uuid_vec_t::iterator itPendingObjLink = std::find(mPendingObjLinks.begin(), mPendingObjLinks.end(), idItemBase); if (itPendingObjLink != mPendingObjLinks.end()) mPendingObjLinks.erase(itPendingObjLink); } From d991b390fe30b7101b0f9506c44693f4f16c821b Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Wed, 8 Sep 2010 02:39:13 +0200 Subject: [PATCH 8/8] [Appearance/Misc] Updated patch description from commit messages --HG-- branch : Appearance-Misc --- .hgpatchinfo/Appearance-Misc.desc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.hgpatchinfo/Appearance-Misc.desc b/.hgpatchinfo/Appearance-Misc.desc index 73ba073384..fff24b744a 100644 --- a/.hgpatchinfo/Appearance-Misc.desc +++ b/.hgpatchinfo/Appearance-Misc.desc @@ -9,3 +9,5 @@ - added : LegacyMultiAttachmentSupport debug setting to route "secondary attachment points" to the primary attachment point -> maps secondary attachment point range [39,68] onto [1,30] -> only dislays "secondary attachment points" correctly for *other* avatars (by design) +- fixed : Add to/Replace Outfit removes newly worn attachments on completion +- fixed : LLWearableBridge::removeAllClothesFromAvatar() doesn't remove all clothing from the avatar \ No newline at end of file