summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-06-30 13:22:19 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-06-30 13:22:19 +0300
commit8488d8600905a8f5f8e80513e39a67dce7a8cc84 (patch)
treede4d8b31a1af3b0ca4c65df67264312330d81510
parenta7c9ca896069ce84d8c9798e36a5fc75d5ac9939 (diff)
SL-17668 Add operation "show in inventory" on in-world avatar attachment
-rw-r--r--indra/newview/llviewermenu.cpp27
-rw-r--r--indra/newview/skins/default/xui/en/menu_attachment_self.xml7
2 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 8522c2ed55..459bbaa00a 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2725,6 +2725,32 @@ void handle_object_touch()
send_ObjectDeGrab_message(object, pick);
}
+void handle_object_show_original()
+{
+ LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
+ if (!object)
+ {
+ return;
+ }
+
+ LLViewerObject *parent = (LLViewerObject*)object->getParent();
+ while (parent)
+ {
+ if(parent->isAvatar())
+ {
+ break;
+ }
+ object = parent;
+ parent = (LLViewerObject*)parent->getParent();
+ }
+
+ if (!object || object->isAvatar())
+ {
+ return;
+ }
+
+ show_item_original(object->getAttachmentItemID());
+}
static void init_default_item_label(const std::string& item_name)
@@ -9510,6 +9536,7 @@ void initialize_menus()
// Object pie menu
view_listener_t::addMenu(new LLObjectBuild(), "Object.Build");
commit.add("Object.Touch", boost::bind(&handle_object_touch));
+ commit.add("Object.ShowOriginal", boost::bind(&handle_object_show_original));
commit.add("Object.SitOrStand", boost::bind(&handle_object_sit_or_stand));
commit.add("Object.Delete", boost::bind(&handle_object_delete));
view_listener_t::addMenu(new LLObjectAttachToAvatar(true), "Object.AttachToAvatar");
diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml
index 26b1c86c53..3b91b9df7a 100644
--- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml
+++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml
@@ -33,6 +33,13 @@
function="Object.EnableTouch"
name="EnableTouch"/>
</menu_item_call>
+ <menu_item_call
+ label="Show in inventory"
+ layout="topleft"
+ name="Show original">
+ <menu_item_call.on_click
+ function="Object.ShowOriginal" />
+ </menu_item_call>
<menu_item_separator
layout="topleft" />