client: make actions follow menu entry params.

This commit is contained in:
Ganom
2020-04-07 07:08:55 -04:00
parent 190f8ce4ae
commit dd971b7f65
3 changed files with 6 additions and 16 deletions

View File

@@ -1435,9 +1435,9 @@ public abstract class RSClientMixin implements RSClient
@Override
@Inject
public void invokeMenuAction(int param0, int param1, int opcode, int id, String menuOption, String menuTarget, int canvasX, int canvasY)
public void invokeMenuAction(String option, String target, int identifier, int opcode, int param0, int param1)
{
client.sendMenuAction(param0, param1, opcode, id, menuOption, "!AUTHENTIC" + menuTarget, canvasX, canvasY);
client.sendMenuAction(param0, param1, opcode, identifier, option, "!AUTHENTIC" + target, 658, 384);
}
@FieldHook("Login_username")
@@ -1883,4 +1883,4 @@ public abstract class RSClientMixin implements RSClient
return widgetClickMask;
}
}
}

View File

@@ -15,7 +15,7 @@ public abstract class WorldHoppingMixin implements RSClient
public void openWorldHopper()
{
// The clicked x & y coordinates (the last arguments) are not processed in the game or sent to Jagex, so they don't have to be real.
invokeMenuAction(-1, WidgetInfo.WORLD_SWITCHER_BUTTON.getId(), MenuOpcode.CC_OP.getId(), 1, "World Switcher", "", 658, 384);
invokeMenuAction("World Switcher", "", 1, MenuOpcode.CC_OP.getId(), -1, WidgetInfo.WORLD_SWITCHER_BUTTON.getId());
}
@Inject
@@ -23,6 +23,6 @@ public abstract class WorldHoppingMixin implements RSClient
public void hopToWorld(World world)
{
final int worldId = world.getId();
invokeMenuAction(worldId, WidgetInfo.WORLD_SWITCHER_LIST.getId(), MenuOpcode.CC_OP.getId(), 1, "Switch", "<col=ff9040>" + (worldId - 300) + "</col>", 683, 244);
invokeMenuAction("Switch", "<col=ff9040>" + (worldId - 300) + "</col>", 1, MenuOpcode.CC_OP.getId(), worldId, WidgetInfo.WORLD_SWITCHER_LIST.getId());
}
}