diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-04-13 17:49:26 +0300 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-04-13 17:49:26 +0300 |
commit | 107a7eb919bb0afadf6ad3f92482cf7e6d67c56e (patch) | |
tree | f01c774bd61274661f8504812f5ad2b563953a27 /indra/newview/llinventorygallerymenu.cpp | |
parent | c3d22fba600a6c40268dfbec15ec1fe145cbbb1d (diff) |
SL-19544 WIP add active suffix for gestures and add appropriate context menu handling
Diffstat (limited to 'indra/newview/llinventorygallerymenu.cpp')
-rw-r--r-- | indra/newview/llinventorygallerymenu.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp index e91ec78730..84b18c1517 100644 --- a/indra/newview/llinventorygallerymenu.cpp +++ b/indra/newview/llinventorygallerymenu.cpp @@ -314,6 +314,26 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata, const LLU { LLAppearanceMgr::instance().wearItemOnAvatar(selected_id, true, true); } + else if ("activate" == action) + { + LLGestureMgr::instance().activateGesture(selected_id); + + LLViewerInventoryItem* item = gInventory.getItem(selected_id); + if (!item) return; + + gInventory.updateItem(item); + gInventory.notifyObservers(); + } + else if ("deactivate" == action) + { + LLGestureMgr::instance().deactivateGesture(selected_id); + + LLViewerInventoryItem* item = gInventory.getItem(selected_id); + if (!item) return; + + gInventory.updateItem(item); + gInventory.notifyObservers(); + } } void LLInventoryGalleryContextMenu::onRename(const LLSD& notification, const LLSD& response) @@ -590,6 +610,19 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men disabled_items.push_back(std::string("Open")); disabled_items.push_back(std::string("Open Original")); } + + if(LLAssetType::AT_GESTURE == obj->getType()) + { + items.push_back(std::string("Gesture Separator")); + if(!LLGestureMgr::instance().isGestureActive(selected_id)) + { + items.push_back(std::string("Activate")); + } + else + { + items.push_back(std::string("Deactivate")); + } + } } else if(LLAssetType::AT_LANDMARK == obj->getType()) { |