project(mixins): Shiftclick drop

This commit is contained in:
Owain van Brakel
2022-04-30 23:06:24 +02:00
parent 0e640d1415
commit 67080d2174
2 changed files with 59 additions and 27 deletions

View File

@@ -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);