mes: Add right click 'Last-destination' option for Jewellery Boxes (#1737)
* api: menu event, prio runelite menuopcode, widget stuff, eventbus logging add "Menu" event to keep everything in chronological order add MenuOpcode.PRIO_RUNELITE which is sub 1000 so it doesn't get sorted add Jewellery box widget info add getOnOp fix exception logging in eventbus redisable gpu debug messages * mes: add (right click only) last destination to jewellery boxes * mes: use Object objects for eventbus instead of strings
This commit is contained in:
@@ -232,6 +232,11 @@ public enum MenuOpcode
|
|||||||
*/
|
*/
|
||||||
WIDGET_DEFAULT(57),
|
WIDGET_DEFAULT(57),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sub 1000 so it doesn't get sorted down in the list
|
||||||
|
*/
|
||||||
|
PRIO_RUNELITE(666),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu action triggered by examining an object.
|
* Menu action triggered by examining an object.
|
||||||
*/
|
*/
|
||||||
|
|||||||
31
runelite-api/src/main/java/net/runelite/api/events/Menu.java
Normal file
31
runelite-api/src/main/java/net/runelite/api/events/Menu.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package net.runelite.api.events;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets sent before menu handling code is ran, once per client tick.
|
||||||
|
* Can be consumed, skipping this method this tick.
|
||||||
|
*/
|
||||||
|
public class Menu implements Event
|
||||||
|
{
|
||||||
|
public static final Menu MENU = new Menu();
|
||||||
|
|
||||||
|
private Menu()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean run;
|
||||||
|
|
||||||
|
public void reset()
|
||||||
|
{
|
||||||
|
run = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void dontRun()
|
||||||
|
{
|
||||||
|
run = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean shouldRun()
|
||||||
|
{
|
||||||
|
return run;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -626,6 +626,7 @@ public interface Widget
|
|||||||
|
|
||||||
Object[] getOnInvTransmit();
|
Object[] getOnInvTransmit();
|
||||||
|
|
||||||
|
Object[] getOnOp();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the archive id of the font used
|
* Returns the archive id of the font used
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ public class WidgetID
|
|||||||
public static final int EXPLORERS_RING_ALCH_GROUP_ID = 483;
|
public static final int EXPLORERS_RING_ALCH_GROUP_ID = 483;
|
||||||
public static final int LMS_GROUP_ID = 333;
|
public static final int LMS_GROUP_ID = 333;
|
||||||
public static final int LMS_INGAME_GROUP_ID = 328;
|
public static final int LMS_INGAME_GROUP_ID = 328;
|
||||||
|
public static final int JEWELLERY_BOX_GROUP_ID = 590;
|
||||||
|
|
||||||
static class WorldMap
|
static class WorldMap
|
||||||
{
|
{
|
||||||
@@ -1154,4 +1155,14 @@ public class WidgetID
|
|||||||
{
|
{
|
||||||
static final int INFO = 4;
|
static final int INFO = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class JewelBox
|
||||||
|
{
|
||||||
|
static final int DUEL_RING = 2;
|
||||||
|
static final int GAME_NECK = 3;
|
||||||
|
static final int COMB_BRAC = 4;
|
||||||
|
static final int SKIL_NECK = 5;
|
||||||
|
static final int RING_OFGP = 6;
|
||||||
|
static final int AMUL_GLOR = 7; // yes
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -767,7 +767,14 @@ public enum WidgetInfo
|
|||||||
|
|
||||||
SEED_VAULT_TITLE_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.TITLE_CONTAINER),
|
SEED_VAULT_TITLE_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.TITLE_CONTAINER),
|
||||||
SEED_VAULT_ITEM_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_CONTAINER),
|
SEED_VAULT_ITEM_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_CONTAINER),
|
||||||
SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT);
|
SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT),
|
||||||
|
|
||||||
|
JEWELLERY_BOX_DUEL_RING(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.DUEL_RING),
|
||||||
|
JEWELLERY_BOX_GAME_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.GAME_NECK),
|
||||||
|
JEWELLERY_BOX_COMB_BRAC(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.COMB_BRAC),
|
||||||
|
JEWELLERY_BOX_SKIL_NECK(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.SKIL_NECK),
|
||||||
|
JEWELLERY_BOX_RING_OFGP(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.RING_OFGP),
|
||||||
|
JEWELLERY_BOX_AMUL_GLOR(WidgetID.JEWELLERY_BOX_GROUP_ID, WidgetID.JewelBox.AMUL_GLOR);
|
||||||
|
|
||||||
private final int groupId;
|
private final int groupId;
|
||||||
private final int childId;
|
private final int childId;
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import java.util.Objects;
|
|||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.events.Event;
|
import net.runelite.api.events.Event;
|
||||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
@@ -55,8 +54,7 @@ public class EventBus implements EventBusInterface
|
|||||||
.cast(eventClass) // Cast it for easier usage
|
.cast(eventClass) // Cast it for easier usage
|
||||||
.subscribe(action, error ->
|
.subscribe(action, error ->
|
||||||
{
|
{
|
||||||
log.error("Error in eventbus: {}", error.getMessage());
|
log.error("Error in eventbus", error);
|
||||||
log.error(ExceptionUtils.getStackTrace(error));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
getCompositeDisposable(lifecycle).add(disposable);
|
getCompositeDisposable(lifecycle).add(disposable);
|
||||||
|
|||||||
@@ -291,11 +291,6 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
modelBufferSmall = new GpuIntBuffer();
|
modelBufferSmall = new GpuIntBuffer();
|
||||||
modelBuffer = new GpuIntBuffer();
|
modelBuffer = new GpuIntBuffer();
|
||||||
|
|
||||||
if (log.isDebugEnabled())
|
|
||||||
{
|
|
||||||
System.setProperty("jogl.debug", "true");
|
|
||||||
}
|
|
||||||
|
|
||||||
GLProfile.initSingleton();
|
GLProfile.initSingleton();
|
||||||
|
|
||||||
GLProfile glProfile = GLProfile.get(GLProfile.GL4);
|
GLProfile glProfile = GLProfile.get(GLProfile.GL4);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* Copyright (c) 2018, Adam <Adam@sigterm.info>
|
* Copyright (c) 2018, Adam <Adam@sigterm.info>
|
||||||
* Copyright (c) 2019, alanbaumgartner <https://github.com/alanbaumgartner>
|
* Copyright (c) 2019, alanbaumgartner <https://github.com/alanbaumgartner>
|
||||||
* Copyright (c) 2019, Kyle <https://github.com/kyleeld>
|
* Copyright (c) 2019, Kyle <https://github.com/kyleeld>
|
||||||
* Copyright (c) 2019, lucouswin <https://github.com/lucouswin>
|
* Copyright (c) 2019, Lucas <https://github.com/lucwousin>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -1292,6 +1292,17 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
// Teleportation
|
// Teleportation
|
||||||
//------------------------------------------------------------//
|
//------------------------------------------------------------//
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "lastJewel",
|
||||||
|
name = "Last Destination for Jewellery Box",
|
||||||
|
description = "Adds a \"Last-destination\" menu option when Jewellery Boxes are right clicked",
|
||||||
|
section = "teleportationSection"
|
||||||
|
)
|
||||||
|
default boolean lastJewel()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "swapFairyRing",
|
keyName = "swapFairyRing",
|
||||||
name = "Fairy Ring",
|
name = "Fairy Ring",
|
||||||
@@ -1913,4 +1924,23 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
{
|
{
|
||||||
return "cure other, energy transfer, heal other, vengeance other";
|
return "cure other, energy transfer, heal other, vengeance other";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "lastDes",
|
||||||
|
name = "",
|
||||||
|
description = "Last jewellery box destination (option)",
|
||||||
|
hidden = true
|
||||||
|
)
|
||||||
|
default String lastDes()
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "lastDes",
|
||||||
|
name = "",
|
||||||
|
description = "Last jewellery box destination (option)",
|
||||||
|
hidden = true
|
||||||
|
)
|
||||||
|
void lastDes(String des);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* Copyright (c) 2018, Kamiel
|
* Copyright (c) 2018, Kamiel
|
||||||
* Copyright (c) 2019, alanbaumgartner <https://github.com/alanbaumgartner>
|
* Copyright (c) 2019, alanbaumgartner <https://github.com/alanbaumgartner>
|
||||||
* Copyright (c) 2019, Kyle <https://github.com/kyleeld>
|
* Copyright (c) 2019, Kyle <https://github.com/kyleeld>
|
||||||
* Copyright (c) 2019, lucouswin <https://github.com/lucouswin>
|
* Copyright (c) 2019, Lucas <https://github.com/lucwousin>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -65,10 +65,16 @@ import net.runelite.api.events.ClientTick;
|
|||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.FocusChanged;
|
import net.runelite.api.events.FocusChanged;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
|
import net.runelite.api.events.Menu;
|
||||||
import net.runelite.api.events.MenuEntryAdded;
|
import net.runelite.api.events.MenuEntryAdded;
|
||||||
import net.runelite.api.events.MenuOpened;
|
import net.runelite.api.events.MenuOpened;
|
||||||
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
|
import net.runelite.api.events.ScriptCallbackEvent;
|
||||||
import net.runelite.api.events.VarbitChanged;
|
import net.runelite.api.events.VarbitChanged;
|
||||||
import net.runelite.api.util.Text;
|
import net.runelite.api.util.Text;
|
||||||
|
import net.runelite.api.widgets.Widget;
|
||||||
|
import net.runelite.api.widgets.WidgetID;
|
||||||
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.callback.ClientThread;
|
import net.runelite.client.callback.ClientThread;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.config.Keybind;
|
import net.runelite.client.config.Keybind;
|
||||||
@@ -102,6 +108,7 @@ import net.runelite.client.plugins.menuentryswapper.util.GamesNecklaceMode;
|
|||||||
import net.runelite.client.plugins.menuentryswapper.util.GloryMode;
|
import net.runelite.client.plugins.menuentryswapper.util.GloryMode;
|
||||||
import net.runelite.client.plugins.menuentryswapper.util.HouseAdvertisementMode;
|
import net.runelite.client.plugins.menuentryswapper.util.HouseAdvertisementMode;
|
||||||
import net.runelite.client.plugins.menuentryswapper.util.HouseMode;
|
import net.runelite.client.plugins.menuentryswapper.util.HouseMode;
|
||||||
|
import net.runelite.client.plugins.menuentryswapper.util.JewelleryBoxDestination;
|
||||||
import net.runelite.client.plugins.menuentryswapper.util.MaxCapeMode;
|
import net.runelite.client.plugins.menuentryswapper.util.MaxCapeMode;
|
||||||
import net.runelite.client.plugins.menuentryswapper.util.NecklaceOfPassageMode;
|
import net.runelite.client.plugins.menuentryswapper.util.NecklaceOfPassageMode;
|
||||||
import net.runelite.client.plugins.menuentryswapper.util.ObeliskMode;
|
import net.runelite.client.plugins.menuentryswapper.util.ObeliskMode;
|
||||||
@@ -115,6 +122,7 @@ import net.runelite.client.plugins.pvptools.PvpToolsConfig;
|
|||||||
import net.runelite.client.plugins.pvptools.PvpToolsPlugin;
|
import net.runelite.client.plugins.pvptools.PvpToolsPlugin;
|
||||||
import net.runelite.client.util.HotkeyListener;
|
import net.runelite.client.util.HotkeyListener;
|
||||||
import static net.runelite.client.util.MenuUtil.swap;
|
import static net.runelite.client.util.MenuUtil.swap;
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Menu Entry Swapper",
|
name = "Menu Entry Swapper",
|
||||||
@@ -127,10 +135,14 @@ import static net.runelite.client.util.MenuUtil.swap;
|
|||||||
@PluginDependency(PvpToolsPlugin.class)
|
@PluginDependency(PvpToolsPlugin.class)
|
||||||
public class MenuEntrySwapperPlugin extends Plugin
|
public class MenuEntrySwapperPlugin extends Plugin
|
||||||
{
|
{
|
||||||
private static final String HOTKEY = "menuentryswapper hotkey";
|
private static final Object HOTKEY = new Object();
|
||||||
private static final String CONTROL = "menuentryswapper control";
|
private static final Object CONTROL = new Object();
|
||||||
private static final String HOTKEY_CHECK = "menuentryswapper hotkey check";
|
private static final Object HOTKEY_CHECK = new Object();
|
||||||
private static final String CONTROL_CHECK = "menuentryswapper control check";
|
private static final Object CONTROL_CHECK = new Object();
|
||||||
|
private static final Object JEWEL_CLICKED = new Object();
|
||||||
|
private static final Object JEWEL_TELE = new Object();
|
||||||
|
private static final Object JEWEL_WIDGET = new Object();
|
||||||
|
|
||||||
private static final int PURO_PURO_REGION_ID = 10307;
|
private static final int PURO_PURO_REGION_ID = 10307;
|
||||||
private static final Set<MenuOpcode> NPC_MENU_TYPES = ImmutableSet.of(
|
private static final Set<MenuOpcode> NPC_MENU_TYPES = ImmutableSet.of(
|
||||||
MenuOpcode.NPC_FIRST_OPTION, MenuOpcode.NPC_SECOND_OPTION, MenuOpcode.NPC_THIRD_OPTION,
|
MenuOpcode.NPC_FIRST_OPTION, MenuOpcode.NPC_SECOND_OPTION, MenuOpcode.NPC_THIRD_OPTION,
|
||||||
@@ -286,6 +298,8 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
private boolean swapTravel;
|
private boolean swapTravel;
|
||||||
private boolean swapWildernessLever;
|
private boolean swapWildernessLever;
|
||||||
|
|
||||||
|
private JewelleryBoxDestination lastDes;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
MenuEntrySwapperConfig provideConfig(ConfigManager configManager)
|
MenuEntrySwapperConfig provideConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -295,6 +309,8 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
public void startUp()
|
public void startUp()
|
||||||
{
|
{
|
||||||
|
this.lastDes = JewelleryBoxDestination.withOption(config.lastDes());
|
||||||
|
|
||||||
migrateConfig();
|
migrateConfig();
|
||||||
updateConfig();
|
updateConfig();
|
||||||
addSubscriptions();
|
addSubscriptions();
|
||||||
@@ -346,6 +362,11 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
eventBus.subscribe(MenuOpened.class, this, this::onMenuOpened);
|
eventBus.subscribe(MenuOpened.class, this, this::onMenuOpened);
|
||||||
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded);
|
||||||
eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
||||||
|
|
||||||
|
if (config.lastJewel())
|
||||||
|
{
|
||||||
|
eventBus.subscribe(MenuOptionClicked.class, JEWEL_CLICKED, this::onMenuOptionClicked);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onFocusChanged(FocusChanged event)
|
private void onFocusChanged(FocusChanged event)
|
||||||
@@ -400,6 +421,16 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
case "removedObjects":
|
case "removedObjects":
|
||||||
updateRemovedObjects();
|
updateRemovedObjects();
|
||||||
return;
|
return;
|
||||||
|
case "lastJewel":
|
||||||
|
if (config.lastJewel())
|
||||||
|
{
|
||||||
|
eventBus.subscribe(MenuOptionClicked.class, JEWEL_CLICKED, this::onMenuOptionClicked);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
eventBus.unregister(JEWEL_CLICKED);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getKey().startsWith("swapSell") || event.getKey().startsWith("swapBuy") ||
|
if (event.getKey().startsWith("swapSell") || event.getKey().startsWith("swapBuy") ||
|
||||||
@@ -524,6 +555,21 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.lastJewel() && option.equals("teleport") && entry.getTarget().contains("Jewellery Box") && lastDes != null)
|
||||||
|
{
|
||||||
|
final MenuEntry lastDesEntry = new MenuEntry();
|
||||||
|
|
||||||
|
lastDesEntry.setOpcode(MenuOpcode.PRIO_RUNELITE.getId());
|
||||||
|
lastDesEntry.setOption(lastDes.getOption());
|
||||||
|
|
||||||
|
lastDesEntry.setTarget(entry.getTarget());
|
||||||
|
lastDesEntry.setIdentifier(entry.getIdentifier());
|
||||||
|
lastDesEntry.setParam0(entry.getParam0());
|
||||||
|
lastDesEntry.setParam1(entry.getParam1());
|
||||||
|
|
||||||
|
menu_entries.add(lastDesEntry);
|
||||||
|
}
|
||||||
|
|
||||||
menu_entries.add(entry);
|
menu_entries.add(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -676,6 +722,84 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onMenuOptionClicked(MenuOptionClicked event)
|
||||||
|
{
|
||||||
|
if (event.getOpcode() == MenuOpcode.WIDGET_DEFAULT.getId() &&
|
||||||
|
WidgetInfo.TO_GROUP(event.getActionParam1()) == WidgetID.JEWELLERY_BOX_GROUP_ID)
|
||||||
|
{
|
||||||
|
if (event.getOption().equals(lastDes == null ? null : lastDes.getOption()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
JewelleryBoxDestination newDest = JewelleryBoxDestination.withOption(event.getOption());
|
||||||
|
if (newDest == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastDes = newDest;
|
||||||
|
config.lastDes(lastDes.getOption());
|
||||||
|
}
|
||||||
|
else if (event.getOption().equals("Teleport") && event.getTarget().contains("Jewellery Box"))
|
||||||
|
{
|
||||||
|
eventBus.unregister("wait for widget");
|
||||||
|
}
|
||||||
|
else if (lastDes != null &&
|
||||||
|
event.getOpcode() == MenuOpcode.PRIO_RUNELITE.getId() &&
|
||||||
|
event.getOption().equals(lastDes.getOption()))
|
||||||
|
{
|
||||||
|
MenuEntry e = event.getMenuEntry();
|
||||||
|
e.setOption("Teleport");
|
||||||
|
e.setOpcode(MenuOpcode.GAME_OBJECT_FIRST_OPTION.getId());
|
||||||
|
|
||||||
|
eventBus.subscribe(ScriptCallbackEvent.class, JEWEL_WIDGET, this::onScriptCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onScriptCallback(ScriptCallbackEvent event)
|
||||||
|
{
|
||||||
|
if (!event.getEventName().equals("jewelleryBoxDone"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
eventBus.unregister(JEWEL_WIDGET);
|
||||||
|
|
||||||
|
// Use a event so we don't accidentally run another script before returning
|
||||||
|
// menu also is when jagex is probably expecting input like this so :)
|
||||||
|
eventBus.subscribe(Menu.class, JEWEL_TELE, this::teleportInputs);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void teleportInputs(Menu menu)
|
||||||
|
{
|
||||||
|
final Widget parent = client.getWidget(lastDes.getParent());
|
||||||
|
if (parent == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Widget child = parent.getChild(lastDes.getChildIndex());
|
||||||
|
if (child == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Object[] args = child.getOnOp();
|
||||||
|
if (args == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replace opIndex with 1
|
||||||
|
args[ArrayUtils.indexOf(args, 0x80000004)] = 1;
|
||||||
|
|
||||||
|
client.runScript(args);
|
||||||
|
eventBus.unregister(JEWEL_TELE);
|
||||||
|
|
||||||
|
menu.dontRun();
|
||||||
|
}
|
||||||
|
|
||||||
private void loadCustomSwaps(String config, Map<AbstractComparableEntry, Integer> map)
|
private void loadCustomSwaps(String config, Map<AbstractComparableEntry, Integer> map)
|
||||||
{
|
{
|
||||||
final Map<AbstractComparableEntry, Integer> tmp = new HashMap<>();
|
final Map<AbstractComparableEntry, Integer> tmp = new HashMap<>();
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2019, Lucas <https://github.com/lucwousin>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package net.runelite.client.plugins.menuentryswapper.util;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
|
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum JewelleryBoxDestination
|
||||||
|
{
|
||||||
|
DUEL_ARENA("Duel Arena", WidgetInfo.JEWELLERY_BOX_DUEL_RING, 5),
|
||||||
|
CASTLE_WARS("Castle Wars", WidgetInfo.JEWELLERY_BOX_DUEL_RING, 6),
|
||||||
|
CLAN_WARS("Clan Wars", WidgetInfo.JEWELLERY_BOX_DUEL_RING, 7),
|
||||||
|
|
||||||
|
BURTHORPE("Burthorpe", WidgetInfo.JEWELLERY_BOX_GAME_NECK, 5),
|
||||||
|
BARB_OUTPOST("Barbarian Outpost", WidgetInfo.JEWELLERY_BOX_GAME_NECK, 6),
|
||||||
|
CORP("Corporeal Beast", WidgetInfo.JEWELLERY_BOX_GAME_NECK, 7),
|
||||||
|
TEARS_OF_GUTHIX("Tears of Guthix", WidgetInfo.JEWELLERY_BOX_GAME_NECK, 8),
|
||||||
|
WINTERTODT("Wintertodt Camp", WidgetInfo.JEWELLERY_BOX_GAME_NECK, 9),
|
||||||
|
|
||||||
|
WARRIOR_GUILD("Warriors' Guild", WidgetInfo.JEWELLERY_BOX_COMB_BRAC, 5),
|
||||||
|
CHAMPION_GUILD("Champions' Guild", WidgetInfo.JEWELLERY_BOX_COMB_BRAC, 6),
|
||||||
|
MONASTERY("Monastery", WidgetInfo.JEWELLERY_BOX_COMB_BRAC, 7),
|
||||||
|
RANGING_GUILD("Ranging Guild", WidgetInfo.JEWELLERY_BOX_COMB_BRAC, 8),
|
||||||
|
|
||||||
|
FISHING_GUILD("Fishing Guild", WidgetInfo.JEWELLERY_BOX_SKIL_NECK, 5),
|
||||||
|
MINING_GUILD("Mining Guild", WidgetInfo.JEWELLERY_BOX_SKIL_NECK, 6),
|
||||||
|
CRAFTING_GUILD("Crafting Guild", WidgetInfo.JEWELLERY_BOX_SKIL_NECK, 7),
|
||||||
|
COOKING_GUILD("Cooking Guild", WidgetInfo.JEWELLERY_BOX_SKIL_NECK, 8),
|
||||||
|
WOODCUTTING_GUILD("Woodcutting Guild", WidgetInfo.JEWELLERY_BOX_SKIL_NECK, 9),
|
||||||
|
FARMING_GUILD("Farming Guild", WidgetInfo.JEWELLERY_BOX_SKIL_NECK, 10),
|
||||||
|
|
||||||
|
MISCELLANIA("Miscellania", WidgetInfo.JEWELLERY_BOX_RING_OFGP, 5),
|
||||||
|
GRAND_EXCHANGE("Grand Exchange", WidgetInfo.JEWELLERY_BOX_RING_OFGP, 6),
|
||||||
|
FALADOR_PARK("Falador Park", WidgetInfo.JEWELLERY_BOX_RING_OFGP, 7),
|
||||||
|
DONDAKAN("Dondakan's Rock", WidgetInfo.JEWELLERY_BOX_RING_OFGP, 8),
|
||||||
|
|
||||||
|
EDGEVILLE("Edgeville", WidgetInfo.JEWELLERY_BOX_AMUL_GLOR, 5),
|
||||||
|
KARAMJA("Karamja", WidgetInfo.JEWELLERY_BOX_AMUL_GLOR, 6),
|
||||||
|
DRAYNOR("Draynor Village", WidgetInfo.JEWELLERY_BOX_AMUL_GLOR, 7),
|
||||||
|
AL_KHARID("Al Kharid", WidgetInfo.JEWELLERY_BOX_AMUL_GLOR, 8);
|
||||||
|
|
||||||
|
final String option;
|
||||||
|
final WidgetInfo parent;
|
||||||
|
final int childIndex;
|
||||||
|
|
||||||
|
private static final ImmutableMap<String, JewelleryBoxDestination> map;
|
||||||
|
static
|
||||||
|
{
|
||||||
|
final ImmutableMap.Builder<String, JewelleryBoxDestination> builder = ImmutableMap.builderWithExpectedSize(values().length);
|
||||||
|
for (JewelleryBoxDestination val : values())
|
||||||
|
{
|
||||||
|
builder.put(val.option, val);
|
||||||
|
}
|
||||||
|
map = builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JewelleryBoxDestination withOption(String option)
|
||||||
|
{
|
||||||
|
return map.get(option);
|
||||||
|
}
|
||||||
|
}
|
||||||
1
runelite-client/src/main/scripts/JewelleryBoxInit.hash
Normal file
1
runelite-client/src/main/scripts/JewelleryBoxInit.hash
Normal file
@@ -0,0 +1 @@
|
|||||||
|
8C575721ABBD408F564BB6A93894BEFC4D7928A6FBF0218FE5F5E68BD9354C3C
|
||||||
637
runelite-client/src/main/scripts/JewelleryBoxInit.rs2asm
Normal file
637
runelite-client/src/main/scripts/JewelleryBoxInit.rs2asm
Normal file
@@ -0,0 +1,637 @@
|
|||||||
|
.id 1685
|
||||||
|
.int_stack_count 2
|
||||||
|
.string_stack_count 1
|
||||||
|
.int_var_count 15
|
||||||
|
.string_var_count 2
|
||||||
|
invoke 2157
|
||||||
|
iconst 38666241
|
||||||
|
sload 0
|
||||||
|
iconst 0
|
||||||
|
invoke 228
|
||||||
|
pop_int
|
||||||
|
iconst 38666240
|
||||||
|
cc_deleteall
|
||||||
|
iconst 0
|
||||||
|
istore 2
|
||||||
|
iconst 0
|
||||||
|
istore 3
|
||||||
|
iconst 38666240
|
||||||
|
if_getwidth
|
||||||
|
istore 4
|
||||||
|
iload 4
|
||||||
|
iconst 10
|
||||||
|
sub
|
||||||
|
iconst 10
|
||||||
|
sub
|
||||||
|
iconst 5
|
||||||
|
sub
|
||||||
|
istore 4
|
||||||
|
iload 4
|
||||||
|
iconst 2
|
||||||
|
div
|
||||||
|
istore 5
|
||||||
|
iconst 38666240
|
||||||
|
if_getheight
|
||||||
|
istore 6
|
||||||
|
iload 6
|
||||||
|
iconst 40
|
||||||
|
sub
|
||||||
|
iconst 10
|
||||||
|
sub
|
||||||
|
iconst 5
|
||||||
|
sub
|
||||||
|
iconst 5
|
||||||
|
sub
|
||||||
|
istore 6
|
||||||
|
iconst 0
|
||||||
|
istore 7
|
||||||
|
iconst 0
|
||||||
|
istore 8
|
||||||
|
iconst 0
|
||||||
|
istore 9
|
||||||
|
iconst 5
|
||||||
|
istore 10
|
||||||
|
iconst 6
|
||||||
|
istore 11
|
||||||
|
iconst 4
|
||||||
|
istore 12
|
||||||
|
iload 10
|
||||||
|
iload 11
|
||||||
|
add
|
||||||
|
iload 12
|
||||||
|
add
|
||||||
|
istore 13
|
||||||
|
iload 10
|
||||||
|
iload 13
|
||||||
|
iload 6
|
||||||
|
scale
|
||||||
|
istore 7
|
||||||
|
iload 11
|
||||||
|
iload 13
|
||||||
|
iload 6
|
||||||
|
scale
|
||||||
|
istore 8
|
||||||
|
iload 12
|
||||||
|
iload 13
|
||||||
|
iload 6
|
||||||
|
scale
|
||||||
|
istore 9
|
||||||
|
iload 5
|
||||||
|
iload 7
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666242
|
||||||
|
if_setsize
|
||||||
|
iconst 10
|
||||||
|
iconst 40
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666242
|
||||||
|
if_setposition
|
||||||
|
iload 5
|
||||||
|
iload 7
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666243
|
||||||
|
if_setsize
|
||||||
|
iconst 10
|
||||||
|
iload 5
|
||||||
|
add
|
||||||
|
iconst 5
|
||||||
|
add
|
||||||
|
iconst 40
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666243
|
||||||
|
if_setposition
|
||||||
|
iload 5
|
||||||
|
iload 8
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666244
|
||||||
|
if_setsize
|
||||||
|
iconst 10
|
||||||
|
iconst 40
|
||||||
|
iload 7
|
||||||
|
add
|
||||||
|
iconst 5
|
||||||
|
add
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666244
|
||||||
|
if_setposition
|
||||||
|
iload 5
|
||||||
|
iload 8
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666245
|
||||||
|
if_setsize
|
||||||
|
iconst 10
|
||||||
|
iload 5
|
||||||
|
add
|
||||||
|
iconst 5
|
||||||
|
add
|
||||||
|
iconst 40
|
||||||
|
iload 7
|
||||||
|
add
|
||||||
|
iconst 5
|
||||||
|
add
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666245
|
||||||
|
if_setposition
|
||||||
|
iload 5
|
||||||
|
iload 9
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666246
|
||||||
|
if_setsize
|
||||||
|
iconst 10
|
||||||
|
iconst 40
|
||||||
|
iload 7
|
||||||
|
add
|
||||||
|
iload 8
|
||||||
|
add
|
||||||
|
iconst 5
|
||||||
|
add
|
||||||
|
iconst 5
|
||||||
|
add
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666246
|
||||||
|
if_setposition
|
||||||
|
iload 5
|
||||||
|
iload 9
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666247
|
||||||
|
if_setsize
|
||||||
|
iconst 10
|
||||||
|
iload 5
|
||||||
|
add
|
||||||
|
iconst 5
|
||||||
|
add
|
||||||
|
iconst 40
|
||||||
|
iload 7
|
||||||
|
add
|
||||||
|
iload 8
|
||||||
|
add
|
||||||
|
iconst 5
|
||||||
|
add
|
||||||
|
iconst 5
|
||||||
|
add
|
||||||
|
iconst 0
|
||||||
|
iconst 0
|
||||||
|
iconst 38666247
|
||||||
|
if_setposition
|
||||||
|
iconst 38666242
|
||||||
|
iconst 1
|
||||||
|
sconst "Ring of Dueling"
|
||||||
|
iconst 2552
|
||||||
|
iload 0
|
||||||
|
invoke 1686
|
||||||
|
istore 14
|
||||||
|
iconst 38666242
|
||||||
|
iconst 3
|
||||||
|
invoke 1687
|
||||||
|
istore 3
|
||||||
|
istore 2
|
||||||
|
iconst 38666242
|
||||||
|
iconst 1
|
||||||
|
sconst "Duel Arena"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 0
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666242
|
||||||
|
iconst 1
|
||||||
|
sconst "Castle Wars"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 1
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666242
|
||||||
|
iconst 1
|
||||||
|
sconst "Clan Wars"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 2
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666243
|
||||||
|
iconst 1
|
||||||
|
sconst "Games Necklace"
|
||||||
|
iconst 3853
|
||||||
|
iload 0
|
||||||
|
invoke 1686
|
||||||
|
istore 14
|
||||||
|
iconst 38666243
|
||||||
|
iconst 5
|
||||||
|
invoke 1687
|
||||||
|
istore 3
|
||||||
|
istore 2
|
||||||
|
iconst 38666243
|
||||||
|
iconst 1
|
||||||
|
sconst "Burthorpe"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 3
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666243
|
||||||
|
iconst 1
|
||||||
|
sconst "Barbarian Outpost"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 4
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666243
|
||||||
|
iconst 1
|
||||||
|
sconst "Corporeal Beast"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 5
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
sconst "Tears of Guthix"
|
||||||
|
sstore 1
|
||||||
|
iload 1
|
||||||
|
iconst 0
|
||||||
|
testbit
|
||||||
|
iconst 0
|
||||||
|
if_icmpeq LABEL279
|
||||||
|
jump LABEL284
|
||||||
|
LABEL279:
|
||||||
|
sconst "<str>"
|
||||||
|
sload 1
|
||||||
|
sconst "</str>"
|
||||||
|
join_string 3
|
||||||
|
sstore 1
|
||||||
|
LABEL284:
|
||||||
|
iconst 38666243
|
||||||
|
iconst 1
|
||||||
|
sload 1
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 6
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
sconst "Wintertodt Camp"
|
||||||
|
sstore 1
|
||||||
|
iload 1
|
||||||
|
iconst 1
|
||||||
|
testbit
|
||||||
|
iconst 0
|
||||||
|
if_icmpeq LABEL303
|
||||||
|
jump LABEL308
|
||||||
|
LABEL303:
|
||||||
|
sconst "<str>"
|
||||||
|
sload 1
|
||||||
|
sconst "</str>"
|
||||||
|
join_string 3
|
||||||
|
sstore 1
|
||||||
|
LABEL308:
|
||||||
|
iconst 38666243
|
||||||
|
iconst 1
|
||||||
|
sload 1
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 7
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666244
|
||||||
|
iconst 2
|
||||||
|
sconst "Combat bracelet"
|
||||||
|
iconst 11972
|
||||||
|
iload 0
|
||||||
|
invoke 1686
|
||||||
|
istore 14
|
||||||
|
iconst 38666244
|
||||||
|
iconst 4
|
||||||
|
invoke 1687
|
||||||
|
istore 3
|
||||||
|
istore 2
|
||||||
|
iconst 38666244
|
||||||
|
iconst 2
|
||||||
|
sconst "Warriors' Guild"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 8
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666244
|
||||||
|
iconst 2
|
||||||
|
sconst "Champions' Guild"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 9
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666244
|
||||||
|
iconst 2
|
||||||
|
sconst "Monastery"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 10
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666244
|
||||||
|
iconst 2
|
||||||
|
sconst "Ranging Guild"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 11
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666245
|
||||||
|
iconst 2
|
||||||
|
sconst "Skills necklace"
|
||||||
|
iconst 11968
|
||||||
|
iload 0
|
||||||
|
invoke 1686
|
||||||
|
istore 14
|
||||||
|
iconst 38666245
|
||||||
|
iconst 6
|
||||||
|
invoke 1687
|
||||||
|
istore 3
|
||||||
|
istore 2
|
||||||
|
iconst 38666245
|
||||||
|
iconst 2
|
||||||
|
sconst "Fishing Guild"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 12
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666245
|
||||||
|
iconst 2
|
||||||
|
sconst "Mining Guild"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 13
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666245
|
||||||
|
iconst 2
|
||||||
|
sconst "Crafting Guild"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 14
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666245
|
||||||
|
iconst 2
|
||||||
|
sconst "Cooking Guild"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 15
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
sconst "Woodcutting Guild"
|
||||||
|
sstore 1
|
||||||
|
iload 1
|
||||||
|
iconst 1
|
||||||
|
testbit
|
||||||
|
iconst 0
|
||||||
|
if_icmpeq LABEL439
|
||||||
|
jump LABEL444
|
||||||
|
LABEL439:
|
||||||
|
sconst "<str>"
|
||||||
|
sload 1
|
||||||
|
sconst "</str>"
|
||||||
|
join_string 3
|
||||||
|
sstore 1
|
||||||
|
LABEL444:
|
||||||
|
iconst 38666245
|
||||||
|
iconst 2
|
||||||
|
sload 1
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 16
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
sconst "Farming Guild"
|
||||||
|
sstore 1
|
||||||
|
iload 1
|
||||||
|
iconst 1
|
||||||
|
testbit
|
||||||
|
iconst 0
|
||||||
|
if_icmpeq LABEL463
|
||||||
|
jump LABEL468
|
||||||
|
LABEL463:
|
||||||
|
sconst "<str>"
|
||||||
|
sload 1
|
||||||
|
sconst "</str>"
|
||||||
|
join_string 3
|
||||||
|
sstore 1
|
||||||
|
LABEL468:
|
||||||
|
iconst 38666245
|
||||||
|
iconst 2
|
||||||
|
sload 1
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 17
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666246
|
||||||
|
iconst 3
|
||||||
|
sconst "Ring of Wealth"
|
||||||
|
iconst 11980
|
||||||
|
iload 0
|
||||||
|
invoke 1686
|
||||||
|
istore 14
|
||||||
|
iconst 38666246
|
||||||
|
iconst 4
|
||||||
|
invoke 1687
|
||||||
|
istore 3
|
||||||
|
istore 2
|
||||||
|
sconst "Miscellania"
|
||||||
|
sstore 1
|
||||||
|
iload 1
|
||||||
|
iconst 2
|
||||||
|
testbit
|
||||||
|
iconst 0
|
||||||
|
if_icmpeq LABEL499
|
||||||
|
jump LABEL504
|
||||||
|
LABEL499:
|
||||||
|
sconst "<str>"
|
||||||
|
sload 1
|
||||||
|
sconst "</str>"
|
||||||
|
join_string 3
|
||||||
|
sstore 1
|
||||||
|
LABEL504:
|
||||||
|
iconst 38666246
|
||||||
|
iconst 3
|
||||||
|
sload 1
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 18
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666246
|
||||||
|
iconst 3
|
||||||
|
sconst "Grand Exchange"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 19
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666246
|
||||||
|
iconst 3
|
||||||
|
sconst "Falador Park"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 20
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
sconst "Dondakan's Rock"
|
||||||
|
sstore 1
|
||||||
|
iload 1
|
||||||
|
iconst 3
|
||||||
|
testbit
|
||||||
|
iconst 0
|
||||||
|
if_icmpeq LABEL545
|
||||||
|
jump LABEL550
|
||||||
|
LABEL545:
|
||||||
|
sconst "<str>"
|
||||||
|
sload 1
|
||||||
|
sconst "</str>"
|
||||||
|
join_string 3
|
||||||
|
sstore 1
|
||||||
|
LABEL550:
|
||||||
|
iconst 38666246
|
||||||
|
iconst 3
|
||||||
|
sload 1
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 21
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666247
|
||||||
|
iconst 3
|
||||||
|
sconst "Amulet of Glory"
|
||||||
|
iconst 11978
|
||||||
|
iload 0
|
||||||
|
invoke 1686
|
||||||
|
istore 14
|
||||||
|
iconst 38666247
|
||||||
|
iconst 4
|
||||||
|
invoke 1687
|
||||||
|
istore 3
|
||||||
|
istore 2
|
||||||
|
iconst 38666247
|
||||||
|
iconst 3
|
||||||
|
sconst "Edgeville"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 22
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666247
|
||||||
|
iconst 3
|
||||||
|
sconst "Karamja"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 23
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666247
|
||||||
|
iconst 3
|
||||||
|
sconst "Draynor Village"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 24
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
iconst 38666247
|
||||||
|
iconst 3
|
||||||
|
sconst "Al Kharid"
|
||||||
|
iload 3
|
||||||
|
iload 0
|
||||||
|
iload 14
|
||||||
|
iload 2
|
||||||
|
iconst 25
|
||||||
|
invoke 1688
|
||||||
|
istore 2
|
||||||
|
istore 14
|
||||||
|
sconst "jewelleryBoxDone"
|
||||||
|
runelite_callback
|
||||||
|
return
|
||||||
@@ -86,6 +86,7 @@ import net.runelite.api.events.DraggingWidgetChanged;
|
|||||||
import net.runelite.api.events.ExperienceChanged;
|
import net.runelite.api.events.ExperienceChanged;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.GrandExchangeOfferChanged;
|
import net.runelite.api.events.GrandExchangeOfferChanged;
|
||||||
|
import net.runelite.api.events.Menu;
|
||||||
import net.runelite.api.events.MenuEntryAdded;
|
import net.runelite.api.events.MenuEntryAdded;
|
||||||
import net.runelite.api.events.MenuOpened;
|
import net.runelite.api.events.MenuOpened;
|
||||||
import net.runelite.api.events.MenuOptionClicked;
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
@@ -1672,6 +1673,24 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Copy("menu")
|
||||||
|
void rs$menu()
|
||||||
|
{
|
||||||
|
throw new RuntimeException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Replace("menu")
|
||||||
|
void rl$menu()
|
||||||
|
{
|
||||||
|
Menu menu = Menu.MENU;
|
||||||
|
menu.reset();
|
||||||
|
getCallbacks().post(Menu.class, menu);
|
||||||
|
if (menu.shouldRun())
|
||||||
|
{
|
||||||
|
rs$menu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public EnumDefinition getEnum(int id)
|
public EnumDefinition getEnum(int id)
|
||||||
|
|||||||
@@ -320,6 +320,10 @@ public interface RSWidget extends Widget
|
|||||||
@Override
|
@Override
|
||||||
Object[] getOnLoadListener();
|
Object[] getOnLoadListener();
|
||||||
|
|
||||||
|
@Import("onOp")
|
||||||
|
@Override
|
||||||
|
Object[] getOnOp();
|
||||||
|
|
||||||
@Import("onDialogAbort")
|
@Import("onDialogAbort")
|
||||||
@Override
|
@Override
|
||||||
void setOnDialogAbortListener(Object... args);
|
void setOnDialogAbortListener(Object... args);
|
||||||
|
|||||||
@@ -3209,7 +3209,7 @@ public final class Client extends GameShell implements Usernamed {
|
|||||||
do {
|
do {
|
||||||
var40 = (ScriptEvent)scriptEvents.removeLast();
|
var40 = (ScriptEvent)scriptEvents.removeLast();
|
||||||
if (var40 == null) {
|
if (var40 == null) {
|
||||||
this.method1323();
|
this.menu();
|
||||||
if (Tiles.worldMap != null) {
|
if (Tiles.worldMap != null) {
|
||||||
Tiles.worldMap.method6272(WorldMapRectangle.plane, class223.baseX * 64 + (class223.localPlayer.x >> 7), class286.baseY * 64 + (class223.localPlayer.y >> 7), false);
|
Tiles.worldMap.method6272(WorldMapRectangle.plane, class223.baseX * 64 + (class223.localPlayer.x >> 7), class286.baseY * 64 + (class223.localPlayer.y >> 7), false);
|
||||||
Tiles.worldMap.loadCache();
|
Tiles.worldMap.loadCache();
|
||||||
@@ -5105,7 +5105,8 @@ public final class Client extends GameShell implements Usernamed {
|
|||||||
signature = "(S)V",
|
signature = "(S)V",
|
||||||
garbageValue = "255"
|
garbageValue = "255"
|
||||||
)
|
)
|
||||||
final void method1323() {
|
@Export("menu")
|
||||||
|
final void menu() {
|
||||||
boolean var1 = false;
|
boolean var1 = false;
|
||||||
|
|
||||||
int var2;
|
int var2;
|
||||||
@@ -5185,7 +5186,7 @@ public final class Client extends GameShell implements Usernamed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (var7 != -1) {
|
if (var7 != -1) {
|
||||||
ModelData0.method3214(var7);
|
ModelData0.clickMenuIndex(var7);
|
||||||
}
|
}
|
||||||
|
|
||||||
isMenuOpen = false;
|
isMenuOpen = false;
|
||||||
@@ -5238,7 +5239,7 @@ public final class Client extends GameShell implements Usernamed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((var16 == 1 || !WorldMapIcon_1.mouseCam && var16 == 4) && menuOptionsCount > 0) {
|
if ((var16 == 1 || !WorldMapIcon_1.mouseCam && var16 == 4) && menuOptionsCount > 0) {
|
||||||
ModelData0.method3214(var2);
|
ModelData0.clickMenuIndex(var2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var16 == 2 && menuOptionsCount > 0) {
|
if (var16 == 2 && menuOptionsCount > 0) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -41,7 +41,8 @@ public class ModelData0 {
|
|||||||
signature = "(II)V",
|
signature = "(II)V",
|
||||||
garbageValue = "1738289394"
|
garbageValue = "1738289394"
|
||||||
)
|
)
|
||||||
static final void method3214(int var0) {
|
@Export("clickMenuIndex")
|
||||||
|
static final void clickMenuIndex(int var0) {
|
||||||
if (var0 >= 0) {
|
if (var0 >= 0) {
|
||||||
int var1 = Client.menuArguments1[var0];
|
int var1 = Client.menuArguments1[var0];
|
||||||
int var2 = Client.menuArguments2[var0];
|
int var2 = Client.menuArguments2[var0];
|
||||||
|
|||||||
@@ -526,7 +526,7 @@ public class MusicPatchNode extends Node {
|
|||||||
|
|
||||||
if (var22) {
|
if (var22) {
|
||||||
if (var20 < 10) {
|
if (var20 < 10) {
|
||||||
WorldMapSection1.method605(var20 + 1, var9.id, var9.childIndex, var9.itemId, "");
|
WorldMapSection1.widgetDefaultMenuAction(var20 + 1, var9.id, var9.childIndex, var9.itemId, "");
|
||||||
} else if (var20 == 10) {
|
} else if (var20 == 10) {
|
||||||
class208.Widget_runOnTargetLeave();
|
class208.Widget_runOnTargetLeave();
|
||||||
class32.selectSpell(var9.id, var9.childIndex, class2.method30(class2.getWidgetClickMask(var9)), var9.itemId);
|
class32.selectSpell(var9.id, var9.childIndex, class2.method30(class2.getWidgetClickMask(var9)), var9.itemId);
|
||||||
|
|||||||
@@ -255,14 +255,15 @@ public class WorldMapSection1 implements WorldMapSection {
|
|||||||
signature = "(IIIILjava/lang/String;B)V",
|
signature = "(IIIILjava/lang/String;B)V",
|
||||||
garbageValue = "31"
|
garbageValue = "31"
|
||||||
)
|
)
|
||||||
static void method605(int var0, int var1, int var2, int var3, String var4) {
|
@Export("widgetDefaultMenuAction")
|
||||||
Widget var5 = GrandExchangeOfferWorldComparator.getWidgetChild(var1, var2);
|
static void widgetDefaultMenuAction(int opIndex, int parent, int childIdx, int itemID, String target) {
|
||||||
|
Widget var5 = GrandExchangeOfferWorldComparator.getWidgetChild(parent, childIdx);
|
||||||
if (var5 != null) {
|
if (var5 != null) {
|
||||||
if (var5.onOp != null) {
|
if (var5.onOp != null) {
|
||||||
ScriptEvent var6 = new ScriptEvent();
|
ScriptEvent var6 = new ScriptEvent();
|
||||||
var6.widget = var5;
|
var6.widget = var5;
|
||||||
var6.opIndex = var0;
|
var6.opIndex = opIndex;
|
||||||
var6.targetName = var4;
|
var6.targetName = target;
|
||||||
var6.args = var5.onOp;
|
var6.args = var5.onOp;
|
||||||
ParamDefinition.runScriptEvent(var6);
|
ParamDefinition.runScriptEvent(var6);
|
||||||
}
|
}
|
||||||
@@ -274,87 +275,87 @@ public class WorldMapSection1 implements WorldMapSection {
|
|||||||
|
|
||||||
if (var11) {
|
if (var11) {
|
||||||
int var8 = class2.getWidgetClickMask(var5);
|
int var8 = class2.getWidgetClickMask(var5);
|
||||||
int var9 = var0 - 1;
|
int var9 = opIndex - 1;
|
||||||
boolean var7 = (var8 >> var9 + 1 & 1) != 0;
|
boolean var7 = (var8 >> var9 + 1 & 1) != 0;
|
||||||
if (var7) {
|
if (var7) {
|
||||||
PacketBufferNode var10;
|
PacketBufferNode var10;
|
||||||
if (var0 == 1) {
|
if (opIndex == 1) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2244, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2244, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var0 == 2) {
|
if (opIndex == 2) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2249, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2249, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var0 == 3) {
|
if (opIndex == 3) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2257, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2257, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var0 == 4) {
|
if (opIndex == 4) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2194, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2194, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var0 == 5) {
|
if (opIndex == 5) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2204, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2204, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var0 == 6) {
|
if (opIndex == 6) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2200, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2200, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var0 == 7) {
|
if (opIndex == 7) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2251, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2251, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var0 == 8) {
|
if (opIndex == 8) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2203, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2203, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var0 == 9) {
|
if (opIndex == 9) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2213, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2213, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (var0 == 10) {
|
if (opIndex == 10) {
|
||||||
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2285, Client.packetWriter.isaacCipher);
|
var10 = InterfaceParent.getPacketBufferNode(ClientPacket.field2285, Client.packetWriter.isaacCipher);
|
||||||
var10.packetBuffer.writeInt(var1);
|
var10.packetBuffer.writeInt(parent);
|
||||||
var10.packetBuffer.writeShort(var2);
|
var10.packetBuffer.writeShort(childIdx);
|
||||||
var10.packetBuffer.writeShort(var3);
|
var10.packetBuffer.writeShort(itemID);
|
||||||
Client.packetWriter.addNode(var10);
|
Client.packetWriter.addNode(var10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user