diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 335f60e985..2faa6f92ad 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -25,9 +25,9 @@ object ProjectVersions { const val launcherVersion = "2.2.0" - const val rlVersion = "1.7.18" + const val rlVersion = "1.7.19" - const val openosrsVersion = "4.9.9" + const val openosrsVersion = "4.9.10" const val rsversion = 198 const val cacheversion = 165 diff --git a/runelite-api/src/main/java/net/runelite/api/Client.java b/runelite-api/src/main/java/net/runelite/api/Client.java index 9cf9b9c310..dcab2f9293 100644 --- a/runelite-api/src/main/java/net/runelite/api/Client.java +++ b/runelite-api/src/main/java/net/runelite/api/Client.java @@ -672,6 +672,34 @@ public interface Client extends GameEngine */ boolean isMenuOpen(); + /** + * Get the menu x location. Only valid if the menu is open. + * + * @return the menu x location + */ + int getMenuX(); + + /** + * Get the menu y location. Only valid if the menu is open. + * + * @return the menu y location + */ + int getMenuY(); + + /** + * Get the menu height. Only valid if the menu is open. + * + * @return the menu height + */ + int getMenuHeight(); + + /** + * Get the menu width. Only valid if the menu is open. + * + * @return the menu width + */ + int getMenuWidth(); + /** * Gets the angle of the map, or target camera yaw. * diff --git a/runelite-api/src/main/java/net/runelite/api/MenuEntry.java b/runelite-api/src/main/java/net/runelite/api/MenuEntry.java index 9b0dd9061c..150d534de2 100644 --- a/runelite-api/src/main/java/net/runelite/api/MenuEntry.java +++ b/runelite-api/src/main/java/net/runelite/api/MenuEntry.java @@ -57,11 +57,11 @@ public class MenuEntry implements Cloneable /** * An additional parameter for the action. */ - private int actionParam; + private int param0; /** * A second additional parameter for the action. */ - private int actionParam1; + private int param1; /** * If this field is true and you have single mouse button on and this entry is * the top entry the right click menu will not be opened when you left click @@ -70,14 +70,14 @@ public class MenuEntry implements Cloneable */ private boolean forceLeftClick; - public MenuEntry(String option, String target, int type, int opcode, int actionParam, int actionParam1, boolean forceLeftClick) + public MenuEntry(String option, String target, int type, int opcode, int param0, int param1, boolean forceLeftClick) { this.option = option; this.target = target; this.identifier = type; this.opcode = opcode; - this.actionParam = actionParam; - this.actionParam1 = actionParam1; + this.param0 = param0; + this.param1 = param1; this.forceLeftClick = forceLeftClick; } @@ -96,32 +96,42 @@ public class MenuEntry implements Cloneable public void setActionParam0(int i) { - this.actionParam = i; + this.param0 = i; } public int getActionParam0() { - return this.actionParam; + return this.param0; } public int getParam0() { - return this.actionParam; + return this.param0; } public void setParam0(int i) { - this.actionParam = i; + this.param0 = i; } public void setParam1(int i) { - this.actionParam1 = i; + this.param1 = i; } public int getParam1() { - return this.actionParam1; + return this.param1; + } + + public void setActionParam1(int i) + { + this.param1 = i; + } + + public int getActionParam1() + { + return this.param1; } public void setType(int i) diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java index 4ff7b8138e..fe5b90edb2 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java +++ b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java @@ -43,9 +43,13 @@ import net.runelite.api.MenuEntry; public class MenuOptionClicked { /** - * The action parameter used in the click. + * Action parameter 0. Its value depends on the menuAction. */ - private int actionParam; + private int param0; + /** + * Action parameter 1. Its value depends on the menuAction. + */ + private int param1; /** * The option text added to the menu. */ @@ -62,12 +66,6 @@ public class MenuOptionClicked * The ID of the object, actor, or item that the interaction targets. */ private int id; - /** - * The ID of the widget where the menu was clicked. - * - * @see net.runelite.api.widgets.WidgetID - */ - private int widgetId; /** * The selected item index at the time of the option click. */ @@ -95,7 +93,31 @@ public class MenuOptionClicked this.setMenuTarget(entry.getTarget()); this.setId(entry.getId()); this.setMenuAction(MenuAction.of(entry.getOpcode())); - this.setActionParam(entry.getActionParam()); - this.setWidgetId(entry.getActionParam1()); + this.setParam0(entry.getParam0()); + this.setParam1(entry.getParam1()); + } + + @Deprecated + public int getActionParam() + { + return param0; + } + + @Deprecated + public void setActionParam(int i) + { + param0 = i; + } + + @Deprecated + public int getWidgetId() + { + return param1; + } + + @Deprecated + public void setWidgetId(int i) + { + param1 = i; } } diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index f0625635c2..2a4248a432 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -484,65 +484,65 @@ public class WidgetID static final int RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX = 19; static final int MULTICOMBAT_INDICATOR = 23; static final int MINIMAP = 25; - static final int MINIMAP_DRAW_AREA = 33; - static final int MINIMAP_ORB_HOLDER = 36; - static final int FRIENDS_CHAT_TAB = 45; - static final int IGNORES_TAB = 46; - static final int FRIENDS_TAB = 47; - static final int LOGOUT_TAB = 48; - static final int OPTIONS_TAB = 49; - static final int EMOTES_TAB = 50; - static final int MUSIC_TAB = 51; - static final int FRIENDS_CHAT_ICON = 52; - static final int FRIENDS_ICON = 54; - static final int IGNORES_ICON = 53; - static final int LOGOUT_ICON = 55; - static final int OPTIONS_ICON = 56; - static final int EMOTES_ICON = 57; - static final int MUSIC_ICON = 58; - static final int COMBAT_TAB = 61; - static final int STATS_TAB = 62; - static final int QUESTS_TAB = 63; - static final int INVENTORY_TAB = 64; - static final int EQUIPMENT_TAB = 65; - static final int PRAYER_TAB = 66; - static final int MAGIC_TAB = 67; - static final int COMBAT_ICON = 68; - static final int STATS_ICON = 69; - static final int QUESTS_ICON = 70; - static final int INVENTORY_ICON = 71; - static final int EQUIPMENT_ICON = 72; - static final int PRAYER_ICON = 73; - static final int MAGIC_ICON = 74; - static final int INTERFACE_CONTAINER = 75; - static final int INVENTORY_CONTAINER = 81; + static final int MINIMAP_DRAW_AREA = 34; + static final int MINIMAP_ORB_HOLDER = 37; + static final int FRIENDS_CHAT_TAB = 46; + static final int IGNORES_TAB = 47; + static final int FRIENDS_TAB = 48; + static final int LOGOUT_TAB = 49; + static final int OPTIONS_TAB = 50; + static final int EMOTES_TAB = 51; + static final int MUSIC_TAB = 52; + static final int FRIENDS_CHAT_ICON = 53; + static final int FRIENDS_ICON = 55; + static final int IGNORES_ICON = 54; + static final int LOGOUT_ICON = 56; + static final int OPTIONS_ICON = 57; + static final int EMOTES_ICON = 58; + static final int MUSIC_ICON = 59; + static final int COMBAT_TAB = 62; + static final int STATS_TAB = 63; + static final int QUESTS_TAB = 64; + static final int INVENTORY_TAB = 65; + static final int EQUIPMENT_TAB = 66; + static final int PRAYER_TAB = 67; + static final int MAGIC_TAB = 68; + static final int COMBAT_ICON = 69; + static final int STATS_ICON = 70; + static final int QUESTS_ICON = 71; + static final int INVENTORY_ICON = 72; + static final int EQUIPMENT_ICON = 73; + static final int PRAYER_ICON = 74; + static final int MAGIC_ICON = 75; + static final int INTERFACE_CONTAINER = 76; + static final int INVENTORY_CONTAINER = 82; } static class ResizableViewportBottomLine { static final int RESIZABLE_VIEWPORT_BOTTOM_LINE = 19; static final int MINIMAP = 25; - static final int MINIMAP_DRAW_AREA = 33; - static final int MINIMAP_ORB_HOLDER = 36; - static final int LOGOUT_BUTTON_OVERLAY = 37; - static final int MINIMAP_LOGOUT_BUTTON = 38; - static final int FC_ICON = 49; - static final int FRIEND_ICON = 51; - static final int SETTINGS_ICON = 52; - static final int EMOTE_ICON = 53; - static final int MUSIC_ICON = 54; - static final int INVENTORY_TAB = 61; - static final int PRAYER_TAB = 63; - static final int MAGIC_TAB = 64; - static final int CMB_ICON = 65; - static final int SKILLS_ICON = 66; - static final int QUESTS_ICON = 67; - static final int INVENTORY_ICON = 68; - static final int EQUIP_ICON = 69; - static final int PRAYER_ICON = 70; - static final int MAGIC_ICON = 71; - static final int INTERFACE_CONTAINER = 74; - static final int INVENTORY_CONTAINER = 80; + static final int MINIMAP_DRAW_AREA = 34; + static final int MINIMAP_ORB_HOLDER = 37; + static final int LOGOUT_BUTTON_OVERLAY = 38; + static final int MINIMAP_LOGOUT_BUTTON = 39; + static final int FC_ICON = 50; + static final int FRIEND_ICON = 52; + static final int SETTINGS_ICON = 53; + static final int EMOTE_ICON = 54; + static final int MUSIC_ICON = 55; + static final int INVENTORY_TAB = 62; + static final int PRAYER_TAB = 64; + static final int MAGIC_TAB = 65; + static final int CMB_ICON = 66; + static final int SKILLS_ICON = 67; + static final int QUESTS_ICON = 68; + static final int INVENTORY_ICON = 69; + static final int EQUIP_ICON = 70; + static final int PRAYER_ICON = 71; + static final int MAGIC_ICON = 72; + static final int INTERFACE_CONTAINER = 75; + static final int INVENTORY_CONTAINER = 81; } static class Chatbox diff --git a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java index f5b76b335b..d6c9c79893 100644 --- a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java +++ b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java @@ -113,7 +113,7 @@ public class MenuManager return; } - int widgetId = event.getActionParam1(); + int widgetId = event.getParam1(); Collection options = managedMenuOptions.get(widgetId); if (options.isEmpty()) { @@ -206,7 +206,7 @@ public class MenuManager return; } - int widgetId = event.getWidgetId(); + int widgetId = event.getParam1(); Collection options = managedMenuOptions.get(widgetId); for (WidgetMenuOption curMenuOption : options) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragConfig.java index 6fa7c3871a..ce2973855f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragConfig.java @@ -46,7 +46,7 @@ public interface AntiDragConfig extends Config @ConfigItem( keyName = "onShiftOnly", name = "On Shift Only", - description = "Configures whether to only adjust the delay while holding shift in non-PvP scenarios. Shift is required in PvP regardless of this config setting", + description = "Configures whether to only adjust the delay while holding shift.", position = 2 ) default boolean onShiftOnly() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragPlugin.java index 1c3952737e..e1b6377612 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragPlugin.java @@ -29,9 +29,7 @@ import java.awt.event.KeyEvent; import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.api.GameState; -import net.runelite.api.Varbits; import net.runelite.api.events.FocusChanged; -import net.runelite.api.events.VarbitChanged; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetID; @@ -69,7 +67,6 @@ public class AntiDragPlugin extends Plugin implements KeyListener @Inject private KeyManager keyManager; - private boolean inPvp; private boolean shiftHeld; private boolean ctrlHeld; @@ -86,8 +83,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener { clientThread.invokeLater(() -> { - inPvp = client.getVar(Varbits.PVP_SPEC_ORB) == 1; - if (!config.onShiftOnly() && !inPvp) + if (!config.onShiftOnly()) { setDragDelay(); } @@ -113,12 +109,12 @@ public class AntiDragPlugin extends Plugin implements KeyListener @Override public void keyPressed(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_CONTROL && config.disableOnCtrl() && !(inPvp || config.onShiftOnly())) + if (e.getKeyCode() == KeyEvent.VK_CONTROL && config.disableOnCtrl() && !config.onShiftOnly()) { resetDragDelay(); ctrlHeld = true; } - else if (e.getKeyCode() == KeyEvent.VK_SHIFT && (inPvp || config.onShiftOnly())) + else if (e.getKeyCode() == KeyEvent.VK_SHIFT && config.onShiftOnly()) { setDragDelay(); shiftHeld = true; @@ -128,12 +124,12 @@ public class AntiDragPlugin extends Plugin implements KeyListener @Override public void keyReleased(KeyEvent e) { - if (e.getKeyCode() == KeyEvent.VK_CONTROL && config.disableOnCtrl() && !(inPvp || config.onShiftOnly())) + if (e.getKeyCode() == KeyEvent.VK_CONTROL && config.disableOnCtrl() && !config.onShiftOnly()) { setDragDelay(); ctrlHeld = false; } - else if (e.getKeyCode() == KeyEvent.VK_SHIFT && (inPvp || config.onShiftOnly())) + else if (e.getKeyCode() == KeyEvent.VK_SHIFT && config.onShiftOnly()) { resetDragDelay(); shiftHeld = false; @@ -150,7 +146,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener ctrlHeld = false; } - if (config.onShiftOnly() || inPvp) + if (config.onShiftOnly()) { shiftHeld = false; clientThread.invoke(this::resetDragDelay); @@ -162,27 +158,6 @@ public class AntiDragPlugin extends Plugin implements KeyListener } } - @Subscribe - public void onVarbitChanged(VarbitChanged varbitChanged) - { - boolean currentStatus = client.getVar(Varbits.PVP_SPEC_ORB) == 1; - - if (currentStatus != inPvp) - { - inPvp = currentStatus; - - if (!inPvp && !config.onShiftOnly()) - { - setDragDelay(); - } - else - { - resetDragDelay(); - } - } - - } - @Subscribe public void onFocusChanged(FocusChanged focusChanged) { @@ -192,7 +167,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener ctrlHeld = false; clientThread.invoke(this::resetDragDelay); } - else if (!inPvp && !config.onShiftOnly()) + else if (!config.onShiftOnly()) { clientThread.invoke(this::setDragDelay); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java index 4e56358252..63d7a2ce6b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java @@ -339,7 +339,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener { MenuEntry[] entries = client.getMenuEntries(); - if (event.getActionParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() + if (event.getParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && event.getOption().equals("Examine")) { Widget container = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER); @@ -355,7 +355,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener MenuEntry editTags = new MenuEntry(); editTags.setParam0(event.getActionParam0()); - editTags.setParam1(event.getActionParam1()); + editTags.setParam1(event.getParam1()); editTags.setTarget(event.getTarget()); editTags.setOption(text); editTags.setType(MenuAction.RUNELITE.getId()); @@ -371,12 +371,12 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (event.getWidgetId() == WidgetInfo.BANK_ITEM_CONTAINER.getId() + if (event.getParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && event.getMenuAction() == MenuAction.RUNELITE && event.getMenuOption().startsWith(EDIT_TAGS_MENU_OPTION)) { event.consume(); - int inventoryIndex = event.getActionParam(); + int inventoryIndex = event.getParam0(); ItemContainer bankContainer = client.getItemContainer(InventoryID.BANK); if (bankContainer == null) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java index 0846efdf43..9973c4ce19 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java @@ -608,13 +608,13 @@ public class TabInterface MenuEntry[] entries = client.getMenuEntries(); if (activeTab != null - && event.getActionParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() + && event.getParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && event.getOption().equals("Examine")) { entries = createMenuEntry(event, REMOVE_TAG + " (" + activeTab.getTag() + ")", event.getTarget(), entries); client.setMenuEntries(entries); } - else if (event.getActionParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId() + else if (event.getParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId() && event.getOption().equals("Deposit inventory")) { entries = createMenuEntry(event, TAG_INVENTORY, event.getTarget(), entries); @@ -626,7 +626,7 @@ public class TabInterface client.setMenuEntries(entries); } - else if (event.getActionParam1() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId() + else if (event.getParam1() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId() && event.getOption().equals("Deposit worn items")) { entries = createMenuEntry(event, TAG_GEAR, event.getTarget(), entries); @@ -661,26 +661,26 @@ public class TabInterface activateTab(null); } else if (activeTab != null - && event.getWidgetId() == WidgetInfo.BANK_ITEM_CONTAINER.getId() + && event.getParam1() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && event.getMenuAction() == MenuAction.RUNELITE && event.getMenuOption().startsWith(REMOVE_TAG)) { // Add "remove" menu entry to all items in bank while tab is selected event.consume(); - final ItemComposition item = getItem(event.getActionParam()); + final ItemComposition item = getItem(event.getParam0()); final int itemId = item.getId(); tagManager.removeTag(itemId, activeTab.getTag()); bankSearch.layoutBank(); // re-layout to filter the removed item out } else if (event.getMenuAction() == MenuAction.RUNELITE - && ((event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId() && event.getMenuOption().equals(TAG_INVENTORY)) - || (event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId() && event.getMenuOption().equals(TAG_GEAR)))) + && ((event.getParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId() && event.getMenuOption().equals(TAG_INVENTORY)) + || (event.getParam1() == WidgetInfo.BANK_DEPOSIT_EQUIPMENT.getId() && event.getMenuOption().equals(TAG_GEAR)))) { - handleDeposit(event, event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId()); + handleDeposit(event, event.getParam1() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId()); } - else if (activeTab != null && ((event.getWidgetId() == WidgetInfo.BANK_EQUIPMENT_BUTTON.getId() && event.getMenuOption().equals(SHOW_WORN)) - || (event.getWidgetId() == WidgetInfo.BANK_SETTINGS_BUTTON.getId() && event.getMenuOption().equals(SHOW_SETTINGS)) - || (event.getWidgetId() == WidgetInfo.BANK_TUTORIAL_BUTTON.getId() && event.getMenuOption().equals(SHOW_TUTORIAL)))) + else if (activeTab != null && ((event.getParam1() == WidgetInfo.BANK_EQUIPMENT_BUTTON.getId() && event.getMenuOption().equals(SHOW_WORN)) + || (event.getParam1() == WidgetInfo.BANK_SETTINGS_BUTTON.getId() && event.getMenuOption().equals(SHOW_SETTINGS)) + || (event.getParam1() == WidgetInfo.BANK_TUTORIAL_BUTTON.getId() && event.getMenuOption().equals(SHOW_TUTORIAL)))) { saveTab(); } @@ -1186,7 +1186,7 @@ public class TabInterface { final MenuEntry entry = new MenuEntry(); entry.setParam0(event.getActionParam0()); - entry.setParam1(event.getActionParam1()); + entry.setParam1(event.getParam1()); entry.setTarget(target); entry.setOption(option); entry.setType(MenuAction.RUNELITE.getId()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java b/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java index 078463bfb3..362a4f6784 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java @@ -56,7 +56,7 @@ enum Boss THERMONUCLEAR_SMOKE_DEVIL(NpcID.THERMONUCLEAR_SMOKE_DEVIL, 8400, ChronoUnit.MILLIS, ItemID.PET_SMOKE_DEVIL), KRAKEN(NpcID.KRAKEN, 8400, ChronoUnit.MILLIS, ItemID.PET_KRAKEN), KALPHITE_QUEEN(NpcID.KALPHITE_QUEEN_965, 30, ChronoUnit.SECONDS, ItemID.KALPHITE_PRINCESS), - DUSK(NpcID.DUSK_7889, 2, ChronoUnit.MINUTES, ItemID.NOON), + DUSK(NpcID.DUSK_7889, 5, ChronoUnit.MINUTES, ItemID.NOON), ALCHEMICAL_HYDRA(NpcID.ALCHEMICAL_HYDRA_8622, 25200, ChronoUnit.MILLIS, ItemID.IKKLE_HYDRA), SARACHNIS(NpcID.SARACHNIS, 10, ChronoUnit.SECONDS, ItemID.SRARACHA), ZALCANO(NpcID.ZALCANO_9050, 21600, ChronoUnit.MILLIS, ItemID.SMOLCANO); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/camera/CameraPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/camera/CameraPlugin.java index b2ac448629..d118fa1d4b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/camera/CameraPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/camera/CameraPlugin.java @@ -209,7 +209,7 @@ public class CameraPlugin extends Plugin implements KeyListener, MouseListener m.setIdentifier(identifier); m.setType(MenuAction.CC_OP.getId()); m.setParam0(lookNorth.getActionParam0()); - m.setParam1(lookNorth.getActionParam1()); + m.setParam1(lookNorth.getParam1()); return m; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 11dab4a780..09610e774e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -114,7 +114,7 @@ public class ChatCommandsPlugin extends Plugin private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("Congratulations - your raid is complete!
Team size: " + COX_TEAM_SIZES + " Duration: [0-9:.]+ Personal best: (?[0-9:]+(?:\\.[0-9]+)?)"); private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("Theatre of Blood wave completion time: (?[0-9:]+(?:\\.[0-9]+)?) \\(new personal best\\)"); private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("Theatre of Blood wave completion time: [0-9:.]+\\. Personal best: (?[0-9:]+(?:\\.[0-9]+)?)"); - private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) [0-9:.]+\\. Personal best: (?:)?(?[0-9:]+(?:\\.[0-9]+)?)"); + private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) [0-9:.]+\\. Personal best: (?:)?(?[0-9:]+(?:\\.[0-9]+)?)"); private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) (?[0-9:]+(?:\\.[0-9]+)?) \\(new personal best\\)"); private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?"); private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?"); @@ -1238,7 +1238,10 @@ public class ChatCommandsPlugin extends Plugin try { List petList = getPetList().stream().map(Pet::getIconID).collect(Collectors.toList()); - chatClient.submitPetList(playerName, petList); + if (!petList.isEmpty()) + { + chatClient.submitPetList(playerName, petList); + } } catch (Exception ex) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java index 8464d973e0..cc7903f0b4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chathistory/ChatHistoryPlugin.java @@ -254,7 +254,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener // The menu option for clear history is "Public: Clear history" if (menuOption.endsWith(CLEAR_HISTORY)) { - clearChatboxHistory(ChatboxTab.of(event.getWidgetId())); + clearChatboxHistory(ChatboxTab.of(event.getParam1())); } else if (COPY_TO_CLIPBOARD.equals(menuOption) && !Strings.isNullOrEmpty(currentMessage)) { @@ -266,7 +266,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener @Subscribe public void onMenuEntryAdded(MenuEntryAdded entry) { - final ChatboxTab tab = ChatboxTab.of(entry.getActionParam1()); + final ChatboxTab tab = ChatboxTab.of(entry.getParam1()); if (tab == null || tab.getAfter() == null || !config.clearHistory() || !Text.removeTags(entry.getOption()).equals(tab.getAfter())) { @@ -277,7 +277,7 @@ public class ChatHistoryPlugin extends Plugin implements KeyListener clearEntry.setTarget(""); clearEntry.setType(MenuAction.RUNELITE.getId()); clearEntry.setParam0(entry.getActionParam0()); - clearEntry.setParam1(entry.getActionParam1()); + clearEntry.setParam1(entry.getParam1()); if (tab == ChatboxTab.GAME) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java index e4748262a5..31779810a8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java @@ -61,7 +61,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc new CrypticClue("Search the bucket in the Port Sarim jail.", BUCKET_9568, new WorldPoint(3013, 3179, 0), "Talk to Shantay & identify yourself as an outlaw, refuse to pay the 5gp fine twice and you will be sent to the Port Sarim jail."), new CrypticClue("Search the crates in a bank in Varrock.", CRATE_5107, new WorldPoint(3187, 9825, 0), "Search in the basement of the West Varrock bank."), new CrypticClue("Falo the bard wants to see you.", "Falo the Bard", new WorldPoint(2689, 3550, 0), "Speak to Falo the Bard located between Seers' Village and Rellekka. Southwest of fairy ring CJR."), - new CrypticClue("Search a bookcase in the Wizards tower.", BOOKCASE_12539, new WorldPoint(3113, 3159, 0), "The bookcase located on the ground floor of the Wizards' Tower."), + new CrypticClue("Search a bookcase in the Wizards tower.", BOOKCASE_12539, new WorldPoint(3113, 3159, 0), "The bookcase located on the ground floor of the Wizards' Tower. Fairy ring DIS."), new CrypticClue("Come have a cip with this great soot covered denizen.", "Miner Magnus", new WorldPoint(2527, 3891, 0), "Talk to Miner Magnus on Miscellania, east of the fairy ring CIP. Answer: 8", "How many coal rocks are around here?"), new CrypticClue("Citric cellar.", "Heckel Funch", new WorldPoint(2490, 3488, 0), "Speak to Heckel Funch on the first floor in the Grand Tree."), new CrypticClue("I burn between heroes and legends.", "Candle maker", new WorldPoint(2799, 3438, 0), "Speak to the Candle maker in Catherby."), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/woodcutting/CrowdsourcingWoodcutting.java b/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/woodcutting/CrowdsourcingWoodcutting.java index 2a52784764..98ee6c1b09 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/woodcutting/CrowdsourcingWoodcutting.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/crowdsourcing/woodcutting/CrowdsourcingWoodcutting.java @@ -276,7 +276,7 @@ public class CrowdsourcingWoodcutting state = SkillingState.CLICKED; lastExperimentEnd = client.getTickCount(); treeId = id; - treeLocation = WorldPoint.fromScene(client, menuOptionClicked.getActionParam(), menuOptionClicked.getWidgetId(), client.getPlane()); + treeLocation = WorldPoint.fromScene(client, menuOptionClicked.getParam0(), menuOptionClicked.getParam1(), client.getPlane()); } else { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java index 5d1184a9a9..a93d2dc1ff 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java @@ -487,7 +487,7 @@ class WidgetInspector extends DevToolsFrame client.setSpellSelected(false); ev.consume(); - Object target = getWidgetOrWidgetItemForMenuOption(ev.getMenuAction().getId(), ev.getActionParam(), ev.getWidgetId()); + Object target = getWidgetOrWidgetItemForMenuOption(ev.getMenuAction().getId(), ev.getParam0(), ev.getParam1()); if (target == null) { return; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java index 8e57e889c8..bda2548479 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java @@ -97,11 +97,11 @@ public class ExaminePlugin extends Plugin type = ExamineType.ITEM; id = event.getId(); - int widgetId = event.getWidgetId(); + int widgetId = event.getParam1(); int widgetGroup = TO_GROUP(widgetId); int widgetChild = TO_CHILD(widgetId); Widget widget = client.getWidget(widgetGroup, widgetChild); - WidgetItem widgetItem = widget.getWidgetItem(event.getActionParam()); + WidgetItem widgetItem = widget.getWidgetItem(event.getParam0()); quantity = widgetItem != null && widgetItem.getId() >= 0 ? widgetItem.getQuantity() : 1; // Examine on inventory items with more than 100000 quantity is handled locally and shows the item stack @@ -127,7 +127,7 @@ public class ExaminePlugin extends Plugin case CC_OP_LOW_PRIORITY: { type = ExamineType.ITEM_BANK_EQ; - int[] qi = findItemFromWidget(event.getWidgetId(), event.getActionParam()); + int[] qi = findItemFromWidget(event.getParam1(), event.getParam0()); if (qi == null) { log.debug("Examine for item with unknown widget: {}", event); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java index 1a274d664c..088a782c9d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java @@ -235,7 +235,7 @@ public class FriendNotesPlugin extends Plugin @Subscribe public void onMenuEntryAdded(MenuEntryAdded event) { - final int groupId = WidgetInfo.TO_GROUP(event.getActionParam1()); + final int groupId = WidgetInfo.TO_GROUP(event.getParam1()); // Look for "Message" on friends list if ((groupId == WidgetInfo.FRIENDS_LIST.getGroupId() && event.getOption().equals("Message")) || @@ -250,7 +250,7 @@ public class FriendNotesPlugin extends Plugin addNote.setType(MenuAction.RUNELITE.getId()); addNote.setTarget(event.getTarget()); //Preserve color codes here addNote.setParam0(event.getActionParam0()); - addNote.setParam1(event.getActionParam1()); + addNote.setParam1(event.getParam1()); // Add menu entry final MenuEntry[] menuEntries = ObjectArrays.concat(client.getMenuEntries(), addNote); @@ -265,7 +265,7 @@ public class FriendNotesPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - final int groupId = WidgetInfo.TO_GROUP(event.getWidgetId()); + final int groupId = WidgetInfo.TO_GROUP(event.getParam1()); if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.IGNORE_LIST.getGroupId()) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java index 655ae55fc7..22f74c2353 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java @@ -498,7 +498,7 @@ public class GroundItemsPlugin extends Plugin final int itemId = event.getIdentifier(); final int sceneX = event.getActionParam0(); - final int sceneY = event.getActionParam1(); + final int sceneY = event.getParam1(); MenuEntry[] menuEntries = client.getMenuEntries(); MenuEntry lastEntry = menuEntries[menuEntries.length - 1]; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/herbiboars/HerbiboarPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/herbiboars/HerbiboarPlugin.java index 02288075c5..7936730ff3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/herbiboars/HerbiboarPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/herbiboars/HerbiboarPlugin.java @@ -255,7 +255,7 @@ public class HerbiboarPlugin extends Plugin case "Rock": case "Mushroom": case "Driftwood": - startPoint = WorldPoint.fromScene(client, menuOpt.getActionParam(), menuOpt.getWidgetId(), client.getPlane()); + startPoint = WorldPoint.fromScene(client, menuOpt.getParam0(), menuOpt.getParam1(), client.getPlane()); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java index 25ae9a55b3..5d3147be7b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePanel.java @@ -114,7 +114,7 @@ public class HiscorePanel extends PluginPanel ); private static final HiscoreEndpoint[] ENDPOINTS = { - HiscoreEndpoint.NORMAL, HiscoreEndpoint.IRONMAN, HiscoreEndpoint.HARDCORE_IRONMAN, HiscoreEndpoint.ULTIMATE_IRONMAN, HiscoreEndpoint.DEADMAN, HiscoreEndpoint.LEAGUE + HiscoreEndpoint.NORMAL, HiscoreEndpoint.IRONMAN, HiscoreEndpoint.HARDCORE_IRONMAN, HiscoreEndpoint.ULTIMATE_IRONMAN, HiscoreEndpoint.DEADMAN, HiscoreEndpoint.TOURNAMENT }; private final HiscorePlugin plugin; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePlugin.java index 7f1f65606e..ac905ca4c5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/hiscore/HiscorePlugin.java @@ -158,7 +158,7 @@ public class HiscorePlugin extends Plugin return; } - final int componentId = event.getActionParam1(); + final int componentId = event.getParam1(); int groupId = WidgetInfo.TO_GROUP(componentId); String option = event.getOption(); @@ -178,7 +178,7 @@ public class HiscorePlugin extends Plugin lookup.setTarget(event.getTarget()); lookup.setType(MenuAction.RUNELITE.getId()); lookup.setParam0(event.getActionParam0()); - lookup.setParam1(event.getActionParam1()); + lookup.setParam1(event.getParam1()); lookup.setIdentifier(event.getIdentifier()); insertMenuEntry(lookup, client.getMenuEntries()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/interacthighlight/InteractHighlightConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/interacthighlight/InteractHighlightConfig.java new file mode 100644 index 0000000000..8fff918cda --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/interacthighlight/InteractHighlightConfig.java @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2021, Adam + * 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.interacthighlight; + +import java.awt.Color; +import net.runelite.client.config.Alpha; +import net.runelite.client.config.Config; +import net.runelite.client.config.ConfigGroup; +import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigSection; +import net.runelite.client.config.Range; + +@ConfigGroup("interacthighlight") +public interface InteractHighlightConfig extends Config +{ + @ConfigSection( + name = "NPCs", + description = "Settings for NPC highlight", + position = 0 + ) + String npcSection = "npcSection"; + + @ConfigSection( + name = "Objects", + description = "Settings for object highlight", + position = 1 + ) + String objectSection = "objectSection"; + + @ConfigItem( + keyName = "npcShowHover", + name = "Show on hover", + description = "Outline NPCs when hovered", + position = 1, + section = npcSection + ) + default boolean npcShowHover() + { + return true; + } + + @ConfigItem( + keyName = "npcShowInteract", + name = "Show on interact", + description = "Outline NPCs when interacted", + position = 2, + section = npcSection + ) + default boolean npcShowInteract() + { + return true; + } + + @Alpha + @ConfigItem( + keyName = "npcHoverHighlightColor", + name = "NPC hover", + description = "The color of the hover outline for NPCs", + position = 3, + section = npcSection + ) + default Color npcHoverHighlightColor() + { + return new Color(0x90FFFF00, true); + } + + @Alpha + @ConfigItem( + keyName = "npcAttackHoverHighlightColor", + name = "NPC attack hover", + description = "The color of the attack hover outline for NPCs", + position = 4, + section = npcSection + ) + default Color npcAttackHoverHighlightColor() + { + return new Color(0x90FFFF00, true); + } + + @Alpha + @ConfigItem( + keyName = "npcInteractHighlightColor", + name = "NPC interact", + description = "The color of the target outline for NPCs", + position = 5, + section = npcSection + ) + default Color npcInteractHighlightColor() + { + return new Color(0x90FF0000, true); + } + + @Alpha + @ConfigItem( + keyName = "npcAttackHighlightColor", + name = "NPC attack", + description = "The color of the outline on attacked NPCs", + position = 6, + section = npcSection + ) + default Color npcAttackHighlightColor() + { + return new Color(0x90FF0000, true); + } + + @ConfigItem( + keyName = "objectShowHover", + name = "Show on hover", + description = "Outline objects when hovered", + position = 1, + section = objectSection + ) + default boolean objectShowHover() + { + return true; + } + + @ConfigItem( + keyName = "objectShowInteract", + name = "Show on interact", + description = "Outline objects when interacted", + position = 2, + section = objectSection + ) + default boolean objectShowInteract() + { + return true; + } + + @Alpha + @ConfigItem( + keyName = "objectHoverHighlightColor", + name = "Object hover", + description = "The color of the hover outline for objects", + position = 4, + section = objectSection + ) + default Color objectHoverHighlightColor() + { + return new Color(0x9000FFFF, true); + } + + @Alpha + @ConfigItem( + keyName = "objectInteractHighlightColor", + name = "Object interact", + description = "The color of the target outline for objects", + position = 6, + section = objectSection + ) + default Color objectInteractHighlightColor() + { + return new Color(0x90FF0000, true); + } + + @ConfigItem( + keyName = "borderWidth", + name = "Border Width", + description = "Width of the outlined border", + position = 7 + ) + default int borderWidth() + { + return 4; + } + + @ConfigItem( + keyName = "outlineFeather", + name = "Outline feather", + description = "Specify between 0-4 how much of the model outline should be faded", + position = 8 + ) + @Range( + max = 4 + ) + default int outlineFeather() + { + return 4; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/interacthighlight/InteractHighlightOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/interacthighlight/InteractHighlightOverlay.java new file mode 100644 index 0000000000..664d274f5a --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/interacthighlight/InteractHighlightOverlay.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2021, Adam + * 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.interacthighlight; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import javax.inject.Inject; +import net.runelite.api.Actor; +import net.runelite.api.Client; +import net.runelite.api.MenuAction; +import net.runelite.api.MenuEntry; +import net.runelite.api.NPC; +import net.runelite.api.TileObject; +import net.runelite.client.ui.overlay.Overlay; +import net.runelite.client.ui.overlay.OverlayLayer; +import net.runelite.client.ui.overlay.OverlayPosition; +import net.runelite.client.ui.overlay.OverlayPriority; +import net.runelite.client.ui.overlay.outline.ModelOutlineRenderer; +import net.runelite.client.util.ColorUtil; + +class InteractHighlightOverlay extends Overlay +{ + private static final Color INTERACT_CLICK_COLOR = new Color(0x90ffffff); + + private final Client client; + private final InteractHighlightPlugin plugin; + private final InteractHighlightConfig config; + private final ModelOutlineRenderer modelOutlineRenderer; + + @Inject + private InteractHighlightOverlay(Client client, InteractHighlightPlugin plugin, InteractHighlightConfig config, ModelOutlineRenderer modelOutlineRenderer) + { + this.client = client; + this.plugin = plugin; + this.config = config; + this.modelOutlineRenderer = modelOutlineRenderer; + setPosition(OverlayPosition.DYNAMIC); + setLayer(OverlayLayer.ABOVE_SCENE); + setPriority(OverlayPriority.LOW); + } + + @Override + public Dimension render(Graphics2D graphics) + { + renderMouseover(); + renderTarget(); + return null; + } + + private void renderMouseover() + { + MenuEntry[] menuEntries = client.getMenuEntries(); + if (menuEntries.length == 0) + { + return; + } + + MenuEntry top = menuEntries[menuEntries.length - 1]; + MenuAction menuAction = MenuAction.of(top.getType()); + + switch (menuAction) + { + case ITEM_USE_ON_GAME_OBJECT: + case SPELL_CAST_ON_GAME_OBJECT: + case GAME_OBJECT_FIRST_OPTION: + case GAME_OBJECT_SECOND_OPTION: + case GAME_OBJECT_THIRD_OPTION: + case GAME_OBJECT_FOURTH_OPTION: + case GAME_OBJECT_FIFTH_OPTION: + { + int x = top.getParam0(); + int y = top.getParam1(); + int id = top.getIdentifier(); + TileObject tileObject = plugin.findTileObject(x, y, id); + if (tileObject != null && config.objectShowHover() && (tileObject != plugin.getInteractedObject() || !config.objectShowInteract())) + { + modelOutlineRenderer.drawOutline(tileObject, config.borderWidth(), config.objectHoverHighlightColor(), config.outlineFeather()); + } + break; + } + case ITEM_USE_ON_NPC: + case SPELL_CAST_ON_NPC: + case NPC_FIRST_OPTION: + case NPC_SECOND_OPTION: + case NPC_THIRD_OPTION: + case NPC_FOURTH_OPTION: + case NPC_FIFTH_OPTION: + { + int id = top.getIdentifier(); + NPC npc = plugin.findNpc(id); + if (npc != null && config.npcShowHover() && (npc != plugin.getInteractedTarget() || !config.npcShowInteract())) + { + Color highlightColor = menuAction == MenuAction.NPC_SECOND_OPTION || menuAction == MenuAction.SPELL_CAST_ON_NPC + ? config.npcAttackHoverHighlightColor() : config.npcHoverHighlightColor(); + modelOutlineRenderer.drawOutline(npc, config.borderWidth(), highlightColor, config.outlineFeather()); + } + break; + } + } + } + + private void renderTarget() + { + TileObject interactedObject = plugin.getInteractedObject(); + if (interactedObject != null && config.objectShowInteract()) + { + Color clickColor = getClickColor(config.objectHoverHighlightColor(), config.objectInteractHighlightColor(), + client.getGameCycle() - plugin.getGameCycle()); + modelOutlineRenderer.drawOutline(interactedObject, config.borderWidth(), clickColor, config.outlineFeather()); + } + + Actor target = plugin.getInteractedTarget(); + if (target instanceof NPC && config.npcShowInteract()) + { + Color startColor = plugin.isAttacked() ? config.npcAttackHoverHighlightColor() : config.npcHoverHighlightColor(); + Color endColor = plugin.isAttacked() ? config.npcAttackHighlightColor() : config.npcInteractHighlightColor(); + Color clickColor = getClickColor(startColor, endColor, + client.getGameCycle() - plugin.getGameCycle()); + modelOutlineRenderer.drawOutline((NPC) target, config.borderWidth(), clickColor, config.outlineFeather()); + } + } + + private Color getClickColor(Color start, Color end, long time) + { + if (time < 5) + { + return ColorUtil.colorLerp(start, INTERACT_CLICK_COLOR, time / 5f); + } + else if (time < 10) + { + return ColorUtil.colorLerp(INTERACT_CLICK_COLOR, end, (time - 5) / 5f); + } + return end; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/interacthighlight/InteractHighlightPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/interacthighlight/InteractHighlightPlugin.java new file mode 100644 index 0000000000..026b94301e --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/interacthighlight/InteractHighlightPlugin.java @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2021, Adam + * 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.interacthighlight; + +import com.google.inject.Provides; +import javax.annotation.Nullable; +import javax.inject.Inject; +import lombok.AccessLevel; +import lombok.Getter; +import net.runelite.api.Actor; +import net.runelite.api.Client; +import net.runelite.api.DecorativeObject; +import net.runelite.api.GameObject; +import net.runelite.api.GameState; +import net.runelite.api.GroundObject; +import net.runelite.api.MenuAction; +import net.runelite.api.NPC; +import net.runelite.api.Scene; +import net.runelite.api.Tile; +import net.runelite.api.TileObject; +import net.runelite.api.WallObject; +import net.runelite.api.events.GameStateChanged; +import net.runelite.api.events.GameTick; +import net.runelite.api.events.MenuOptionClicked; +import net.runelite.api.events.NpcDespawned; +import net.runelite.api.events.InteractingChanged; +import net.runelite.client.config.ConfigManager; +import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; +import net.runelite.client.ui.overlay.OverlayManager; + +@PluginDescriptor( + name = "Interact Highlight", + description = "Outlines npcs and objects you interact with or hover over", + enabledByDefault = false +) +public class InteractHighlightPlugin extends Plugin +{ + @Inject + private OverlayManager overlayManager; + + @Inject + private InteractHighlightOverlay interactHighlightOverlay; + + @Inject + private Client client; + + @Getter(AccessLevel.PACKAGE) + private TileObject interactedObject; + private NPC interactedNpc; + @Getter(AccessLevel.PACKAGE) + boolean attacked; + private int clickTick; + @Getter(AccessLevel.PACKAGE) + private int gameCycle; + + @Provides + InteractHighlightConfig provideConfig(ConfigManager configManager) + { + return configManager.getConfig(InteractHighlightConfig.class); + } + + @Override + protected void startUp() + { + overlayManager.add(interactHighlightOverlay); + } + + @Override + protected void shutDown() + { + overlayManager.remove(interactHighlightOverlay); + } + + @Subscribe + public void onGameStateChanged(GameStateChanged gameStateChanged) + { + if (gameStateChanged.getGameState() == GameState.LOADING) + { + interactedObject = null; + } + } + + @Subscribe + public void onNpcDespawned(NpcDespawned npcDespawned) + { + if (npcDespawned.getNpc() == interactedNpc) + { + interactedNpc = null; + } + } + + @Subscribe + public void onGameTick(GameTick gameTick) + { + if (client.getTickCount() > clickTick && client.getLocalDestinationLocation() == null) + { + // when the destination is reached, clear the interacting object + interactedObject = null; + interactedNpc = null; + } + } + + @Subscribe + public void onInteractingChanged(InteractingChanged interactingChanged) + { + if (interactingChanged.getSource() == client.getLocalPlayer() + && client.getTickCount() > clickTick && interactingChanged.getTarget() != interactedNpc) + { + interactedNpc = null; + attacked = interactingChanged.getTarget() != null && interactingChanged.getTarget().getCombatLevel() > 0; + } + } + + @Subscribe + public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked) + { + switch (menuOptionClicked.getMenuAction()) + { + case ITEM_USE_ON_GAME_OBJECT: + case SPELL_CAST_ON_GAME_OBJECT: + case GAME_OBJECT_FIRST_OPTION: + case GAME_OBJECT_SECOND_OPTION: + case GAME_OBJECT_THIRD_OPTION: + case GAME_OBJECT_FOURTH_OPTION: + case GAME_OBJECT_FIFTH_OPTION: + { + int x = menuOptionClicked.getParam0(); + int y = menuOptionClicked.getParam1(); + int id = menuOptionClicked.getId(); + interactedObject = findTileObject(x, y, id); + interactedNpc = null; + clickTick = client.getTickCount(); + gameCycle = client.getGameCycle(); + break; + } + case ITEM_USE_ON_NPC: + case SPELL_CAST_ON_NPC: + case NPC_FIRST_OPTION: + case NPC_SECOND_OPTION: + case NPC_THIRD_OPTION: + case NPC_FOURTH_OPTION: + case NPC_FIFTH_OPTION: + { + int id = menuOptionClicked.getId(); + interactedObject = null; + interactedNpc = findNpc(id); + attacked = menuOptionClicked.getMenuAction() == MenuAction.NPC_SECOND_OPTION || menuOptionClicked.getMenuAction() == MenuAction.SPELL_CAST_ON_NPC; + clickTick = client.getTickCount(); + gameCycle = client.getGameCycle(); + break; + } + // Any menu click which clears an interaction + case WALK: + case ITEM_USE: + case ITEM_USE_ON_GROUND_ITEM: + case ITEM_USE_ON_PLAYER: + case ITEM_FIRST_OPTION: + case ITEM_SECOND_OPTION: + case ITEM_THIRD_OPTION: + case ITEM_FOURTH_OPTION: + case ITEM_FIFTH_OPTION: + case GROUND_ITEM_FIRST_OPTION: + case GROUND_ITEM_SECOND_OPTION: + case GROUND_ITEM_THIRD_OPTION: + case GROUND_ITEM_FOURTH_OPTION: + case GROUND_ITEM_FIFTH_OPTION: + interactedObject = null; + interactedNpc = null; + } + } + + TileObject findTileObject(int x, int y, int id) + { + Scene scene = client.getScene(); + Tile[][][] tiles = scene.getTiles(); + Tile tile = tiles[client.getPlane()][x][y]; + if (tile != null) + { + for (GameObject gameObject : tile.getGameObjects()) + { + if (gameObject != null && gameObject.getId() == id) + { + return gameObject; + } + } + + WallObject wallObject = tile.getWallObject(); + if (wallObject != null && wallObject.getId() == id) + { + return wallObject; + } + + DecorativeObject decorativeObject = tile.getDecorativeObject(); + if (decorativeObject != null && decorativeObject.getId() == id) + { + return decorativeObject; + } + + GroundObject groundObject = tile.getGroundObject(); + if (groundObject != null && groundObject.getId() == id) + { + return groundObject; + } + } + return null; + } + + NPC findNpc(int id) + { + return client.getCachedNPCs()[id]; + } + + @Nullable + Actor getInteractedTarget() + { + return interactedNpc != null ? interactedNpc : client.getLocalPlayer().getInteracting(); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java index e8aa2b4de9..2016aa6dcb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java @@ -212,6 +212,7 @@ public class ItemStatChanges add(combo(boost(ATTACK, 2), boost(STRENGTH, 1), heal(DEFENCE, -1)), JANGERBERRIES); // Gauntlet items + add(heal(HITPOINTS, 16), CRYSTAL_PADDLEFISH); add(heal(HITPOINTS, 20), PADDLEFISH); add(new GauntletPotion(), EGNIOL_POTION_1, EGNIOL_POTION_2, EGNIOL_POTION_3, EGNIOL_POTION_4); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPlugin.java index b79ee73720..c4a3237535 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/kourendlibrary/KourendLibraryPlugin.java @@ -218,7 +218,7 @@ public class KourendLibraryPlugin extends Plugin { if (MenuAction.GAME_OBJECT_FIRST_OPTION == menuOpt.getMenuAction() && menuOpt.getMenuTarget().contains("Bookshelf")) { - lastBookcaseClick = WorldPoint.fromScene(client, menuOpt.getActionParam(), menuOpt.getWidgetId(), client.getPlane()); + lastBookcaseClick = WorldPoint.fromScene(client, menuOpt.getParam0(), menuOpt.getParam1(), client.getPlane()); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index 05d3ad751e..bdc4d738d7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -792,7 +792,8 @@ public class LootTrackerPlugin extends Plugin || WINTERTODT_SUPPLY_CRATE_EVENT.equals(eventType) || eventType.endsWith("Bird House") || eventType.startsWith("H.A.M. chest") - || lootRecordType == LootRecordType.PICKPOCKET) + || lootRecordType == LootRecordType.PICKPOCKET + || eventType.endsWith("lockbox")) { WorldPoint playerLocation = client.getLocalPlayer().getWorldLocation(); Collection groundItems = lootManager.getItemSpawns(playerLocation); @@ -860,6 +861,12 @@ public class LootTrackerPlugin extends Plugin setEvent(LootRecordType.EVENT, TEMPOROSS_CASKET_EVENT); takeInventorySnapshot(); break; + case ItemID.SIMPLE_LOCKBOX_25647: + case ItemID.ELABORATE_LOCKBOX_25649: + case ItemID.ORNATE_LOCKBOX_25651: + setEvent(LootRecordType.EVENT, itemManager.getItemComposition(event.getId()).getName()); + takeInventorySnapshot(); + break; } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index 53dfcd8608..f1951c162e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -600,7 +600,7 @@ public class MenuEntrySwapperPlugin extends Plugin && (menuEntryAdded.getOption().startsWith("Deposit-") || menuEntryAdded.getOption().startsWith("Store") || menuEntryAdded.getOption().startsWith("Donate"))) { ShiftDepositMode shiftDepositMode = config.bankDepositShiftClick(); - final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getActionParam1()); + final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getParam1()); final int opId = widgetGroupId == WidgetID.DEPOSIT_BOX_GROUP_ID ? shiftDepositMode.getIdentifierDepositBox() : widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_INVENTORY_GROUP_ID ? shiftDepositMode.getIdentifierChambersStorageUnit() : shiftDepositMode.getIdentifier(); @@ -615,7 +615,7 @@ public class MenuEntrySwapperPlugin extends Plugin && menuEntryAdded.getOption().startsWith("Withdraw")) { ShiftWithdrawMode shiftWithdrawMode = config.bankWithdrawShiftClick(); - final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getActionParam1()); + final int widgetGroupId = WidgetInfo.TO_GROUP(menuEntryAdded.getParam1()); final int actionId, opId; if (widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_PRIVATE_GROUP_ID || widgetGroupId == WidgetID.CHAMBERS_OF_XERIC_STORAGE_UNIT_SHARED_GROUP_ID) { @@ -656,7 +656,7 @@ public class MenuEntrySwapperPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (event.getMenuAction() != MenuAction.RUNELITE || event.getWidgetId() != WidgetInfo.INVENTORY.getId()) + if (event.getMenuAction() != MenuAction.RUNELITE || event.getParam1() != WidgetInfo.INVENTORY.getId()) { return; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/ShiftWithdrawMode.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/ShiftWithdrawMode.java index bbe09b1393..6e5d42a1fe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/ShiftWithdrawMode.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/ShiftWithdrawMode.java @@ -37,9 +37,10 @@ public enum ShiftWithdrawMode WITHDRAW_10("Withdraw-10", MenuAction.CC_OP, 4, 3), WITHDRAW_X("Withdraw-X", MenuAction.CC_OP, 5, 5), WITHDRAW_ALL("Withdraw-All", MenuAction.CC_OP_LOW_PRIORITY, 7, 4), - // chambers of xeric storage units do not have an "all-but-1" option, so this option will choose "Withdraw-all" - // instead when using the storage unit. + // chambers of xeric storage units do not have an "all-but-1" option or a "placeholder" option, so these options will choose "Withdraw-all" + // choose "Withdraw-all" instead when using the storage unit. WITHDRAW_ALL_BUT_1("Withdraw-All-But-1", MenuAction.CC_OP_LOW_PRIORITY, 8, 4), + WITHDRAW_PLACEHOLDER("Placeholder", MenuAction.CC_OP_LOW_PRIORITY, 9, 4), OFF("Off", MenuAction.UNKNOWN, 0, 0); private final String name; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java index a68a76d184..95f102267c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java @@ -296,7 +296,7 @@ public class NpcIndicatorsPlugin extends Plugin tagAllEntry.setOption(highlights.stream().anyMatch(npcName::equalsIgnoreCase) ? UNTAG_ALL : TAG_ALL); tagAllEntry.setTarget(event.getTarget()); tagAllEntry.setParam0(event.getActionParam0()); - tagAllEntry.setParam1(event.getActionParam1()); + tagAllEntry.setParam1(event.getParam1()); tagAllEntry.setIdentifier(event.getIdentifier()); tagAllEntry.setType(MenuAction.RUNELITE.getId()); } @@ -309,7 +309,7 @@ public class NpcIndicatorsPlugin extends Plugin tagEntry.setOption(npcTags.contains(npc.getIndex()) ? UNTAG : TAG); tagEntry.setTarget(event.getTarget()); tagEntry.setParam0(event.getActionParam0()); - tagEntry.setParam1(event.getActionParam1()); + tagEntry.setParam1(event.getParam1()); tagEntry.setIdentifier(event.getIdentifier()); tagEntry.setType(MenuAction.RUNELITE.getId()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java index 5fe914b968..403a19fe04 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/objectindicators/ObjectIndicatorsPlugin.java @@ -222,7 +222,7 @@ public class ObjectIndicatorsPlugin extends Plugin return; } - final Tile tile = client.getScene().getTiles()[client.getPlane()][event.getActionParam0()][event.getActionParam1()]; + final Tile tile = client.getScene().getTiles()[client.getPlane()][event.getActionParam0()][event.getParam1()]; final TileObject tileObject = findTileObject(tile, event.getIdentifier()); if (tileObject == null) @@ -236,7 +236,7 @@ public class ObjectIndicatorsPlugin extends Plugin menuEntry.setOption(objects.stream().anyMatch(o -> o.getTileObject() == tileObject) ? UNMARK : MARK); menuEntry.setTarget(event.getTarget()); menuEntry.setParam0(event.getActionParam0()); - menuEntry.setParam1(event.getActionParam1()); + menuEntry.setParam1(event.getParam1()); menuEntry.setIdentifier(event.getIdentifier()); menuEntry.setType(MenuAction.RUNELITE.getId()); client.setMenuEntries(menuEntries); @@ -253,8 +253,8 @@ public class ObjectIndicatorsPlugin extends Plugin Scene scene = client.getScene(); Tile[][][] tiles = scene.getTiles(); - final int x = event.getActionParam(); - final int y = event.getWidgetId(); + final int x = event.getParam0(); + final int y = event.getParam1(); final int z = client.getPlane(); final Tile tile = tiles[z][x][y]; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/poh/BurnerOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/poh/BurnerOverlay.java index 16c8d4edc3..0594e86dd5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/poh/BurnerOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/poh/BurnerOverlay.java @@ -64,12 +64,7 @@ class BurnerOverlay extends Overlay plugin.getIncenseBurners().forEach((tile, burner) -> { - if (tile.getPlane() != client.getPlane()) - { - return; - } - - if (!PohPlugin.BURNER_LIT.contains(burner.getId())) + if (tile.getPlane() != client.getPlane() || !burner.isLit()) { return; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/poh/IncenseBurner.java b/runelite-client/src/main/java/net/runelite/client/plugins/poh/IncenseBurner.java index c47f9bfe14..0679dc6474 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/poh/IncenseBurner.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/poh/IncenseBurner.java @@ -25,20 +25,22 @@ package net.runelite.client.plugins.poh; import java.time.Instant; -import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.RequiredArgsConstructor; import lombok.Setter; @Getter @Setter -@RequiredArgsConstructor -@AllArgsConstructor class IncenseBurner { - private final Instant start = Instant.now(); - private final int id; + private Instant start; + private boolean lit; private double countdownTimer; private double randomTimer; private Instant end; + + void reset() + { + countdownTimer = 0; + randomTimer = 0; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/poh/PohPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/poh/PohPlugin.java index d7d7181060..1cb0a21044 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/poh/PohPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/poh/PohPlugin.java @@ -27,6 +27,7 @@ package net.runelite.client.plugins.poh; import com.google.common.collect.Sets; import com.google.inject.Provides; import java.io.IOException; +import java.time.Instant; import java.util.Comparator; import java.util.HashMap; import java.util.Map; @@ -49,7 +50,6 @@ import net.runelite.api.Tile; import net.runelite.api.TileObject; import net.runelite.api.coords.LocalPoint; import net.runelite.api.events.AnimationChanged; -import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.DecorativeObjectDespawned; import net.runelite.api.events.DecorativeObjectSpawned; import net.runelite.api.events.GameObjectDespawned; @@ -57,6 +57,7 @@ import net.runelite.api.events.GameObjectSpawned; import net.runelite.api.events.GameStateChanged; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.events.ConfigChanged; import net.runelite.client.game.HiscoreManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; @@ -144,9 +145,11 @@ public class PohPlugin extends Plugin return; } - final double countdownTimer = 130.0; // Minimum amount of seconds a burner will light - final double randomTimer = 30.0; // Minimum amount of seconds a burner will light - incenseBurners.put(event.getTile(), new IncenseBurner(gameObject.getId(), countdownTimer, randomTimer, null)); + IncenseBurner incenseBurner = incenseBurners.computeIfAbsent(event.getTile(), k -> new IncenseBurner()); + incenseBurner.setStart(Instant.now()); + incenseBurner.setLit(BURNER_LIT.contains(gameObject.getId())); + incenseBurner.setEnd(null); + // The burner timers are set when observing a player light the burner } @Subscribe @@ -203,6 +206,7 @@ public class PohPlugin extends Plugin .ifPresent(tile -> { final IncenseBurner incenseBurner = incenseBurners.get(tile); + incenseBurner.reset(); if (actor == client.getLocalPlayer()) { @@ -245,6 +249,7 @@ public class PohPlugin extends Plugin { final double tickLengthSeconds = Constants.GAME_TICK_LENGTH / 1000.0; incenseBurner.setCountdownTimer((200 + fmLevel) * tickLengthSeconds); - incenseBurner.setRandomTimer(fmLevel * tickLengthSeconds); + incenseBurner.setRandomTimer((fmLevel - 1) * tickLengthSeconds); + log.debug("Set burner timer for firemaking level {}", fmLevel); } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/puzzlesolver/PuzzleSolverPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/puzzlesolver/PuzzleSolverPlugin.java index a2dfb8577b..0cf417f2d8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/puzzlesolver/PuzzleSolverPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/puzzlesolver/PuzzleSolverPlugin.java @@ -138,7 +138,7 @@ public class PuzzleSolverPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked menuOptionClicked) { - int widgetId = menuOptionClicked.getWidgetId(); + int widgetId = menuOptionClicked.getParam1(); if (TO_GROUP(widgetId) != WidgetID.LIGHT_BOX_GROUP_ID) { return; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java index bb90740f61..4a079391a2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java @@ -137,7 +137,7 @@ enum Task MOGRES("Mogres", ItemID.MOGRE), MOLANISKS("Molanisks", ItemID.MOLANISK), MONKEYS("Monkeys", ItemID.ENSOULED_MONKEY_HEAD, "Tortured gorilla"), - MOSS_GIANTS("Moss giants", ItemID.HILL_GIANT_CLUB), + MOSS_GIANTS("Moss giants", ItemID.MOSSY_KEY), MUTATED_ZYGOMITES("Mutated zygomites", ItemID.MUTATED_ZYGOMITE, 7, ItemID.FUNGICIDE_SPRAY_0, "Zygomite", "Fungi"), NECHRYAEL("Nechryael", ItemID.NECHRYAEL, "Nechryarch"), OGRES("Ogres", ItemID.ENSOULED_OGRE_HEAD), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index 8efa8c2ed5..0171b9148e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -487,7 +487,7 @@ public class TimersPlugin extends Plugin imbuedHeartClickTick = client.getTickCount(); } - TeleportWidget teleportWidget = TeleportWidget.of(event.getWidgetId()); + TeleportWidget teleportWidget = TeleportWidget.of(event.getParam1()); if (teleportWidget != null) { lastTeleportClicked = teleportWidget; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/wiki/WikiPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/wiki/WikiPlugin.java index a794f6c157..7354a5a7f0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/wiki/WikiPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/wiki/WikiPlugin.java @@ -284,11 +284,11 @@ public class WikiPlugin extends Plugin } id = lc.getId(); name = lc.getName(); - location = WorldPoint.fromScene(client, ev.getActionParam(), ev.getWidgetId(), client.getPlane()); + location = WorldPoint.fromScene(client, ev.getParam0(), ev.getParam1(), client.getPlane()); break; } case SPELL_CAST_ON_WIDGET: - Widget w = getWidget(ev.getWidgetId(), ev.getActionParam()); + Widget w = getWidget(ev.getParam1(), ev.getParam0()); if (w.getType() == WidgetType.GRAPHIC && w.getItemId() != -1) { @@ -360,7 +360,7 @@ public class WikiPlugin extends Plugin public void onMenuEntryAdded(MenuEntryAdded event) { int widgetIndex = event.getActionParam0(); - int widgetID = event.getActionParam1(); + int widgetID = event.getParam1(); MenuEntry[] menuEntries = client.getMenuEntries(); if (wikiSelected && event.getType() == MenuAction.SPELL_CAST_ON_WIDGET.getId()) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldHopperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldHopperPlugin.java index 52c1e6d231..dbe2fba12b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldHopperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldHopperPlugin.java @@ -355,7 +355,7 @@ public class WorldHopperPlugin extends Plugin return; } - final int componentId = event.getActionParam1(); + final int componentId = event.getParam1(); int groupId = WidgetInfo.TO_GROUP(componentId); String option = event.getOption(); @@ -401,7 +401,7 @@ public class WorldHopperPlugin extends Plugin hopTo.setTarget(event.getTarget()); hopTo.setType(MenuAction.RUNELITE.getId()); hopTo.setParam0(event.getActionParam0()); - hopTo.setParam1(event.getActionParam1()); + hopTo.setParam1(event.getParam1()); insertMenuEntry(hopTo, client.getMenuEntries(), after); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java index d3a8da0a61..6c73e79b4a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java @@ -29,32 +29,32 @@ import lombok.Getter; import net.runelite.api.Quest; import net.runelite.api.coords.WorldPoint; -// Some quests are in the same spot, but they are done in order. If multiple -// quests start in the same location, an array of quests is expected. enum QuestStartLocation { //Free Quests BELOW_ICE_MOUNTAIN(Quest.BELOW_ICE_MOUNTAIN, new WorldPoint(3001, 3436, 0)), - COOKS_ASSISTANT_RFD(Quest.COOKS_ASSISTANT, new WorldPoint(3211, 3216, 0)), + BLACK_KNIGHTS_FORTRESS(Quest.BLACK_KNIGHTS_FORTRESS, new WorldPoint(2959, 3336, 0)), + COOKS_ASSISTANT(Quest.COOKS_ASSISTANT, new WorldPoint(3209, 3215, 0)), THE_CORSAIR_CURSE(Quest.THE_CORSAIR_CURSE, new WorldPoint(3029, 3273, 0)), DEMON_SLAYER(Quest.DEMON_SLAYER, new WorldPoint(3204, 3424, 0)), DORICS_QUEST(Quest.DORICS_QUEST, new WorldPoint(2952, 3450, 0)), DRAGON_SLAYER_I(Quest.DRAGON_SLAYER_I, new WorldPoint(3190, 3362, 0)), ERNEST_THE_CHICKEN(Quest.ERNEST_THE_CHICKEN, new WorldPoint(3109, 3330, 0)), GOBLIN_DIPLOMACY(Quest.GOBLIN_DIPLOMACY, new WorldPoint(2957, 3509, 0)), - IMP_CATCHER(Quest.IMP_CATCHER, new WorldPoint(3108, 3160, 0)), + IMP_CATCHER(Quest.IMP_CATCHER, new WorldPoint(3102, 3164, 0)), THE_KNIGHTS_SWORD(Quest.THE_KNIGHTS_SWORD, new WorldPoint(2976, 3342, 0)), MISTHALIN_MYSTERY(Quest.MISTHALIN_MYSTERY, new WorldPoint(3235, 3155, 0)), PIRATES_TREASURE(Quest.PIRATES_TREASURE, new WorldPoint(3051, 3252, 0)), PRINCE_ALI_RESCUE(Quest.PRINCE_ALI_RESCUE, new WorldPoint(3301, 3163, 0)), THE_RESTLESS_GHOST(Quest.THE_RESTLESS_GHOST, new WorldPoint(3240, 3210, 0)), - RUNE_MYSTERIES(Quest.RUNE_MYSTERIES, new WorldPoint(3210, 3220, 0)), - SHEEP_SHEARER(Quest.SHEEP_SHEARER, new WorldPoint(3190, 3272, 0)), + ROMEO__JULIET(Quest.ROMEO__JULIET, new WorldPoint(3210, 3423, 0)), + RUNE_MYSTERIES(Quest.RUNE_MYSTERIES, new WorldPoint(3211, 3224, 0)), + SHEEP_SHEARER(Quest.SHEEP_SHEARER, new WorldPoint(3187, 3272, 0)), SHIELD_OF_ARRAV_PHOENIX_GANG(Quest.SHIELD_OF_ARRAV, new WorldPoint(3208, 3495, 0)), SHIELD_OF_ARRAV_BLACK_ARM_GANG(Quest.SHIELD_OF_ARRAV, new WorldPoint(3208, 3392, 0)), VAMPYRE_SLAYER(Quest.VAMPYRE_SLAYER, new WorldPoint(3096, 3266, 0)), - WITCHS_POTION(Quest.WITCHS_POTION, new WorldPoint(2967, 3203, 0)), - X_MARKS_THE_SPOT(Quest.X_MARKS_THE_SPOT, new WorldPoint(3227, 3242, 0)), + WITCHS_POTION(Quest.WITCHS_POTION, new WorldPoint(2968, 3204, 0)), + X_MARKS_THE_SPOT(Quest.X_MARKS_THE_SPOT, new WorldPoint(3226, 3242, 0)), //Members' Quests ANIMAL_MAGNETISM(Quest.ANIMAL_MAGNETISM, new WorldPoint(3094, 3360, 0)), @@ -65,29 +65,31 @@ enum QuestStartLocation BIOHAZARD(Quest.BIOHAZARD, new WorldPoint(2591, 3335, 0)), BONE_VOYAGE(Quest.BONE_VOYAGE, new WorldPoint(3259, 3450, 0)), CABIN_FEVER(Quest.CABIN_FEVER, new WorldPoint(3674, 3496, 0)), - CLIENT_OF_KOUREND(Quest.CLIENT_OF_KOUREND, new WorldPoint(1823, 3690, 0)), + CLIENT_OF_KOUREND(Quest.CLIENT_OF_KOUREND, new WorldPoint(1825, 3690, 0)), CLOCK_TOWER(Quest.CLOCK_TOWER, new WorldPoint(2568, 3249, 0)), COLD_WAR(Quest.COLD_WAR, new WorldPoint(2593, 3265, 0)), CONTACT(Quest.CONTACT, new WorldPoint(3280, 2770, 0)), CREATURE_OF_FENKENSTRAIN(Quest.CREATURE_OF_FENKENSTRAIN, new WorldPoint(3487, 3485, 0)), - DARKNESS_OF_HALLOWVALE(Quest.DARKNESS_OF_HALLOWVALE, new WorldPoint(3494, 9628, 0)), - DEATH_PLATEAU_TROLL_STRONGHOLD(new Quest[]{Quest.DEATH_PLATEAU, Quest.TROLL_STRONGHOLD}, new WorldPoint(2895, 3528, 0)), + DARKNESS_OF_HALLOWVALE(Quest.DARKNESS_OF_HALLOWVALE, new WorldPoint(3493, 9588, 0)), + DEATH_PLATEAU(Quest.DEATH_PLATEAU, new WorldPoint(2897, 3529, 0)), DEATH_TO_THE_DORGESHUUN(Quest.DEATH_TO_THE_DORGESHUUN, new WorldPoint(3316, 9613, 0)), THE_DEPTHS_OF_DESPAIR(Quest.THE_DEPTHS_OF_DESPAIR, new WorldPoint(1781, 3570, 0)), DESERT_TREASURE(Quest.DESERT_TREASURE, new WorldPoint(3177, 3043, 0)), DEVIOUS_MINDS(Quest.DEVIOUS_MINDS, new WorldPoint(3405, 3492, 0)), - THE_DIG_SITE(Quest.THE_DIG_SITE, new WorldPoint(3363, 3337, 0)), + THE_DIG_SITE(Quest.THE_DIG_SITE, new WorldPoint(3363, 3341, 0)), DRAGON_SLAYER_II(Quest.DRAGON_SLAYER_II, new WorldPoint(2456, 2868, 0)), DREAM_MENTOR(Quest.DREAM_MENTOR, new WorldPoint(2144, 10346, 0)), DRUIDIC_RITUAL(Quest.DRUIDIC_RITUAL, new WorldPoint(2916, 3484, 0)), DWARF_CANNON(Quest.DWARF_CANNON, new WorldPoint(2566, 3461, 0)), EADGARS_RUSE(Quest.EADGARS_RUSE, new WorldPoint(2896, 3426, 0)), EAGLES_PEAK(Quest.EAGLES_PEAK, new WorldPoint(2605, 3264, 0)), - ELEMENTAL_WORKSHOP(new Quest[]{Quest.ELEMENTAL_WORKSHOP_I, Quest.ELEMENTAL_WORKSHOP_II}, new WorldPoint(2714, 3482, 0)), + ELEMENTAL_WORKSHOP_I(Quest.ELEMENTAL_WORKSHOP_I, new WorldPoint(2714, 3482, 0)), + ELEMENTAL_WORKSHOP_II(Quest.ELEMENTAL_WORKSHOP_II, new WorldPoint(3364, 3335, 0)), ENAKHRAS_LAMENT(Quest.ENAKHRAS_LAMENT, new WorldPoint(3190, 2926, 0)), ENLIGHTENED_JOURNEY(Quest.ENLIGHTENED_JOURNEY, new WorldPoint(2809, 3356, 0)), - THE_EYES_OF_GLOUPHRIE(Quest.THE_EYES_OF_GLOUPHRIE, new WorldPoint(2400, 3419, 0)), - FAIRYTALE(new Quest[]{Quest.FAIRYTALE_I__GROWING_PAINS, Quest.FAIRYTALE_II__CURE_A_QUEEN}, new WorldPoint(3077, 3258, 0)), + THE_EYES_OF_GLOUPHRIE(Quest.THE_EYES_OF_GLOUPHRIE, new WorldPoint(2405, 9817, 0)), + FAIRYTALE_I(Quest.FAIRYTALE_I__GROWING_PAINS, new WorldPoint(3075, 3259, 0)), + FAIRYTALE_II(Quest.FAIRYTALE_II__CURE_A_QUEEN, new WorldPoint(3078, 3258, 0)), FAMILY_CREST(Quest.FAMILY_CREST, new WorldPoint(3278, 3404, 0)), THE_FEUD(Quest.THE_FEUD, new WorldPoint(3301, 3211, 0)), FIGHT_ARENA(Quest.FIGHT_ARENA, new WorldPoint(2565, 3199, 0)), @@ -96,60 +98,71 @@ enum QuestStartLocation FORGETTABLE_TALE(Quest.FORGETTABLE_TALE, new WorldPoint(2826, 10215, 0)), THE_FORSAKEN_TOWER(Quest.THE_FORSAKEN_TOWER, new WorldPoint(1482, 3748, 0)), THE_FREMENNIK_ISLES(Quest.THE_FREMENNIK_ISLES, new WorldPoint(2645, 3711, 0)), - THE_FREMENNIK_TRIALS(Quest.THE_FREMENNIK_TRIALS, new WorldPoint(2657, 3669, 0)), - THE_FREMENNIK_EXILES(Quest.THE_FREMENNIK_EXILES, new WorldPoint(2658, 3669, 0)), + THE_FREMENNIK_TRIALS(Quest.THE_FREMENNIK_TRIALS, new WorldPoint(2658, 3667, 0)), + THE_FREMENNIK_EXILES(Quest.THE_FREMENNIK_EXILES, new WorldPoint(2656, 3669, 0)), GARDEN_OF_TRANQUILLITY(Quest.GARDEN_OF_TRANQUILLITY, new WorldPoint(3227, 3477, 0)), - GERTRUDES_CAT_RATCATCHERS(Quest.GERTRUDES_CAT, new WorldPoint(3150, 3411, 0)), + GERTRUDES_CAT(Quest.GERTRUDES_CAT, new WorldPoint(3150, 3411, 0)), GETTING_AHEAD(Quest.GETTING_AHEAD, new WorldPoint(1247, 3686, 0)), GHOSTS_AHOY(Quest.GHOSTS_AHOY, new WorldPoint(3677, 3510, 0)), THE_GIANT_DWARF(Quest.THE_GIANT_DWARF, new WorldPoint(2841, 10129, 0)), THE_GOLEM(Quest.THE_GOLEM, new WorldPoint(3487, 3089, 0)), - THE_GRAND_TREE_MONKEY_MADNESS(new Quest[]{Quest.THE_GRAND_TREE, Quest.MONKEY_MADNESS_I, Quest.MONKEY_MADNESS_II}, new WorldPoint(2466, 3497, 0)), + THE_GRAND_TREE(Quest.THE_GRAND_TREE, new WorldPoint(2464, 3494, 0)), THE_GREAT_BRAIN_ROBBERY(Quest.THE_GREAT_BRAIN_ROBBERY, new WorldPoint(3681, 2963, 0)), GRIM_TALES(Quest.GRIM_TALES, new WorldPoint(2890, 3454, 0)), - THE_HAND_IN_THE_SAND(Quest.THE_HAND_IN_THE_SAND, new WorldPoint(2552, 3101, 0)), + THE_HAND_IN_THE_SAND(Quest.THE_HAND_IN_THE_SAND, new WorldPoint(2551, 3101, 0)), HAUNTED_MINE(Quest.HAUNTED_MINE, new WorldPoint(3443, 3258, 0)), HAZEEL_CULT(Quest.HAZEEL_CULT, new WorldPoint(2565, 3271, 0)), HEROES_QUEST(Quest.HEROES_QUEST, new WorldPoint(2903, 3511, 0)), - HOLY_GRAIL(new Quest[]{Quest.MERLINS_CRYSTAL, Quest.HOLY_GRAIL}, new WorldPoint(2763, 3515, 0)), + HOLY_GRAIL(Quest.HOLY_GRAIL, new WorldPoint(2763, 3513, 0)), HORROR_FROM_THE_DEEP(Quest.HORROR_FROM_THE_DEEP, new WorldPoint(2507, 3635, 0)), ICTHLARINS_LITTLE_HELPER(Quest.ICTHLARINS_LITTLE_HELPER, new WorldPoint(3314, 2849, 0)), + IN_AID_OF_THE_MYREQUE(Quest.IN_AID_OF_THE_MYREQUE, new WorldPoint(3505, 9839, 0)), IN_SEARCH_OF_THE_MYREQUE(Quest.IN_SEARCH_OF_THE_MYREQUE, new WorldPoint(3502, 3477, 0)), JUNGLE_POTION(Quest.JUNGLE_POTION, new WorldPoint(2809, 3086, 0)), A_KINGDOM_DIVIDED(Quest.A_KINGDOM_DIVIDED, new WorldPoint(1663, 3672, 0)), KINGS_RANSOM(Quest.KINGS_RANSOM, new WorldPoint(2741, 3554, 0)), LEGENDS_QUEST(Quest.LEGENDS_QUEST, new WorldPoint(2725, 3367, 0)), LOST_CITY(Quest.LOST_CITY, new WorldPoint(3149, 3205, 0)), - THE_LOST_TRIBE(Quest.THE_LOST_TRIBE, new WorldPoint(3211, 3224, 0)), + THE_LOST_TRIBE(Quest.THE_LOST_TRIBE, new WorldPoint(3210, 3220, 0)), LUNAR_DIPLOMACY(Quest.LUNAR_DIPLOMACY, new WorldPoint(2618, 3691, 0)), MAKING_FRIENDS_WITH_MY_ARM(Quest.MAKING_FRIENDS_WITH_MY_ARM, new WorldPoint(2904, 10092, 0)), MAKING_HISTORY(Quest.MAKING_HISTORY, new WorldPoint(2435, 3346, 0)), - MONKS_FRIEND(Quest.MONKS_FRIEND, new WorldPoint(2605, 3209, 0)), + MERLINS_CRYSTAL(Quest.MERLINS_CRYSTAL, new WorldPoint(2761, 3516, 0)), + MONKEY_MADNESS_I(Quest.MONKEY_MADNESS_I, new WorldPoint(2465, 3498, 0)), + MONKEY_MADNESS_II(Quest.MONKEY_MADNESS_II, new WorldPoint(2466, 3496, 0)), + MONKS_FRIEND(Quest.MONKS_FRIEND, new WorldPoint(2605, 3211, 0)), MOUNTAIN_DAUGHTER(Quest.MOUNTAIN_DAUGHTER, new WorldPoint(2810, 3672, 0)), - MOURNINGS_ENDS_PART_I(Quest.MOURNINGS_END_PART_I, new WorldPoint(2289, 3149, 0)), + MOURNINGS_ENDS_PART_I(Quest.MOURNINGS_END_PART_I, new WorldPoint(2288, 3147, 0)), MOURNINGS_ENDS_PART_II(Quest.MOURNINGS_END_PART_II, new WorldPoint(2352, 3172, 0)), MURDER_MYSTERY(Quest.MURDER_MYSTERY, new WorldPoint(2740, 3562, 0)), MY_ARMS_BIG_ADVENTURE(Quest.MY_ARMS_BIG_ADVENTURE, new WorldPoint(2908, 10088, 0)), - NATURE_SPIRIT(Quest.NATURE_SPIRIT, new WorldPoint(3440, 9894, 0)), + NATURE_SPIRIT(Quest.NATURE_SPIRIT, new WorldPoint(3423, 9886, 0)), A_NIGHT_AT_THE_THEATRE(Quest.A_NIGHT_AT_THE_THEATRE, new WorldPoint(3672, 3224, 0)), OBSERVATORY_QUEST(Quest.OBSERVATORY_QUEST, new WorldPoint(2438, 3185, 0)), OLAFS_QUEST(Quest.OLAFS_QUEST, new WorldPoint(2723, 3729, 0)), ONE_SMALL_FAVOUR(Quest.ONE_SMALL_FAVOUR, new WorldPoint(2834, 2985, 0)), - PLAGUE_CITY_SONG_OF_THE_ELVES(new Quest[]{Quest.PLAGUE_CITY, Quest.SONG_OF_THE_ELVES}, new WorldPoint(2567, 3334, 0)), + PLAGUE_CITY(Quest.PLAGUE_CITY, new WorldPoint(2568, 3332, 0)), A_PORCINE_OF_INTEREST(Quest.A_PORCINE_OF_INTEREST, new WorldPoint(3085, 3251, 0)), PRIEST_IN_PERIL(Quest.PRIEST_IN_PERIL, new WorldPoint(3219, 3473, 0)), THE_QUEEN_OF_THIEVES(Quest.THE_QUEEN_OF_THIEVES, new WorldPoint(1795, 3782, 0)), - RAG_AND_BONE_MAN_I(new Quest[]{Quest.RAG_AND_BONE_MAN_I, Quest.RAG_AND_BONE_MAN_II}, new WorldPoint(3359, 3504, 0)), - RECRUITMENT_DRIVE_BLACK_KNIGHTS_FORTRESS(new Quest[]{Quest.BLACK_KNIGHTS_FORTRESS, Quest.RECRUITMENT_DRIVE}, new WorldPoint(2959, 3336, 0)), - ROVING_ELVES(Quest.ROVING_ELVES, new WorldPoint(2288, 3146, 0)), - RUM_DEAL(Quest.RUM_DEAL, new WorldPoint(3679, 3535, 0)), - SCORPION_CATCHER(Quest.SCORPION_CATCHER, new WorldPoint(2701, 3399, 0)), + RAG_AND_BONE_MAN_I(Quest.RAG_AND_BONE_MAN_I, new WorldPoint(3359, 3504, 0)), + RAG_AND_BONE_MAN_II(Quest.RAG_AND_BONE_MAN_II, new WorldPoint(3361, 3507, 0)), + RATCATCHERS(Quest.RATCATCHERS, new WorldPoint(3243, 9867, 0)), + RECIPE_FOR_DISASTER(Quest.RECIPE_FOR_DISASTER, new WorldPoint(3206, 3213, 0)), + RECRUITMENT_DRIVE(Quest.RECRUITMENT_DRIVE, new WorldPoint(2962, 3338, 0)), + REGICIDE(Quest.REGICIDE, new WorldPoint(2575, 3293, 0)), + ROVING_ELVES(Quest.ROVING_ELVES, new WorldPoint(2287, 3144, 0)), + ROYAL_TROUBLE(Quest.ROYAL_TROUBLE, new WorldPoint(2497, 3857, 0)), + RUM_DEAL(Quest.RUM_DEAL, new WorldPoint(3677, 3535, 0)), + SCORPION_CATCHER(Quest.SCORPION_CATCHER, new WorldPoint(2700, 3404, 0)), SEA_SLUG(Quest.SEA_SLUG, new WorldPoint(2715, 3302, 0)), SHADES_OF_MORTTON(Quest.SHADES_OF_MORTTON, new WorldPoint(3463, 3308, 0)), SHADOW_OF_THE_STORM(Quest.SHADOW_OF_THE_STORM, new WorldPoint(3270, 3159, 0)), SHEEP_HERDER(Quest.SHEEP_HERDER, new WorldPoint(2616, 3299, 0)), SHILO_VILLAGE(Quest.SHILO_VILLAGE, new WorldPoint(2882, 2951, 0)), SINS_OF_THE_FATHER(Quest.SINS_OF_THE_FATHER, new WorldPoint(3728, 3319, 0)), + THE_SLUG_MENACE(Quest.THE_SLUG_MENACE, new WorldPoint(2994, 3374, 0)), + SONG_OF_THE_ELVES(Quest.SONG_OF_THE_ELVES, new WorldPoint(2567, 3335, 0)), A_SOULS_BANE(Quest.A_SOULS_BANE, new WorldPoint(3307, 3454, 0)), SPIRITS_OF_THE_ELID(Quest.SPIRITS_OF_THE_ELID, new WorldPoint(3441, 2911, 0)), SWAN_SONG(Quest.SWAN_SONG, new WorldPoint(2345, 3652, 0)), @@ -158,15 +171,16 @@ enum QuestStartLocation TALE_OF_THE_RIGHTEOUS(Quest.TALE_OF_THE_RIGHTEOUS, new WorldPoint(1541, 3570, 0)), A_TASTE_OF_HOPE(Quest.A_TASTE_OF_HOPE, new WorldPoint(3668, 3216, 0)), TEARS_OF_GUTHIX(Quest.TEARS_OF_GUTHIX, new WorldPoint(3251, 9517, 0)), - TEMPLE_OF_IKOV(Quest.TEMPLE_OF_IKOV, new WorldPoint(2574, 3320, 0)), - THRONE_OF_MISCELLANIA_ROYAL_TROUBLE(new Quest[]{Quest.THRONE_OF_MISCELLANIA, Quest.ROYAL_TROUBLE}, new WorldPoint(2497, 3859, 0)), + TEMPLE_OF_IKOV(Quest.TEMPLE_OF_IKOV, new WorldPoint(2571, 3320, 0)), + THRONE_OF_MISCELLANIA(Quest.THRONE_OF_MISCELLANIA, new WorldPoint(2497, 3861, 0)), THE_TOURIST_TRAP(Quest.THE_TOURIST_TRAP, new WorldPoint(3302, 3113, 0)), TOWER_OF_LIFE(Quest.TOWER_OF_LIFE, new WorldPoint(2640, 3218, 0)), TREE_GNOME_VILLAGE(Quest.TREE_GNOME_VILLAGE, new WorldPoint(2541, 3169, 0)), TRIBAL_TOTEM(Quest.TRIBAL_TOTEM, new WorldPoint(2790, 3182, 0)), TROLL_ROMANCE(Quest.TROLL_ROMANCE, new WorldPoint(2890, 10097, 0)), - UNDERGROUND_PASS_REGICIDE(new Quest[]{Quest.REGICIDE, Quest.UNDERGROUND_PASS}, new WorldPoint(2575, 3293, 0)), - WANTED_SLUG_MENACE(new Quest[]{Quest.WANTED, Quest.THE_SLUG_MENACE}, new WorldPoint(2996, 3373, 0)), + TROLL_STRONGHOLD(Quest.TROLL_STRONGHOLD, new WorldPoint(2893, 3528, 0)), + UNDERGROUND_PASS(Quest.UNDERGROUND_PASS, new WorldPoint(2578, 3295, 0)), + WANTED(Quest.WANTED, new WorldPoint(2998, 3372, 0)), WATCHTOWER(Quest.WATCHTOWER, new WorldPoint(2545, 3112, 0)), WATERFALL_QUEST(Quest.WATERFALL_QUEST, new WorldPoint(2521, 3498, 0)), WHAT_LIES_BELOW(Quest.WHAT_LIES_BELOW, new WorldPoint(3265, 3333, 0)), @@ -177,17 +191,11 @@ enum QuestStartLocation private final WorldPoint location; @Getter - private final Quest[] quests; - - QuestStartLocation(Quest[] quests, WorldPoint location) - { - this.location = location; - this.quests = quests; - } + private final Quest quest; QuestStartLocation(Quest quest, WorldPoint location) { this.location = location; - this.quests = new Quest[]{quest}; + this.quest = quest; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java index 3fbca342b6..fcd4c9f0ed 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java @@ -188,8 +188,8 @@ public interface WorldMapConfig extends Config @ConfigItem( keyName = WorldMapPlugin.CONFIG_KEY_QUEST_START_TOOLTIPS, - name = "Quest names and status", - description = "Indicates the names of quests and shows completion status", + name = "Quest status icons", + description = "Shows completion status of quests on the quest's icon", position = 15 ) default boolean questStartTooltips() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java index 1306c88b75..cfe7714b5e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java @@ -33,7 +33,6 @@ import java.util.function.Predicate; import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.api.Quest; -import net.runelite.api.QuestState; import net.runelite.api.Skill; import net.runelite.api.events.StatChanged; import net.runelite.api.events.WidgetLoaded; @@ -505,41 +504,21 @@ public class WorldMapPlugin extends Plugin private MapPoint createQuestStartPoint(QuestStartLocation data) { - Quest[] quests = data.getQuests(); - - // Get first uncompleted quest. Else, return the last quest. - Quest quest = null; - for (Quest q : quests) - { - if (q.getState(client) != QuestState.FINISHED) - { - quest = q; - break; - } - } - if (quest == null) - { - quest = quests[quests.length - 1]; - } + Quest quest = data.getQuest(); BufferedImage icon = BLANK_ICON; - String tooltip = ""; if (quest != null) { - tooltip = quest.getName(); switch (quest.getState(client)) { case FINISHED: icon = FINISHED_ICON; - tooltip += " - Finished"; break; case IN_PROGRESS: icon = STARTED_ICON; - tooltip += " - Started"; break; case NOT_STARTED: icon = NOT_STARTED_ICON; - tooltip += " - Not Started"; break; } } @@ -548,7 +527,6 @@ public class WorldMapPlugin extends Plugin .type(MapPoint.Type.QUEST) .worldPoint(data.getLocation()) .image(icon) - .tooltip(tooltip) .build(); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java index a69575503a..026b8980ac 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java @@ -508,7 +508,7 @@ public class XpTrackerPlugin extends Plugin @Subscribe public void onMenuEntryAdded(final MenuEntryAdded event) { - int widgetID = event.getActionParam1(); + int widgetID = event.getParam1(); if (TO_GROUP(widgetID) != WidgetID.SKILLS_GROUP_ID || !event.getOption().startsWith("View") @@ -538,7 +538,7 @@ public class XpTrackerPlugin extends Plugin public void onMenuOptionClicked(MenuOptionClicked event) { if (event.getMenuAction().getId() != MenuAction.RUNELITE.getId() - || TO_GROUP(event.getWidgetId()) != WidgetID.SKILLS_GROUP_ID) + || TO_GROUP(event.getParam1()) != WidgetID.SKILLS_GROUP_ID) { return; } diff --git a/runelite-client/src/main/java/net/runelite/client/util/ColorUtil.java b/runelite-client/src/main/java/net/runelite/client/util/ColorUtil.java index 6b39003f11..6a7b8f8908 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/ColorUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/util/ColorUtil.java @@ -101,11 +101,14 @@ public class ColorUtil final double g2 = b.getGreen(); final double b1 = a.getBlue(); final double b2 = b.getBlue(); + final double a1 = a.getAlpha(); + final double a2 = b.getAlpha(); return new Color( (int) Math.round(r1 + (t * (r2 - r1))), (int) Math.round(g1 + (t * (g2 - g1))), - (int) Math.round(b1 + (t * (b2 - b1))) + (int) Math.round(b1 + (t * (b2 - b1))), + (int) Math.round(a1 + (t * (a2 - a1))) ); } diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/league.png b/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/league.png deleted file mode 100644 index 9b8394065a..0000000000 Binary files a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/league.png and /dev/null differ diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/tournament.png b/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/tournament.png new file mode 100644 index 0000000000..e74b1d940b Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/tournament.png differ diff --git a/runelite-client/src/main/scripts/ChatSplitBuilder.hash b/runelite-client/src/main/scripts/ChatSplitBuilder.hash index c68b80b6f4..c2a17a7084 100644 --- a/runelite-client/src/main/scripts/ChatSplitBuilder.hash +++ b/runelite-client/src/main/scripts/ChatSplitBuilder.hash @@ -1 +1 @@ -BADE5769E553D84CF031C4D278466E46B74E12CF62A3351646CD1C504D7A426A \ No newline at end of file +F4D54D6A71A806F01FA6B823A3E75524B857E2F556E0AE55FEA0A4ABFEB603C9 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm index 42454852f1..a443acbb19 100644 --- a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm +++ b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm @@ -62,7 +62,7 @@ LABEL49: iconst 73 iconst 73 iload 6 - iconst 10551333 + iconst 10551334 enum if_getheight add diff --git a/runelite-client/src/main/scripts/LayoutResizableStones.hash b/runelite-client/src/main/scripts/LayoutResizableStones.hash index 2c7e47c900..60dc015aa3 100644 --- a/runelite-client/src/main/scripts/LayoutResizableStones.hash +++ b/runelite-client/src/main/scripts/LayoutResizableStones.hash @@ -1 +1 @@ -C3095F0E7973E9EF0E8035AF4B4AC7CE28D692B71A63DE31B7820F1D2AB09F2E \ No newline at end of file +A9D5E42A864BFEEE2BB8CAF4A111A68426B7CE5DF5C982AF168F90A28CAE4423 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm index 2f5f8e0c57..65fd994c2d 100644 --- a/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm +++ b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm @@ -14,17 +14,17 @@ istore 4 iload 1 switch - 1745: LABEL129 - 1129: LABEL109 - 1130: LABEL87 + 1745: LABEL145 + 1129: LABEL125 + 1130: LABEL95 1131: LABEL9 - jump LABEL204 + jump LABEL220 LABEL9: - iconst 10747944 + iconst 10747945 if_getwidth iconst 33 sub - iconst 10747944 + iconst 10747945 if_getheight istore 3 istore 2 @@ -33,7 +33,7 @@ LABEL9: iconst 73 iconst 73 iload 1 - iconst 10551333 + iconst 10551334 enum if_getwidth sub @@ -48,7 +48,7 @@ LABEL9: LABEL29: iconst 0 iload 3 - iconst 10747959 + iconst 10747960 if_getheight add iconst 2 @@ -56,14 +56,14 @@ LABEL29: iconst 73 iconst 73 iload 1 - iconst 10747976 + iconst 10747977 enum if_setposition iconst 0 iload 3 iconst 2 iconst 2 - iconst 10747959 + iconst 10747960 if_setposition jump LABEL65 LABEL49: @@ -74,14 +74,14 @@ LABEL49: iconst 73 iconst 73 iload 1 - iconst 10747976 + iconst 10747977 enum if_setposition iload 2 iconst 0 iconst 2 iconst 2 - iconst 10747959 + iconst 10747960 if_setposition LABEL65: get_varbit 4084 @@ -93,7 +93,7 @@ LABEL69: iconst 73 iconst 73 iload 1 - iconst 10551329 + iconst 10551330 enum 2122 jump LABEL84 @@ -102,77 +102,97 @@ LABEL77: iconst 73 iconst 73 iload 1 - iconst 10551329 + iconst 10551330 enum 2122 LABEL84: clientclock set_varc_int 384 - jump LABEL204 -LABEL87: + invoke 2357 + iconst 1 + if_icmpeq LABEL90 + jump LABEL94 +LABEL90: + get_varbit 12986 + invoke 633 + iconst 10747930 + if_sethide +LABEL94: + jump LABEL220 +LABEL95: get_varbit 4084 iconst 1 - if_icmpeq LABEL91 - jump LABEL99 -LABEL91: + if_icmpeq LABEL99 + jump LABEL107 +LABEL99: iconst 1178 iconst 73 iconst 73 iload 1 - iconst 10551329 + iconst 10551330 enum 2122 - jump LABEL106 -LABEL99: + jump LABEL114 +LABEL107: iconst 2154 iconst 73 iconst 73 iload 1 - iconst 10551329 + iconst 10551330 enum 2122 -LABEL106: +LABEL114: clientclock set_varc_int 384 - jump LABEL204 -LABEL109: + invoke 2357 + iconst 1 + if_icmpeq LABEL120 + jump LABEL124 +LABEL120: + get_varbit 12986 + invoke 633 + iconst 10551322 + if_sethide +LABEL124: + jump LABEL220 +LABEL125: invoke 3297 iconst 1 - if_icmpeq LABEL113 - jump LABEL121 -LABEL113: + if_icmpeq LABEL129 + jump LABEL137 +LABEL129: iconst 2422 iconst 73 iconst 73 iload 1 - iconst 10551329 + iconst 10551330 enum 2122 - jump LABEL128 -LABEL121: + jump LABEL144 +LABEL137: iconst 1200 iconst 73 iconst 73 iload 1 - iconst 10551329 + iconst 10551330 enum 2122 -LABEL128: - jump LABEL204 -LABEL129: +LABEL144: + jump LABEL220 +LABEL145: get_varbit 6257 iconst 1 - if_icmpeq LABEL136 + if_icmpeq LABEL152 get_varbit 542 iconst 1 - if_icmpeq LABEL136 - jump LABEL140 -LABEL136: + if_icmpeq LABEL152 + jump LABEL156 +LABEL152: iconst 1 iconst 39387175 if_sethide - jump LABEL195 -LABEL140: + jump LABEL211 +LABEL156: iconst 0 iconst 39387175 if_sethide @@ -181,11 +201,11 @@ LABEL140: 2308 get_varbit 6255 switch - 1: LABEL157 - 2: LABEL149 - 3: LABEL165 - jump LABEL173 -LABEL149: + 1: LABEL173 + 2: LABEL165 + 3: LABEL181 + jump LABEL189 +LABEL165: iconst 1718 iconst 39387177 if_setgraphic @@ -193,8 +213,8 @@ LABEL149: sconst "Toggle single-tap mode" iconst 39387175 if_setop - jump LABEL180 -LABEL157: + jump LABEL196 +LABEL173: iconst 1717 iconst 39387177 if_setgraphic @@ -202,8 +222,8 @@ LABEL157: sconst "Toggle tap-to-drop mode" iconst 39387175 if_setop - jump LABEL180 -LABEL165: + jump LABEL196 +LABEL181: iconst 1716 iconst 39387177 if_setgraphic @@ -211,8 +231,8 @@ LABEL165: sconst "Show Keyboard" iconst 39387175 if_setop - jump LABEL180 -LABEL173: + jump LABEL196 +LABEL189: iconst 1715 iconst 39387177 if_setgraphic @@ -220,26 +240,26 @@ LABEL173: sconst "" iconst 39387175 if_setop -LABEL180: +LABEL196: get_varbit 6255 iconst 3 - if_icmpne LABEL184 - jump LABEL192 -LABEL184: + if_icmpne LABEL200 + jump LABEL208 +LABEL200: get_varbit 6256 iconst 0 - if_icmpeq LABEL188 - jump LABEL192 -LABEL188: + if_icmpeq LABEL204 + jump LABEL208 +LABEL204: iconst 155 iconst 39387177 if_settrans - jump LABEL195 -LABEL192: + jump LABEL211 +LABEL208: iconst 0 iconst 39387177 if_settrans -LABEL195: +LABEL211: invoke 2581 get_varbit 6254 invoke 633 @@ -249,5 +269,5 @@ LABEL195: pop_int clientclock set_varc_int 384 -LABEL204: +LABEL220: return diff --git a/runelite-client/src/test/java/net/runelite/client/util/ColorUtilTest.java b/runelite-client/src/test/java/net/runelite/client/util/ColorUtilTest.java index 8a531b18bc..cf663d1fa2 100644 --- a/runelite-client/src/test/java/net/runelite/client/util/ColorUtilTest.java +++ b/runelite-client/src/test/java/net/runelite/client/util/ColorUtilTest.java @@ -116,6 +116,7 @@ public class ColorUtilTest assertEquals(new Color(128, 128, 128), ColorUtil.colorLerp(Color.BLACK, Color.WHITE, 0.5)); assertEquals(Color.BLACK, ColorUtil.colorLerp(Color.BLACK, Color.CYAN, 0)); assertEquals(Color.CYAN, ColorUtil.colorLerp(Color.BLACK, Color.CYAN, 1)); + assertEquals(new Color(0x80800080, true), ColorUtil.colorLerp(new Color(0xff0000ff, true), new Color(0x00ff0000, true), 0.5)); } @Test diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/MenuMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/MenuMixin.java index 87bd27d283..6fb4d17233 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/MenuMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/MenuMixin.java @@ -188,8 +188,8 @@ public abstract class MenuMixin implements RSClient getMenuTargets()[i] = entry.getTarget(); getMenuIdentifiers()[i] = entry.getIdentifier(); getMenuOpcodes()[i] = entry.getOpcode(); - getMenuArguments1()[i] = entry.getActionParam(); - getMenuArguments2()[i] = entry.getActionParam1(); + getMenuArguments1()[i] = entry.getParam0(); + getMenuArguments2()[i] = entry.getParam1(); getMenuForceLeftClick()[i] = entry.isForceLeftClick(); } @@ -215,7 +215,7 @@ public abstract class MenuMixin implements RSClient tempMenuAction.setOption(entry.getOption()); tempMenuAction.setOpcode(entry.getOpcode()); tempMenuAction.setIdentifier(entry.getIdentifier()); - tempMenuAction.setParam0(entry.getActionParam()); - tempMenuAction.setParam1(entry.getActionParam1()); + tempMenuAction.setParam0(entry.getParam0()); + tempMenuAction.setParam1(entry.getParam1()); } } diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java index daccfc62ff..1162e83edb 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java @@ -777,8 +777,8 @@ public abstract class RSClientMixin implements RSClient entry.setTarget(menuTargets[i]); entry.setIdentifier(menuIdentifiers[i]); entry.setOpcode(menuTypes[i]); - entry.setActionParam(params0[i]); - entry.setActionParam1(params1[i]); + entry.setParam0(params0[i]); + entry.setParam1(params1[i]); entry.setForceLeftClick(leftClick[i]); } return entries; @@ -808,8 +808,8 @@ public abstract class RSClientMixin implements RSClient menuTargets[count] = entry.getTarget(); menuIdentifiers[count] = entry.getIdentifier(); menuTypes[count] = entry.getOpcode(); - params0[count] = entry.getActionParam(); - params1[count] = entry.getActionParam1(); + params0[count] = entry.getParam0(); + params1[count] = entry.getParam1(); leftClick[count] = entry.isForceLeftClick(); ++count; } @@ -855,8 +855,8 @@ public abstract class RSClientMixin implements RSClient targets[oldCount] = event.getTarget(); identifiers[oldCount] = event.getIdentifier(); opcodes[oldCount] = event.getOpcode(); - arguments1[oldCount] = event.getActionParam(); - arguments2[oldCount] = event.getActionParam1(); + arguments1[oldCount] = event.getParam0(); + arguments2[oldCount] = event.getParam1(); forceLeftClick[oldCount] = event.isForceLeftClick(); } } @@ -1430,12 +1430,12 @@ public abstract class RSClientMixin implements RSClient } final MenuOptionClicked menuOptionClicked = new MenuOptionClicked(); - menuOptionClicked.setActionParam(param0); + menuOptionClicked.setParam0(param0); menuOptionClicked.setMenuOption(option); menuOptionClicked.setMenuTarget(target); menuOptionClicked.setMenuAction(MenuAction.of(opcode)); menuOptionClicked.setId(id); - menuOptionClicked.setWidgetId(param1); + menuOptionClicked.setParam1(param1); menuOptionClicked.setSelectedItemIndex(client.getSelectedItemSlot()); client.getCallbacks().post(menuOptionClicked);