From e0cf129601f7b42f5c20f63a9651edb6a0293f9e Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Fri, 12 Jun 2009 02:59:00 -0700 Subject: Double clicking inventory objects toggles wear/detach. Patch originally by Nicholaz Beresford with additions by Henri Beauchamp --- linden/indra/newview/llinventorybridge.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'linden/indra/newview/llinventorybridge.cpp') diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 697b30b..52b15cb 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -3304,10 +3304,19 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model void LLObjectBridge::openItem() { - /* Disabled -- this preview isn't useful. JC */ - // CP: actually, this code is required - made changes to match LLAnimationBridge::openItem() idiom - // The properties preview is useful, converting to show object properties. - DaveP - LLShowProps::showProperties(mUUID); + LLVOAvatar* avatar = gAgent.getAvatarObject(); + if (!avatar) + { + return; + } + if (avatar->isWearingAttachment(mUUID)) + { + performAction(NULL, NULL, "detach"); + } + else + { + performAction(NULL, NULL, "attach"); + } } LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const @@ -4358,9 +4367,13 @@ void LLWearableBridge::openItem() } else if(isAgentInventory()) { - if( !gAgent.isWearingItem( mUUID ) ) + if (gAgent.isWearingItem(mUUID)) { - wearOnAvatar(); + performAction(NULL, NULL, "take_off"); + } + else + { + performAction(NULL, NULL, "wear"); } } else -- cgit v1.1