diff --git a/doc/contributions.txt b/doc/contributions.txt
index 244c82a87e..d7ed345a92 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -831,6 +831,7 @@ Kithrak Kirkorian
Kitty Barnett
BUG-228664
BUG-228665
+ BUG-228719
VWR-19699
STORM-288
STORM-799
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index aede623f58..b31981b235 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -140,6 +140,7 @@ protected:
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ registrar.add("Attachment.Touch", boost::bind(handleMultiple, handle_attachment_touch, mUUIDs));
registrar.add("Attachment.Edit", boost::bind(handleMultiple, handle_item_edit, mUUIDs));
registrar.add("Attachment.Detach", boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs));
@@ -153,7 +154,11 @@ protected:
{
const std::string event_name = userdata.asString();
- if ("edit" == event_name)
+ if ("touch" == event_name)
+ {
+ return (1 == mUUIDs.size()) && (enable_attachment_touch(mUUIDs.front()));
+ }
+ else if ("edit" == event_name)
{
return (1 == mUUIDs.size()) && (get_is_item_editable(mUUIDs.front()));
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index bb7f219ed9..c6b972ada2 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -6385,6 +6385,10 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action)
{
LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding.
}
+ else if ("touch" == action)
+ {
+ handle_attachment_touch(mUUID);
+ }
else if ("edit" == action)
{
handle_attachment_edit(mUUID);
@@ -6540,6 +6544,12 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
items.push_back(std::string("Wearable And Object Separator"));
+ items.push_back(std::string("Attachment Touch"));
+ if ( ((flags & FIRST_SELECTED_ITEM) == 0) || !enable_attachment_touch(mUUID) )
+ {
+ disabled_items.push_back(std::string("Attachment Touch"));
+ }
+
items.push_back(std::string("Wearable Edit"));
if ( ((flags & FIRST_SELECTED_ITEM) == 0) || !get_is_item_editable(mUUID) )
{
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index 6b187c7485..3347c40687 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -64,6 +64,7 @@ public:
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
+ registrar.add("Gear.TouchAttach", boost::bind(&LLWearingGearMenu::handleMultiple, this, handle_attachment_touch));
registrar.add("Gear.EditItem", boost::bind(&LLWearingGearMenu::handleMultiple, this, handle_item_edit));
registrar.add("Gear.EditOutfit", boost::bind(&edit_outfit));
registrar.add("Gear.TakeOff", boost::bind(&LLPanelWearing::onRemoveItem, mPanelWearing));
@@ -103,6 +104,7 @@ protected:
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ registrar.add("Wearing.TouchAttach", boost::bind(handleMultiple, handle_attachment_touch, mUUIDs));
registrar.add("Wearing.EditItem", boost::bind(handleMultiple, handle_item_edit, mUUIDs));
registrar.add("Wearing.EditOutfit", boost::bind(&edit_outfit));
registrar.add("Wearing.ShowOriginal", boost::bind(show_item_original, mUUIDs.front()));
@@ -150,15 +152,18 @@ protected:
}
// Enable/disable some menu items depending on the selection.
+ bool show_touch = !bp_selected && !clothes_selected && attachments_selected;
bool show_edit = bp_selected || clothes_selected || attachments_selected;
bool allow_detach = !bp_selected && !clothes_selected && attachments_selected;
bool allow_take_off = !bp_selected && clothes_selected && !attachments_selected;
+ menu->setItemVisible("touch_attach", show_touch);
+ menu->setItemEnabled("touch_attach", 1 == mUUIDs.size() && enable_attachment_touch(mUUIDs.front()));
menu->setItemVisible("edit_item", show_edit);
menu->setItemEnabled("edit_item", 1 == mUUIDs.size() && get_is_item_editable(mUUIDs.front()));
menu->setItemVisible("take_off", allow_take_off);
menu->setItemVisible("detach", allow_detach);
- menu->setItemVisible("edit_outfit_separator", show_edit | allow_take_off || allow_detach);
+ menu->setItemVisible("edit_outfit_separator", show_touch | show_edit | allow_take_off || allow_detach);
menu->setItemVisible("show_original", mUUIDs.size() == 1);
}
};
@@ -187,6 +192,8 @@ protected:
void updateMenuItemsVisibility(LLContextMenu* menu)
{
+ menu->setItemVisible("touch_attach", TRUE);
+ menu->setItemEnabled("touch_attach", 1 == mUUIDs.size());
menu->setItemVisible("edit_item", TRUE);
menu->setItemEnabled("edit_item", 1 == mUUIDs.size());
menu->setItemVisible("take_off", FALSE);
@@ -368,7 +375,11 @@ bool LLPanelWearing::isActionEnabled(const LLSD& userdata)
uuid_vec_t selected_uuids;
getSelectedItemsUUIDs(selected_uuids);
- if (command_name == "edit_item")
+ if (command_name == "touch_attach")
+ {
+ return (1 == selected_uuids.size()) && (enable_attachment_touch(selected_uuids.front()));
+ }
+ else if (command_name == "edit_item")
{
return (1 == selected_uuids.size()) && (get_is_item_editable(selected_uuids.front()));
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index e9d23ea16d..be018a1a4d 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2821,6 +2821,43 @@ void handle_attachment_edit(const LLUUID& inv_item_id)
}
}
+void handle_attachment_touch(const LLUUID& inv_item_id)
+{
+ if ( (isAgentAvatarValid()) && (enable_attachment_touch(inv_item_id)) )
+ {
+ if (LLViewerObject* attach_obj = gAgentAvatarp->getWornAttachment(gInventory.getLinkedItemID(inv_item_id)))
+ {
+ LLSelectMgr::getInstance()->deselectAll();
+
+ LLObjectSelectionHandle sel = LLSelectMgr::getInstance()->selectObjectAndFamily(attach_obj);
+ if (!LLToolMgr::getInstance()->inBuildMode())
+ {
+ struct SetTransient : public LLSelectedNodeFunctor
+ {
+ bool apply(LLSelectNode* node)
+ {
+ node->setTransient(TRUE);
+ return true;
+ }
+ } f;
+ sel->applyToNodes(&f);
+ }
+
+ handle_object_touch();
+ }
+ }
+}
+
+bool enable_attachment_touch(const LLUUID& inv_item_id)
+{
+ if (isAgentAvatarValid())
+ {
+ const LLViewerObject* attach_obj = gAgentAvatarp->getWornAttachment(gInventory.getLinkedItemID(inv_item_id));
+ return (attach_obj) && (attach_obj->flagHandleTouch());
+ }
+ return false;
+}
+
void handle_object_inspect()
{
LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h
index bbced834ca..0f63c8cf58 100644
--- a/indra/newview/llviewermenu.h
+++ b/indra/newview/llviewermenu.h
@@ -108,7 +108,10 @@ void handle_zoom_to_object(LLUUID object_id);
void handle_object_return();
void handle_object_delete();
void handle_object_edit();
+
void handle_attachment_edit(const LLUUID& inv_item_id);
+void handle_attachment_touch(const LLUUID& inv_item_id);
+bool enable_attachment_touch(const LLUUID& inv_item_id);
void handle_buy_land();
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 93bb0a7eed..e7f62e77b4 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -38,6 +38,7 @@
#include "llgesturemgr.h"
#include "lltransutil.h"
#include "llviewerattachmenu.h"
+#include "llviewermenu.h"
#include "llvoavatarself.h"
class LLFindOutfitItems : public LLInventoryCollectFunctor
@@ -809,6 +810,7 @@ LLContextMenu* LLWearableItemsList::ContextMenu::createMenu()
// Register handlers for attachments.
registrar.add("Attachment.Detach",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids));
+ registrar.add("Attachment.Touch", boost::bind(handle_attachment_touch, selected_id));
registrar.add("Attachment.Profile", boost::bind(show_item_profile, selected_id));
registrar.add("Object.Attach", boost::bind(LLViewerAttachMenu::attachObjects, ids, _2));
@@ -838,6 +840,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
U32 n_already_worn = 0; // number of items worn of same type as selected items
U32 n_links = 0; // number of links among the selected items
U32 n_editable = 0; // number of editable items among the selected ones
+ U32 n_touchable = 0; // number of touchable items among the selected ones
bool can_be_worn = true;
@@ -859,11 +862,16 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
const bool is_link = item->getIsLinkType();
const bool is_worn = get_is_item_worn(id);
const bool is_editable = get_is_item_editable(id);
+ const bool is_touchable = enable_attachment_touch(id);
const bool is_already_worn = gAgentWearables.selfHasWearable(wearable_type);
if (is_worn)
{
++n_worn;
}
+ if (is_touchable)
+ {
+ ++n_touchable;
+ }
if (is_editable)
{
++n_editable;
@@ -893,6 +901,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
setMenuItemEnabled(menu, "wear_add", LLAppearanceMgr::instance().canAddWearables(ids));
setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && can_be_worn);
//visible only when one item selected and this item is worn
+ setMenuItemVisible(menu, "touch", !standalone && mask == MASK_ATTACHMENT && n_worn == n_items);
+ setMenuItemEnabled(menu, "touch", n_touchable && n_worn == 1 && n_items == 1);
setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART|MASK_ATTACHMENT) && n_worn == n_items);
setMenuItemEnabled(menu, "edit", n_editable && n_worn == 1 && n_items == 1);
setMenuItemVisible(menu, "create_new", mask & (MASK_CLOTHING|MASK_BODYPART) && n_items == 1);
diff --git a/indra/newview/skins/default/xui/da/menu_cof_attachment.xml b/indra/newview/skins/default/xui/da/menu_cof_attachment.xml
index ede33b8efb..37e9351ab5 100644
--- a/indra/newview/skins/default/xui/da/menu_cof_attachment.xml
+++ b/indra/newview/skins/default/xui/da/menu_cof_attachment.xml
@@ -1,5 +1,6 @@
+
diff --git a/indra/newview/skins/default/xui/da/menu_inventory.xml b/indra/newview/skins/default/xui/da/menu_inventory.xml
index f9bdf36f1f..ba96d6dca1 100644
--- a/indra/newview/skins/default/xui/da/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/da/menu_inventory.xml
@@ -78,6 +78,7 @@
+
diff --git a/indra/newview/skins/default/xui/da/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/da/menu_wearable_list_item.xml
index 63f4b0b388..67adf74bcd 100644
--- a/indra/newview/skins/default/xui/da/menu_wearable_list_item.xml
+++ b/indra/newview/skins/default/xui/da/menu_wearable_list_item.xml
@@ -3,6 +3,7 @@
+
diff --git a/indra/newview/skins/default/xui/da/menu_wearing_gear.xml b/indra/newview/skins/default/xui/da/menu_wearing_gear.xml
index da33c67a02..ff58cd68b2 100644
--- a/indra/newview/skins/default/xui/da/menu_wearing_gear.xml
+++ b/indra/newview/skins/default/xui/da/menu_wearing_gear.xml
@@ -1,5 +1,6 @@