summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-22 16:41:21 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-22 16:41:21 -0500
commit55c1f18c8d70304653d21373d3b71130123945b2 (patch)
tree5f416de0c87818311c18fc02bd42befd28d55e93 /indra/newview
parent722c8b1c7620eb43baa329846cf6410c3ebacc85 (diff)
For EXT-3622: Take off item, wear a different item --> first item is put on again
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorybridge.cpp36
-rw-r--r--indra/newview/llinventorybridge.h4
-rw-r--r--indra/newview/llviewermenu.cpp7
3 files changed, 33 insertions, 14 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3fc2cbecbe..beecd48419 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4555,18 +4555,8 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod
}
else if (isRemoveAction(action))
{
- if (get_is_item_worn(mUUID))
- {
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLWearableList::instance().getAsset(item->getAssetUUID(),
- item->getName(),
- item->getType(),
- LLWearableBridge::onRemoveFromAvatarArrived,
- new OnRemoveStruct(mUUID));
- }
- }
+ removeFromAvatar();
+ return;
}
else LLItemBridge::performAction(folder, model, action);
}
@@ -4949,6 +4939,28 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable,
delete on_remove_struct;
}
+/* static */
+void LLWearableBridge::removeItemFromAvatar(LLViewerInventoryItem *item)
+{
+ if (item)
+ {
+ LLWearableList::instance().getAsset(item->getAssetUUID(),
+ item->getName(),
+ item->getType(),
+ LLWearableBridge::onRemoveFromAvatarArrived,
+ new OnRemoveStruct(item->getUUID()));
+ }
+}
+
+void LLWearableBridge::removeFromAvatar()
+{
+ if (get_is_item_worn(mUUID))
+ {
+ LLViewerInventoryItem* item = getItem();
+ removeItemFromAvatar(item);
+ }
+}
+
LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type,
const LLUUID& uuid,LLInventoryModel* model)
{
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 4d83e9b684..c93fc85a7d 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -572,7 +572,9 @@ public:
static BOOL canRemoveFromAvatar( void* userdata );
static void onRemoveFromAvatar( void* userdata );
- static void onRemoveFromAvatarArrived( LLWearable* wearable, void* userdata );
+ static void onRemoveFromAvatarArrived( LLWearable* wearable, void* userdata );
+ static void removeItemFromAvatar(LLViewerInventoryItem *item);
+ void removeFromAvatar();
protected:
LLWearableBridge(LLInventoryPanel* inventory, const LLUUID& uuid, LLAssetType::EType asset_type, LLInventoryType::EType inv_type, EWearableType wearable_type) :
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 23bcca9603..46a21066ba 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7428,7 +7428,12 @@ class LLEditTakeOff : public view_listener_t
{
EWearableType type = LLWearableDictionary::typeNameToType(clothing);
if (type >= WT_SHAPE && type < WT_COUNT)
- LLAgentWearables::userRemoveWearable(type);
+ {
+ // MULTI-WEARABLES
+ LLViewerInventoryItem *item = dynamic_cast<LLViewerInventoryItem*>(gAgentWearables.getWearableInventoryItem(type,0));
+ LLWearableBridge::removeItemFromAvatar(item);
+ }
+
}
return true;
}