diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RuneLiteMenuEntryMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RuneLiteMenuEntryMixin.java index 8baa25e250..1daa418c04 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RuneLiteMenuEntryMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RuneLiteMenuEntryMixin.java @@ -38,6 +38,56 @@ public abstract class RuneLiteMenuEntryMixin implements RSRuneLiteMenuEntry @Shadow("client") private static RSClient client; + @Override + public int getItemOp() + { + MenuAction var1 = this.getType(); + if (var1 == MenuAction.CC_OP || var1 == MenuAction.CC_OP_LOW_PRIORITY) + { + int identifier = this.getIdentifier(); + int param0 = this.getParam0(); + int param1 = this.getParam1(); + + if (param1 == 9764864) + { + switch (identifier) + { + case 1: + Widget widget = client.getWidget(param1); + if (widget != null && param0 != -1) + { + widget = widget.getChild(param0); + if (widget != null && widget.getItemId() > -1) + { + int shiftClickActionIndex = client.getItemComposition(widget.getItemId()).getShiftClickActionIndex(); + + if (shiftClickActionIndex >= 0) + { + return shiftClickActionIndex + 1; + } + } + } + break; + case 2: + return 1; + case 3: + return 2; + case 4: + return 3; + case 5: + default: + break; + case 6: + return 4; + case 7: + return 5; + } + } + } + + return -1; + } + @Inject @Override public int getItemId() @@ -47,6 +97,7 @@ public abstract class RuneLiteMenuEntryMixin implements RSRuneLiteMenuEntry { int param1 = this.getParam1(); int param0 = this.getParam0(); + if (param1 == 9764864) { Widget widget = client.getWidget(param1); diff --git a/runescape-client/src/main/java/RuneLiteMenuEntry.java b/runescape-client/src/main/java/RuneLiteMenuEntry.java index c7eceadc2e..edc505b8bf 100644 --- a/runescape-client/src/main/java/RuneLiteMenuEntry.java +++ b/runescape-client/src/main/java/RuneLiteMenuEntry.java @@ -328,11 +328,15 @@ public class RuneLiteMenuEntry implements MenuEntry public boolean isItemOp() { MenuAction var1 = this.getType(); - if (var1 == MenuAction.CC_OP || var1 == MenuAction.CC_OP_LOW_PRIORITY) { + if (var1 == MenuAction.CC_OP || var1 == MenuAction.CC_OP_LOW_PRIORITY) + { int var2 = this.getIdentifier(); int var3 = this.getParam1(); - if (var3 == 9764864) { - switch(var2) { + if (var3 == 9764864) + { + switch (var2) + { + case 1: case 2: case 3: case 4: @@ -350,30 +354,7 @@ public class RuneLiteMenuEntry implements MenuEntry @Override public int getItemOp() { - MenuAction var1 = this.getType(); - if (var1 == MenuAction.CC_OP || var1 == MenuAction.CC_OP_LOW_PRIORITY) { - int var2 = this.getIdentifier(); - int var3 = this.getParam1(); - if (var3 == 9764864) { - switch(var2) { - case 2: - return 1; - case 3: - return 2; - case 4: - return 3; - case 5: - default: - break; - case 6: - return 4; - case 7: - return 5; - } - } - } - - return -1; + throw new NotImplementedException(); } @Override