openrune: MenuOpcode -> MenuAction

This commit is contained in:
therealunull
2020-12-13 12:46:24 -05:00
parent c300358468
commit 81577a4271
5 changed files with 26 additions and 26 deletions

View File

@@ -53,15 +53,15 @@ import net.runelite.api.IntegerNode;
import net.runelite.api.InventoryID;
import net.runelite.api.ItemDefinition;
import net.runelite.api.MenuEntry;
import net.runelite.api.MenuOpcode;
import static net.runelite.api.MenuOpcode.PLAYER_EIGTH_OPTION;
import static net.runelite.api.MenuOpcode.PLAYER_FIFTH_OPTION;
import static net.runelite.api.MenuOpcode.PLAYER_FIRST_OPTION;
import static net.runelite.api.MenuOpcode.PLAYER_FOURTH_OPTION;
import static net.runelite.api.MenuOpcode.PLAYER_SECOND_OPTION;
import static net.runelite.api.MenuOpcode.PLAYER_SEVENTH_OPTION;
import static net.runelite.api.MenuOpcode.PLAYER_SIXTH_OPTION;
import static net.runelite.api.MenuOpcode.PLAYER_THIRD_OPTION;
import net.runelite.api.MenuAction;
import static net.runelite.api.MenuAction.PLAYER_EIGTH_OPTION;
import static net.runelite.api.MenuAction.PLAYER_FIFTH_OPTION;
import static net.runelite.api.MenuAction.PLAYER_FIRST_OPTION;
import static net.runelite.api.MenuAction.PLAYER_FOURTH_OPTION;
import static net.runelite.api.MenuAction.PLAYER_SECOND_OPTION;
import static net.runelite.api.MenuAction.PLAYER_SEVENTH_OPTION;
import static net.runelite.api.MenuAction.PLAYER_SIXTH_OPTION;
import static net.runelite.api.MenuAction.PLAYER_THIRD_OPTION;
import net.runelite.api.MessageNode;
import net.runelite.api.NPC;
import net.runelite.api.NPCDefinition;
@@ -1059,11 +1059,11 @@ public abstract class RSClientMixin implements RSClient
public static void playerOptionsChanged(int idx)
{
// Reset the menu opcode
MenuOpcode[] playerActions = {PLAYER_FIRST_OPTION, PLAYER_SECOND_OPTION, PLAYER_THIRD_OPTION, PLAYER_FOURTH_OPTION,
MenuAction[] playerActions = {PLAYER_FIRST_OPTION, PLAYER_SECOND_OPTION, PLAYER_THIRD_OPTION, PLAYER_FOURTH_OPTION,
PLAYER_FIFTH_OPTION, PLAYER_SIXTH_OPTION, PLAYER_SEVENTH_OPTION, PLAYER_EIGTH_OPTION};
if (idx >= 0 && idx < playerActions.length)
{
MenuOpcode playerAction = playerActions[idx];
MenuAction playerAction = playerActions[idx];
client.getPlayerMenuTypes()[idx] = playerAction.getId();
}
@@ -1720,7 +1720,7 @@ public abstract class RSClientMixin implements RSClient
if (len > 0)
{
int type = getMenuOpcodes()[len - 1];
return type == MenuOpcode.RUNELITE_OVERLAY.getId();
return type == MenuAction.RUNELITE_OVERLAY.getId();
}
return false;

View File

@@ -1,6 +1,6 @@
package net.runelite.mixins;
import net.runelite.api.MenuOpcode;
import net.runelite.api.MenuAction;
import net.runelite.api.World;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.api.mixins.Inject;
@@ -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("World Switcher", "", 1, MenuOpcode.CC_OP.getId(), -1, WidgetInfo.WORLD_SWITCHER_BUTTON.getId());
invokeMenuAction("World Switcher", "", 1, MenuAction.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("Switch", "<col=ff9040>" + (worldId - 300) + "</col>", 1, MenuOpcode.CC_OP.getId(), worldId, WidgetInfo.WORLD_SWITCHER_LIST.getId());
invokeMenuAction("Switch", "<col=ff9040>" + (worldId - 300) + "</col>", 1, MenuAction.CC_OP.getId(), worldId, WidgetInfo.WORLD_SWITCHER_LIST.getId());
}
}