From c64544afe9cfc8204137fc7a68f2d70e4830c056 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 19 Aug 2014 15:02:36 +0300 Subject: MAINT-3391 FIXED Sounds no longer play directly when double clicking in inventory. --- indra/newview/llinventorybridge.cpp | 21 ++++++++++++++++++++- indra/newview/llinventorybridge.h | 1 + .../newview/skins/default/xui/en/menu_inventory.xml | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 8e6ac20eaa..d6f2803fc2 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -87,6 +87,8 @@ void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); typedef std::pair two_uuids_t; typedef std::list two_uuids_list_t; +const F32 SOUND_GAIN = 1.0f; + struct LLMoveInv { LLUUID mObjectID; @@ -4523,6 +4525,23 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } +void LLSoundBridge::performAction(LLInventoryModel* model, std::string action) +{ + if ("sound_play" == action) + { + LLViewerInventoryItem* item = getItem(); + if(item) + { + send_sound_trigger(item->getAssetUUID(), SOUND_GAIN); + } + } + else if ("open" == action) + { + openSoundPreview((void*)this); + } + else LLItemBridge::performAction(model, action); +} + // +=================================================+ // | LLLandmarkBridge | // +=================================================+ @@ -6135,7 +6154,7 @@ public: LLViewerInventoryItem* item = getItem(); if (item) { - LLFloaterReg::showInstance("preview_sound", LLSD(mUUID), TAKE_FOCUS_YES); + send_sound_trigger(item->getAssetUUID(), SOUND_GAIN); } LLInvFVBridgeAction::doIt(); } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 833fbbadbb..e8d5db4437 100755 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -389,6 +389,7 @@ public: LLItemBridge(inventory, root, uuid) {} virtual void openItem(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + virtual void performAction(LLInventoryModel* model, std::string action); static void openSoundPreview(void*); }; diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 6fa45d7d66..7099db63ab 100755 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -531,7 +531,7 @@ name="Sound Play"> + parameter="sound_play" />