From 8953aace58dbc8eb843e69b57e8d0bc2e15adec1 Mon Sep 17 00:00:00 2001 From: trimbe Date: Fri, 4 Jan 2019 21:16:17 -0500 Subject: [PATCH] inventory tags: preserve 'cancel' when creating custom menu The client will use the first menu entry for 'Cancel' and only resets the menu action and menu option as that's all it uses. Overwriting the menu entries with all custom entries caused the 'Cancel' option to have erroneous fields. --- .../client/plugins/inventorytags/InventoryTagsPlugin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java index 3a203af564..c513ebe3d5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsPlugin.java @@ -212,9 +212,12 @@ public class InventoryTagsPlugin extends Plugin return; } - MenuEntry[] menuList = new MenuEntry[GROUPS.size()]; + MenuEntry[] menuList = new MenuEntry[GROUPS.size() + 1]; int num = 0; + // preserve the 'Cancel' option as the client will reuse the first entry for Cancel and only resets option/action + menuList[num++] = event.getMenuEntries()[0]; + for (final String groupName : GROUPS) { final String group = getTag(itemId);