project: Add a bit of backward compatibility to the reworked menus

This commit is contained in:
Owain van Brakel
2021-12-16 10:18:41 +01:00
parent a42c845ad3
commit df5e3e2334
5 changed files with 181 additions and 0 deletions

View File

@@ -70,6 +70,12 @@ public class RuneLiteMenuEntry implements MenuEntry
return MenuAction.of(opcode);
}
@Override
public MenuAction getMenuAction()
{
return this.getType();
}
@Override
public MenuEntry setType(MenuAction menuAction)
{
@@ -84,6 +90,31 @@ public class RuneLiteMenuEntry implements MenuEntry
return this;
}
@Override
public int getOpcode()
{
int opcode = Client.menuOpcodes[this.idx];
if (opcode >= 2000)
{
opcode -= 2000;
}
return opcode;
}
@Override
public void setOpcode(int code)
{
int opcode = Client.menuOpcodes[this.idx];
short mod = 0;
if (opcode >= 2000)
{
mod = 2000;
}
Client.menuOpcodes[this.idx] = code + mod;
}
@Override
public int getIdentifier()
{
@@ -110,6 +141,18 @@ public class RuneLiteMenuEntry implements MenuEntry
return this;
}
@Override
public int getActionParam0()
{
return this.getParam0();
}
@Override
public void setActionParam0(int param0)
{
this.setParam0(param0);
}
@Override
public int getParam1()
{
@@ -123,6 +166,18 @@ public class RuneLiteMenuEntry implements MenuEntry
return this;
}
@Override
public int getActionParam1()
{
return this.getParam1();
}
@Override
public void setActionParam1(int param1)
{
this.setParam1(param1);
}
@Override
public boolean isDeprioritized()
{