From 8112ba5bafe404a43a22a57eb0aa96d884fab365 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 15 Mar 2010 12:08:57 -0400 Subject: EXT-6010 Appearance reverts to an old outfit while attempting to wear new outfit Added code to suppress local composite updates while wearables are loaded. This makes sure that we don't update your appearance until all your wearables are added to gAgentWearables. Hackish for 2.0, but will be inherently better for 2.1 code reviewed by vir. --- indra/newview/llagentwearables.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 7b55282ee5..ea10917901 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1759,6 +1759,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it if (mAvatarObject) { + mAvatarObject->setCompositeUpdatesEnabled(TRUE); mAvatarObject->updateVisualParams(); mAvatarObject->invalidateAll(); } -- cgit v1.2.3 From 896b88063ed0e08362c9e277e7ef8aba5afef0db Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 17 Mar 2010 17:55:12 -0400 Subject: EXT-6252 : "Duplicate items (not links) in inventory are both displayed in bold as (worn) when only one is actually worn" Simple special-case fix for this specific issue, although I added a comment to llwearablelist.h that eventually the whole LLWearableList class will need some redesign. Core issue is that you can have multiple itemIDs pointing to the same assetID and LLWearableList doesn't account for this possibility during lookup-wearable-by-assetID operations. --- indra/newview/llagentwearables.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index ea10917901..65503d4998 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1702,6 +1702,16 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it LLWearable* old_wearable = getWearable(type, 0); if (old_wearable) { + // Special case where you're putting on a wearable that has the same assetID + // as the previous (e.g. wear a shirt then wear a copy of that shirt) since in this + // case old_wearable == new_wearable. + if (old_wearable == new_wearable) + { + old_wearable->setLabelUpdated(); + new_wearable->setName(new_item->getName()); + new_wearable->setItemID(new_item->getUUID()); + } + const LLUUID& old_item_id = getWearableItemID(type, 0); if ((old_wearable->getAssetID() == new_wearable->getAssetID()) && (old_item_id == new_item->getUUID())) @@ -1717,7 +1727,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it continue; } } - + new_wearable->setItemID(new_item->getUUID()); setWearable(type,0,new_wearable); } -- cgit v1.2.3 From 6fc719813e4ef3a6c9a2950af331b978fbc9cd04 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 19 Mar 2010 11:15:46 -0400 Subject: EXT-6445 After copying an item, changes to new item affect old item Since multiple inventory items can refer to the same asset ID, we needed to revert changes to old_wearable (indexed by asset ID) after saving changes made to a wearable to a new asset ID. This prevents user confusion around unsaved changes. Code reviewed by vir. --- indra/newview/llagentwearables.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 65503d4998..ebadd8a165 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -443,6 +443,11 @@ void LLAgentWearables::saveWearable(const EWearableType type, const U32 index, B new_wearable->setItemID(old_item_id); // should this be in LLWearable::copyDataFrom()? setWearable(type,index,new_wearable); + // old_wearable may still be referred to by other inventory items. Revert + // unsaved changes so other inventory items aren't affected by the changes + // that were just saved. + old_wearable->revertValues(); + LLInventoryItem* item = gInventory.getItem(old_item_id); if (item) { @@ -545,6 +550,11 @@ void LLAgentWearables::saveWearableAs(const EWearableType type, category_id, new_name, cb); + + // old_wearable may still be referred to by other inventory items. Revert + // unsaved changes so other inventory items aren't affected by the changes + // that were just saved. + old_wearable->revertValues(); } void LLAgentWearables::revertWearable(const EWearableType type, const U32 index) -- cgit v1.2.3