Allow double-click in inventory to remove wearable as well as wear it. From Satomi Ahn, fixes FIRE-303.

meow-7.2.2
Tonya Souther 2011-04-26 15:11:25 -05:00
parent ebf38cdd8e
commit c01b4ee707
1 changed files with 8 additions and 13 deletions

View File

@ -5532,7 +5532,14 @@ class LLWearableBridgeAction: public LLInvFVBridgeAction
public:
virtual void doIt()
{
wearOnAvatar();
// TODO: investigate wearables may not be loaded at this point EXT-8231
LLViewerInventoryItem* item = getItem();
if(item)
{
if ( get_is_item_worn(mUUID) ) LLAppearanceMgr::instance().removeItemFromAvatar(mUUID);
else LLAppearanceMgr::instance().wearItemOnAvatar(mUUID /*item->getUUID()*/, true, true);
}
}
virtual ~LLWearableBridgeAction(){}
protected:
@ -5541,7 +5548,6 @@ protected:
// return true if the item is in agent inventory. if false, it
// must be lost or in the inventory library.
BOOL isAgentInventory() const;
void wearOnAvatar();
};
BOOL LLWearableBridgeAction::isItemInTrash() const
@ -5558,17 +5564,6 @@ BOOL LLWearableBridgeAction::isAgentInventory() const
return mModel->isObjectDescendentOf(mUUID, gInventory.getRootFolderID());
}
void LLWearableBridgeAction::wearOnAvatar()
{
// TODO: investigate wearables may not be loaded at this point EXT-8231
LLViewerInventoryItem* item = getItem();
if(item)
{
LLAppearanceMgr::instance().wearItemOnAvatar(item->getUUID(), true, true);
}
}
LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type,
const LLUUID& uuid,
LLInventoryModel* model)