MAINT-3391 FIXED Sounds no longer play directly when double clicking in inventory.

andreykproductengine 2014-08-19 15:02:36 +03:00
parent 55fa4b1c37
commit c64544afe9
3 changed files with 22 additions and 2 deletions

View File

@ -87,6 +87,8 @@ void copy_slurl_to_clipboard_callback_inv(const std::string& slurl);
typedef std::pair<LLUUID, LLUUID> two_uuids_t;
typedef std::list<two_uuids_t> 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();
}

View File

@ -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*);
};

View File

@ -531,7 +531,7 @@
name="Sound Play">
<menu_item_call.on_click
function="Inventory.DoToSelected"
parameter="open" />
parameter="sound_play" />
</menu_item_call>
<menu_item_separator
layout="topleft"