diff options
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b5316d29e0..981605d1fa 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -47,7 +47,7 @@ #include "llviewerregion.h" #include "llviewerobjectlist.h" - +#include "llpreviewgesture.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- @@ -643,6 +643,26 @@ void ActivateGestureCallback::fire(const LLUUID& inv_item) gGestureManager.activateGesture(inv_item); } +void CreateGestureCallback::fire(const LLUUID& inv_item) +{ + if (inv_item.isNull()) + return; + + gGestureManager.activateGesture(inv_item); + + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (!item) return; + gInventory.updateItem(item); + gInventory.notifyObservers(); + + if(!LLPreview::show(inv_item,FALSE)) + { + LLPreviewGesture* preview = LLPreviewGesture::show(LLString("Gesture: ") + item->getName(), inv_item, LLUUID::null); + // Force to be entirely onscreen. + gFloaterView->adjustToFitScreen(preview, FALSE); + } +} + LLInventoryCallbackManager gInventoryCallbacks; void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id, |