Fixed normal bug EXT-4768 - 'Play' btn does nothing to gesture in Inventory side panel.

--HG--
branch : product-engine
meow-7.2.2
Dmitry Zaporozhan 2010-02-01 17:11:31 +02:00
parent 10ed52f69a
commit c679ae3546
3 changed files with 46 additions and 1 deletions

View File

@ -3773,6 +3773,21 @@ void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* mode
gInventory.updateItem(item);
gInventory.notifyObservers();
}
else if("play" == action)
{
if(!LLGestureManager::instance().isGestureActive(mUUID))
{
// we need to inform server about gesture activating to be consistent with LLPreviewGesture and LLGestureComboList.
BOOL inform_server = TRUE;
BOOL deactivate_similar = FALSE;
LLGestureManager::instance().setGestureLoadedCallback(mUUID, boost::bind(&LLGestureBridge::playGesture, mUUID));
LLGestureManager::instance().activateGestureWithAsset(mUUID, gInventory.getItem(mUUID)->getAssetUUID(), inform_server, deactivate_similar);
}
else
{
playGesture(mUUID);
}
}
else LLItemBridge::performAction(folder, model, action);
}
@ -3858,6 +3873,20 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
hide_context_entries(menu, items, disabled_items);
}
// static
void LLGestureBridge::playGesture(const LLUUID& item_id)
{
if (LLGestureManager::instance().isGesturePlaying(item_id))
{
LLGestureManager::instance().stopGesture(item_id);
}
else
{
LLGestureManager::instance().playGesture(item_id);
}
}
// +=================================================+
// | LLAnimationBridge |
// +=================================================+

View File

@ -491,6 +491,8 @@ public:
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
static void playGesture(const LLUUID& item_id);
protected:
LLGestureBridge(LLInventoryPanel* inventory, const LLUUID& uuid)
: LLItemBridge(inventory, uuid) {}

View File

@ -164,7 +164,21 @@ void LLSidepanelInventory::onWearButtonClicked()
void LLSidepanelInventory::onPlayButtonClicked()
{
performActionOnSelection("activate");
const LLInventoryItem *item = getSelectedItem();
if (!item)
{
return;
}
switch(item->getInventoryType())
{
case LLInventoryType::IT_GESTURE:
performActionOnSelection("play");
break;
default:
performActionOnSelection("activate");
break;
}
}
void LLSidepanelInventory::onTeleportButtonClicked()