From a5f5fe69407aed7422d4f2b48377e469efd56f56 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Mon, 13 Jan 2020 17:59:43 -0700 Subject: [PATCH 01/15] loottracker: Optimize panel rebuild Removing components in swing can be incredibly slow under serveral circumstances. This adds a special removeAll that can take less time in some cases --- .../plugins/loottracker/LootTrackerPanel.java | 3 +- .../loottracker/LootTrackerPlugin.java | 2 +- .../net/runelite/client/util/SwingUtil.java | 56 +++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java index 22ce4561fa..37b4d8e9f9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java @@ -54,6 +54,7 @@ import net.runelite.client.ui.components.PluginErrorPanel; import net.runelite.client.util.ColorUtil; import net.runelite.client.util.ImageUtil; import net.runelite.client.util.QuantityFormatter; +import net.runelite.client.util.SwingUtil; import net.runelite.http.api.loottracker.LootTrackerClient; class LootTrackerPanel extends PluginPanel @@ -488,7 +489,7 @@ class LootTrackerPanel extends PluginPanel */ private void rebuild() { - logsContainer.removeAll(); + SwingUtil.fastRemoveAll(logsContainer); boxes.clear(); if (groupLoot) 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 adb5217a4e..0864776476 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 @@ -612,7 +612,7 @@ public class LootTrackerPlugin extends Plugin } config.setIgnoredItems(Text.toCSV(ignoredItemSet)); - panel.updateIgnoredRecords(); + // the config changed will update the panel } boolean isIgnored(String name) diff --git a/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java b/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java index f4e12c9020..5eb7cef4af 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java @@ -26,11 +26,16 @@ package net.runelite.client.util; import java.awt.AWTException; import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.EventQueue; import java.awt.Font; import java.awt.Frame; import java.awt.Image; import java.awt.Insets; +import java.awt.SecondaryLoop; import java.awt.SystemTray; +import java.awt.Toolkit; import java.awt.TrayIcon; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -50,6 +55,7 @@ import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.LookAndFeel; +import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; @@ -293,4 +299,54 @@ public class SwingUtil { button.addItemListener(l -> button.setToolTipText(button.isSelected() ? on : off)); } + + /** + * Removes all of a component's children faster than calling removeAll() on it in many cases + */ + public static void fastRemoveAll(Container c) + { + // If we are not on the EDT this will deadlock, in addition to being totally unsafe + assert SwingUtilities.isEventDispatchThread(); + + // when a component is removed it has to be resized for some reason, but only if it's valid + // so we make sure to invalidate everything before removing it + c.invalidate(); + for (int i = 0; i < c.getComponentCount(); i++) + { + Component ic = c.getComponent(i); + + // removeAll and removeNotify are both recursive, so we have to recurse before them + if (ic instanceof Container) + { + fastRemoveAll((Container) ic); + } + + // each removeNotify needs to remove anything from the event queue that is for that widget + // this however requires taking a lock, and is moderately slow, so we just execute all of + // those events with a secondary event loop + pumpPendingEvents(); + + // call removeNotify early; this is most of the work in removeAll, and generates events that + // the next secondaryLoop will pickup + ic.removeNotify(); + } + + // Actually remove anything + c.removeAll(); + } + + /** + * Run any events currently in the event queue + */ + public static void pumpPendingEvents() + { + EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); + + if (eq.peekEvent() != null) + { + SecondaryLoop l = eq.createSecondaryLoop(); + SwingUtilities.invokeLater(l::exit); + l.enter(); + } + } } From aa85eb6a6e350f1fed4267b0edda045f00080616 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Mon, 13 Jan 2020 18:35:34 -0700 Subject: [PATCH 02/15] loottracker: Handle rollover/select icons correctly --- .../plugins/loottracker/LootTrackerPanel.java | 175 ++++++------------ 1 file changed, 57 insertions(+), 118 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java index 37b4d8e9f9..5f1d4d4867 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPanel.java @@ -39,13 +39,19 @@ import java.util.List; import java.util.function.Predicate; import javax.swing.BorderFactory; import javax.swing.BoxLayout; +import javax.swing.ButtonGroup; import javax.swing.ImageIcon; +import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPopupMenu; +import javax.swing.JRadioButton; +import javax.swing.JToggleButton; import javax.swing.border.EmptyBorder; +import javax.swing.plaf.basic.BasicButtonUI; +import javax.swing.plaf.basic.BasicToggleButtonUI; import net.runelite.client.game.ItemManager; import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.FontManager; @@ -98,11 +104,11 @@ class LootTrackerPanel extends PluginPanel // Details and navigation private final JPanel actionsContainer = new JPanel(); private final JLabel detailsTitle = new JLabel(); - private final JLabel backBtn = new JLabel(); - private final JLabel viewHiddenBtn = new JLabel(); - private final JLabel singleLootBtn = new JLabel(); - private final JLabel groupedLootBtn = new JLabel(); - private final JLabel collapseBtn = new JLabel(); + private final JButton backBtn = new JButton(); + private final JToggleButton viewHiddenBtn = new JToggleButton(); + private final JRadioButton singleLootBtn = new JRadioButton(); + private final JRadioButton groupedLootBtn = new JRadioButton(); + private final JButton collapseBtn = new JButton(); // Aggregate of all kills private final List aggregateRecords = new ArrayList<>(); @@ -174,121 +180,64 @@ class LootTrackerPanel extends PluginPanel final JPanel viewControls = new JPanel(new GridLayout(1, 3, 10, 0)); viewControls.setBackground(ColorScheme.DARKER_GRAY_COLOR); + SwingUtil.removeButtonDecorations(collapseBtn); collapseBtn.setIcon(EXPAND_ICON); - collapseBtn.addMouseListener(new MouseAdapter() - { - @Override - public void mousePressed(MouseEvent e) - { - changeCollapse(); - } - }); - - singleLootBtn.setIcon(SINGLE_LOOT_VIEW); - singleLootBtn.setToolTipText("Show each kill separately"); - singleLootBtn.addMouseListener(new MouseAdapter() - { - @Override - public void mousePressed(MouseEvent mouseEvent) - { - changeGrouping(false); - } - - @Override - public void mouseExited(MouseEvent mouseEvent) - { - singleLootBtn.setIcon(groupLoot ? SINGLE_LOOT_VIEW_FADED : SINGLE_LOOT_VIEW); - } - - @Override - public void mouseEntered(MouseEvent mouseEvent) - { - singleLootBtn.setIcon(groupLoot ? SINGLE_LOOT_VIEW_HOVER : SINGLE_LOOT_VIEW); - } - }); - - groupedLootBtn.setIcon(GROUPED_LOOT_VIEW); - groupedLootBtn.setToolTipText("Group loot by source"); - groupedLootBtn.addMouseListener(new MouseAdapter() - { - @Override - public void mousePressed(MouseEvent mouseEvent) - { - changeGrouping(true); - } - - @Override - public void mouseExited(MouseEvent mouseEvent) - { - groupedLootBtn.setIcon(groupLoot ? GROUPED_LOOT_VIEW : GROUPED_LOOT_VIEW_FADED); - } - - @Override - public void mouseEntered(MouseEvent mouseEvent) - { - groupedLootBtn.setIcon(groupLoot ? GROUPED_LOOT_VIEW : GROUPED_LOOT_VIEW_HOVER); - } - }); - - viewHiddenBtn.setIcon(VISIBLE_ICON); - viewHiddenBtn.setToolTipText("Show ignored items"); - viewHiddenBtn.addMouseListener(new MouseAdapter() - { - @Override - public void mousePressed(MouseEvent mouseEvent) - { - changeItemHiding(!hideIgnoredItems); - } - - @Override - public void mouseExited(MouseEvent mouseEvent) - { - viewHiddenBtn.setIcon(hideIgnoredItems ? INVISIBLE_ICON : VISIBLE_ICON); - } - - @Override - public void mouseEntered(MouseEvent mouseEvent) - { - viewHiddenBtn.setIcon(hideIgnoredItems ? INVISIBLE_ICON_HOVER : VISIBLE_ICON_HOVER); - } - }); - + collapseBtn.setSelectedIcon(COLLAPSE_ICON); + SwingUtil.addModalTooltip(collapseBtn, "Collapse All", "Un-Collapse All"); + collapseBtn.setBackground(ColorScheme.DARKER_GRAY_COLOR); + collapseBtn.setUI(new BasicButtonUI()); // substance breaks the layout + collapseBtn.addActionListener(ev -> changeCollapse()); viewControls.add(collapseBtn); + + SwingUtil.removeButtonDecorations(singleLootBtn); + singleLootBtn.setIcon(SINGLE_LOOT_VIEW_FADED); + singleLootBtn.setRolloverIcon(SINGLE_LOOT_VIEW_HOVER); + singleLootBtn.setSelectedIcon(SINGLE_LOOT_VIEW); + singleLootBtn.setToolTipText("Show each kill separately"); + singleLootBtn.addActionListener(e -> changeGrouping(false)); + + SwingUtil.removeButtonDecorations(groupedLootBtn); + groupedLootBtn.setIcon(GROUPED_LOOT_VIEW_FADED); + groupedLootBtn.setRolloverIcon(GROUPED_LOOT_VIEW_HOVER); + groupedLootBtn.setSelectedIcon(GROUPED_LOOT_VIEW); + groupedLootBtn.setToolTipText("Group loot by source"); + groupedLootBtn.addActionListener(e -> changeGrouping(true)); + + ButtonGroup groupSingleGroup = new ButtonGroup(); + groupSingleGroup.add(singleLootBtn); + groupSingleGroup.add(groupedLootBtn); + viewControls.add(groupedLootBtn); viewControls.add(singleLootBtn); - viewControls.add(viewHiddenBtn); changeGrouping(true); + + SwingUtil.removeButtonDecorations(viewHiddenBtn); + viewHiddenBtn.setIconTextGap(0); + viewHiddenBtn.setIcon(VISIBLE_ICON); + viewHiddenBtn.setRolloverIcon(INVISIBLE_ICON_HOVER); + viewHiddenBtn.setSelectedIcon(INVISIBLE_ICON); + viewHiddenBtn.setRolloverSelectedIcon(VISIBLE_ICON_HOVER); + viewHiddenBtn.setBackground(ColorScheme.DARKER_GRAY_COLOR); + viewHiddenBtn.setUI(new BasicToggleButtonUI()); // substance breaks the layout and the pressed icon + SwingUtil.addModalTooltip(viewHiddenBtn, "Show ignored items", "Hide ignored items"); changeItemHiding(true); + viewControls.add(viewHiddenBtn); final JPanel leftTitleContainer = new JPanel(new BorderLayout(5, 0)); leftTitleContainer.setBackground(ColorScheme.DARKER_GRAY_COLOR); detailsTitle.setForeground(Color.WHITE); + SwingUtil.removeButtonDecorations(backBtn); backBtn.setIcon(BACK_ARROW_ICON); + backBtn.setRolloverIcon(BACK_ARROW_ICON_HOVER); backBtn.setVisible(false); - backBtn.addMouseListener(new MouseAdapter() + backBtn.addActionListener(ev -> { - @Override - public void mousePressed(MouseEvent mouseEvent) - { - currentView = null; - backBtn.setVisible(false); - detailsTitle.setText(""); - rebuild(); - } - - @Override - public void mouseExited(MouseEvent mouseEvent) - { - backBtn.setIcon(BACK_ARROW_ICON); - } - - @Override - public void mouseEntered(MouseEvent mouseEvent) - { - backBtn.setIcon(BACK_ARROW_ICON_HOVER); - } + currentView = null; + backBtn.setVisible(false); + detailsTitle.setText(""); + rebuild(); }); leftTitleContainer.add(backBtn, BorderLayout.WEST); @@ -368,16 +317,7 @@ class LootTrackerPanel extends PluginPanel void updateCollapseText() { - if (isAllCollapsed()) - { - collapseBtn.setToolTipText("Un-Collapse All"); - collapseBtn.setIcon(COLLAPSE_ICON); - } - else - { - collapseBtn.setToolTipText("Collapse All"); - collapseBtn.setIcon(EXPAND_ICON); - } + collapseBtn.setSelected(isAllCollapsed()); } private boolean isAllCollapsed() @@ -428,9 +368,8 @@ class LootTrackerPanel extends PluginPanel private void changeGrouping(boolean group) { groupLoot = group; + (group ? groupedLootBtn : singleLootBtn).setSelected(true); rebuild(); - groupedLootBtn.setIcon(group ? GROUPED_LOOT_VIEW : GROUPED_LOOT_VIEW_FADED); - singleLootBtn.setIcon(group ? SINGLE_LOOT_VIEW_FADED : SINGLE_LOOT_VIEW); } /** @@ -441,8 +380,8 @@ class LootTrackerPanel extends PluginPanel private void changeItemHiding(boolean hide) { hideIgnoredItems = hide; + viewHiddenBtn.setSelected(hide); rebuild(); - viewHiddenBtn.setIcon(hideIgnoredItems ? VISIBLE_ICON : INVISIBLE_ICON); } /** From 4ce575a1fdf36a689023098b3a17b7a1d66563e5 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Mon, 27 Jan 2020 22:58:12 -0800 Subject: [PATCH 03/15] HotColdLocation: Center some location spots Center some hot-cold locations as reported and verified from the mega issue. Ref: runelite/runelite#9601 --- .../clues/hotcold/HotColdLocation.java | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java index 992001e0df..f7f498ad2d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java @@ -52,18 +52,18 @@ import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea. public enum HotColdLocation { ASGARNIA_WARRIORS(new WorldPoint(2860, 3562, 0), ASGARNIA, "North of the Warriors' Guild in Burthorpe."), - ASGARNIA_JATIX(new WorldPoint(2914, 3429, 0), ASGARNIA, "East of Jatix's Herblore Shop in Taverley."), + ASGARNIA_JATIX(new WorldPoint(2915, 3425, 0), ASGARNIA, "East of Jatix's Herblore Shop in Taverley."), ASGARNIA_BARB(new WorldPoint(3036, 3439, 0), ASGARNIA, "West of Barbarian Village."), ASGARNIA_MIAZRQA(new WorldPoint(2973, 3489, 0), ASGARNIA, "North of Miazrqa's tower, outside Goblin Village."), ASGARNIA_COW(new WorldPoint(3033, 3308, 0), ASGARNIA, "In the cow pen north of Sarah's Farming Shop."), ASGARNIA_PARTY_ROOM(new WorldPoint(3026, 3363, 0), ASGARNIA, "Outside the Falador Party Room."), ASGARNIA_CRAFT_GUILD(new WorldPoint(2917, 3295, 0), ASGARNIA, "Outside the Crafting Guild cow pen."), ASGARNIA_RIMMINGTON(new WorldPoint(2978, 3241, 0), ASGARNIA, "In the centre of the Rimmington mine."), - ASGARNIA_MUDSKIPPER(new WorldPoint(2984, 3109, 0), ASGARNIA, "Mudskipper Point, on the starfish in the south-west corner."), + ASGARNIA_MUDSKIPPER(new WorldPoint(2987, 3110, 0), ASGARNIA, "Mudskipper Point, near the starfish in the south-west corner."), ASGARNIA_TROLL(new WorldPoint(2910, 3616, 0), ASGARNIA, "The Troll arena, where the player fights Dad during the Troll Stronghold quest. Bring climbing boots if travelling from Burthorpe."), DESERT_GENIE(new WorldPoint(3364, 2910, 0), DESERT, "West of Nardah genie cave."), DESERT_ALKHARID_MINE(new WorldPoint(3282, 3270, 0), DESERT, "West of Al Kharid mine."), - DESERT_MENAPHOS_GATE(new WorldPoint(3224, 2816, 0), DESERT, "North of Menaphos gate."), + DESERT_MENAPHOS_GATE(new WorldPoint(3223, 2820, 0), DESERT, "North of Menaphos gate."), DESERT_BEDABIN_CAMP(new WorldPoint(3164, 3050, 0), DESERT, "Bedabin Camp, dig around the north tent."), DESERT_UZER(new WorldPoint(3431, 3106, 0), DESERT, "West of Uzer."), DESERT_POLLNIVNEACH(new WorldPoint(3287, 2975, 0), DESERT, "West of Pollnivneach."), @@ -71,59 +71,59 @@ public enum HotColdLocation DESERT_SHANTY(new WorldPoint(3294, 3106, 0), DESERT, "South-west of Shantay Pass."), DRAYNOR_MANOR_MUSHROOMS(true, new WorldPoint(3096, 3379, 0), MISTHALIN, "Patch of mushrooms just northwest of Draynor Manor"), DRAYNOR_WHEAT_FIELD(true, new WorldPoint(3120, 3282, 0), MISTHALIN, "Inside the wheat field next to Draynor Village"), - FELDIP_HILLS_JIGGIG(new WorldPoint(2413, 3055, 0), FELDIP_HILLS, "West of Jiggig, east of the fairy ring bkp."), - FELDIP_HILLS_SW(new WorldPoint(2582, 2895, 0), FELDIP_HILLS, "West of the southeasternmost lake in Feldip Hills."), - FELDIP_HILLS_GNOME_GLITER(new WorldPoint(2553, 2972, 0), FELDIP_HILLS, "East of the gnome glider (Lemantolly Undri)."), + FELDIP_HILLS_JIGGIG(new WorldPoint(2409, 3053, 0), FELDIP_HILLS, "West of Jiggig, east of the fairy ring bkp."), + FELDIP_HILLS_SW(new WorldPoint(2586, 2897, 0), FELDIP_HILLS, "West of the southeasternmost lake in Feldip Hills."), + FELDIP_HILLS_GNOME_GLITER(new WorldPoint(2555, 2972, 0), FELDIP_HILLS, "East of the gnome glider (Lemantolly Undri)."), FELDIP_HILLS_RANTZ(new WorldPoint(2611, 2946, 0), FELDIP_HILLS, "South of Rantz, six steps west of the empty glass bottles."), FELDIP_HILLS_SOUTH(new WorldPoint(2487, 3005, 0), FELDIP_HILLS, "South of Jiggig."), FELDIP_HILLS_RED_CHIN(new WorldPoint(2532, 2900, 0), FELDIP_HILLS, "Outside the red chinchompa hunting ground entrance, south of the Hunting expert's hut."), FELDIP_HILLS_SE(new WorldPoint(2567, 2916, 0), FELDIP_HILLS, "South-east of the ∩-shaped lake, near the icon."), FELDIP_HILLS_CW_BALLOON(new WorldPoint(2452, 3108, 0), FELDIP_HILLS, "Directly west of the Castle Wars balloon."), - FREMENNIK_PROVINCE_MTN_CAMP(new WorldPoint(2804, 3672, 0), FREMENNIK_PROVINCE, "At the Mountain Camp."), + FREMENNIK_PROVINCE_MTN_CAMP(new WorldPoint(2800, 3669, 0), FREMENNIK_PROVINCE, "At the Mountain Camp."), FREMENNIK_PROVINCE_RELLEKKA_HUNTER(new WorldPoint(2724, 3783, 0), FREMENNIK_PROVINCE, "At the Rellekka Hunter area, near the icon."), FREMENNIK_PROVINCE_KELGADRIM_ENTRANCE(new WorldPoint(2715, 3689, 0), FREMENNIK_PROVINCE, "West of the Keldagrim entrance mine."), FREMENNIK_PROVINCE_SW(new WorldPoint(2605, 3648, 0), FREMENNIK_PROVINCE, "Outside the fence in the south-western corner of Rellekka."), - FREMENNIK_PROVINCE_LIGHTHOUSE(new WorldPoint(2589, 3598, 0), FREMENNIK_PROVINCE, "South-east of the Lighthouse."), - FREMENNIK_PROVINCE_ETCETERIA_CASTLE(new WorldPoint(2614, 3867, 0), FREMENNIK_PROVINCE, "Inside Etceteria's castle, in the southern staircase."), - FREMENNIK_PROVINCE_MISC_COURTYARD(new WorldPoint(2529, 3867, 0), FREMENNIK_PROVINCE, "Outside Miscellania's courtyard."), - FREMENNIK_PROVINCE_FREMMY_ISLES_MINE(new WorldPoint(2378, 3849, 0), FREMENNIK_PROVINCE, "Central Fremennik Isles mine."), + FREMENNIK_PROVINCE_LIGHTHOUSE(new WorldPoint(2585, 3601, 0), FREMENNIK_PROVINCE, "South-east of the Lighthouse."), + FREMENNIK_PROVINCE_ETCETERIA_CASTLE(new WorldPoint(2617, 3862, 0), FREMENNIK_PROVINCE, "South-east of Etceteria's castle."), + FREMENNIK_PROVINCE_MISC_COURTYARD(new WorldPoint(2527, 3868, 0), FREMENNIK_PROVINCE, "Outside Miscellania's courtyard."), + FREMENNIK_PROVINCE_FREMMY_ISLES_MINE(new WorldPoint(2374, 3850, 0), FREMENNIK_PROVINCE, "Central Fremennik Isles mine."), FREMENNIK_PROVINCE_WEST_ISLES_MINE(new WorldPoint(2313, 3854, 0), FREMENNIK_PROVINCE, "West Fremennik Isles mine."), FREMENNIK_PROVINCE_WEST_JATIZSO_ENTRANCE(new WorldPoint(2391, 3813, 0), FREMENNIK_PROVINCE, "West of the Jatizso mine entrance."), FREMENNIK_PROVINCE_PIRATES_COVE(new WorldPoint(2210, 3814, 0), FREMENNIK_PROVINCE, "Pirates' Cove"), FREMENNIK_PROVINCE_ASTRAL_ALTER(new WorldPoint(2147, 3862, 0), FREMENNIK_PROVINCE, "Astral altar"), - FREMENNIK_PROVINCE_LUNAR_VILLAGE(new WorldPoint(2087, 3915, 0), FREMENNIK_PROVINCE, "Lunar Isle, inside the village."), + FREMENNIK_PROVINCE_LUNAR_VILLAGE(new WorldPoint(2084, 3916, 0), FREMENNIK_PROVINCE, "Lunar Isle, inside the village."), FREMENNIK_PROVINCE_LUNAR_NORTH(new WorldPoint(2106, 3949, 0), FREMENNIK_PROVINCE, "Lunar Isle, north of the village."), ICE_MOUNTAIN(true, new WorldPoint(3007, 3475, 0), MISTHALIN, "Atop Ice Mountain"), - KANDARIN_SINCLAR_MANSION(new WorldPoint(2726, 3588, 0), KANDARIN, "North-west of the Sinclair Mansion, near the log balance shortcut."), + KANDARIN_SINCLAR_MANSION(new WorldPoint(2730, 3588, 0), KANDARIN, "North-west of the Sinclair Mansion, near the log balance shortcut."), KANDARIN_CATHERBY(new WorldPoint(2774, 3433, 0), KANDARIN, "Catherby, between the bank and the beehives, near small rock formation."), - KANDARIN_GRAND_TREE(new WorldPoint(2444, 3503, 0), KANDARIN, "Grand Tree, just east of the terrorchick gnome enclosure."), + KANDARIN_GRAND_TREE(new WorldPoint(2448, 3503, 0), KANDARIN, "Grand Tree, just east of the terrorchick gnome enclosure."), KANDARIN_SEERS(new WorldPoint(2735, 3486, 0), KANDARIN, "Between the Seers' Village bank and Camelot."), KANDARIN_MCGRUBORS_WOOD(new WorldPoint(2653, 3485, 0), KANDARIN, "McGrubor's Wood"), KANDARIN_FISHING_BUILD(new WorldPoint(2586, 3372, 0), KANDARIN, "South of Fishing Guild"), KANDARIN_WITCHHAVEN(new WorldPoint(2708, 3304, 0), KANDARIN, "Outside Witchaven, west of Jeb, Holgart, and Caroline."), - KANDARIN_NECRO_TOWER(new WorldPoint(2669, 3242, 0), KANDARIN, "Ground floor inside the Necromancer Tower. Easily accessed by using fairy ring code djp."), - KANDARIN_FIGHT_ARENA(new WorldPoint(2587, 3134, 0), KANDARIN, "South of the Fight Arena, north-west of the Nightmare Zone."), + KANDARIN_NECRO_TOWER(new WorldPoint(2667, 3241, 0), KANDARIN, "Ground floor inside the Necromancer Tower. Easily accessed by using fairy ring code djp."), + KANDARIN_FIGHT_ARENA(new WorldPoint(2587, 3135, 0), KANDARIN, "South of the Fight Arena, north-west of the Nightmare Zone."), KANDARIN_TREE_GNOME_VILLAGE(new WorldPoint(2526, 3160, 0), KANDARIN, "Tree Gnome Village, near the general store icon."), KANDARIN_GRAVE_OF_SCORPIUS(new WorldPoint(2464, 3228, 0), KANDARIN, "Grave of Scorpius"), KANDARIN_KHAZARD_BATTLEFIELD(new WorldPoint(2518, 3249, 0), KANDARIN, "Khazard Battlefield, in the small ruins south of tracker gnome 2."), - KANDARIN_WEST_ARDY(new WorldPoint(2533, 3320, 0), KANDARIN, "West Ardougne, near the staircase outside the Civic Office."), + KANDARIN_WEST_ARDY(new WorldPoint(2535, 3322, 0), KANDARIN, "West Ardougne, near the staircase outside the Civic Office."), KANDARIN_SW_TREE_GNOME_STRONGHOLD(new WorldPoint(2411, 3431, 0), KANDARIN, "South-west Tree Gnome Stronghold"), KANDARIN_OUTPOST(new WorldPoint(2457, 3362, 0), KANDARIN, "South of the Tree Gnome Stronghold, north-east of the Outpost."), KANDARIN_BAXTORIAN_FALLS(new WorldPoint(2534, 3479, 0), KANDARIN, "South-east of Almera's house on Baxtorian Falls."), - KANDARIN_BA_AGILITY_COURSE(new WorldPoint(2536, 3546, 0), KANDARIN, "Inside the Barbarian Agility Course. Completion of Alfred Grimhand's Barcrawl is required."), + KANDARIN_BA_AGILITY_COURSE(new WorldPoint(2540, 3548, 0), KANDARIN, "Inside the Barbarian Agility Course. Completion of Alfred Grimhand's Barcrawl is required."), KARAMJA_MUSA_POINT(new WorldPoint(2914, 3168, 0), KARAMJA, "Musa Point, banana plantation."), - KARAMJA_BRIMHAVEN_FRUIT_TREE(new WorldPoint(2783, 3214, 0), KARAMJA, "Brimhaven, east of the fruit tree patch."), + KARAMJA_BRIMHAVEN_FRUIT_TREE(new WorldPoint(2782, 3215, 0), KARAMJA, "Brimhaven, east of the fruit tree patch."), KARAMJA_WEST_BRIMHAVEN(new WorldPoint(2721, 3169, 0), KARAMJA, "West of Brimhaven."), KARAMJA_GLIDER(new WorldPoint(2966, 2975, 0), KARAMJA, "West of the gnome glider."), KARAMJA_KHARAZI_NE(new WorldPoint(2904, 2925, 0), KARAMJA, "North-eastern part of Kharazi Jungle."), KARAMJA_KHARAZI_SW(new WorldPoint(2783, 2898, 0), KARAMJA, "South-western part of Kharazi Jungle."), - KARAMJA_CRASH_ISLAND(new WorldPoint(2910, 2737, 0), KARAMJA, "Northern part of Crash Island."), + KARAMJA_CRASH_ISLAND(new WorldPoint(2909, 2737, 0), KARAMJA, "Northern part of Crash Island."), LUMBRIDGE_COW_FIELD(true, new WorldPoint(3174, 3336, 0), MISTHALIN, "Cow field north of Lumbridge"), MISTHALIN_VARROCK_STONE_CIRCLE(new WorldPoint(3225, 3355, 0), MISTHALIN, "South of the stone circle near Varrock's entrance."), MISTHALIN_LUMBRIDGE(new WorldPoint(3238, 3169, 0), MISTHALIN, "Just north-west of the Lumbridge Fishing tutor."), MISTHALIN_LUMBRIDGE_2(new WorldPoint(3170, 3278, 0), MISTHALIN, "North of the pond between Lumbridge and Draynor Village."), MISTHALIN_GERTUDES(new WorldPoint(3158, 3421, 0), MISTHALIN, "North-east of Gertrude's house west of Varrock."), - MISTHALIN_DRAYNOR_BANK(new WorldPoint(3096, 3235, 0), MISTHALIN, "South of Draynor Village bank."), + MISTHALIN_DRAYNOR_BANK(new WorldPoint(3098, 3234, 0), MISTHALIN, "South of Draynor Village bank."), MISTHALIN_LUMBER_YARD(new WorldPoint(3303, 3483, 0), MISTHALIN, "South of Lumber Yard, east of Assistant Serf."), MORYTANIA_BURGH_DE_ROTT(new WorldPoint(3545, 3253, 0), MORYTANIA, "In the north-east area of Burgh de Rott, by the reverse-L-shaped ruins."), MORYTANIA_PORT_PHASMATYS(new WorldPoint(3613, 3485, 0), MORYTANIA, "West of Port Phasmatys, south-east of fairy ring."), @@ -133,22 +133,22 @@ public enum HotColdLocation MORYTANIA_MAUSOLEUM(new WorldPoint(3499, 3539, 0), MORYTANIA, "South of the Mausoleum."), MORYTANIA_MOS_LES_HARMLESS(new WorldPoint(3744, 3041, 0), MORYTANIA, "Northern area of Mos Le'Harmless, between the lakes."), MORYTANIA_MOS_LES_HARMLESS_BAR(new WorldPoint(3670, 2974, 0), MORYTANIA, "Near Mos Le'Harmless southern bar."), - MORYTANIA_DRAGONTOOTH_NORTH(new WorldPoint(3813, 3567, 0), MORYTANIA, "Northern part of Dragontooth Island."), + MORYTANIA_DRAGONTOOTH_NORTH(new WorldPoint(3811, 3569, 0), MORYTANIA, "Northern part of Dragontooth Island."), MORYTANIA_DRAGONTOOTH_SOUTH(new WorldPoint(3803, 3532, 0), MORYTANIA, "Southern part of Dragontooth Island."), NORTHEAST_OF_AL_KHARID_MINE(true, new WorldPoint(3332, 3313, 0), MISTHALIN, "Northeast of Al Kharid Mine"), - WESTERN_PROVINCE_EAGLES_PEAK(new WorldPoint(2297, 3530, 0), WESTERN_PROVINCE, "North-west of Eagles' Peak."), - WESTERN_PROVINCE_PISCATORIS(new WorldPoint(2337, 3689, 0), WESTERN_PROVINCE, "Piscatoris Fishing Colony"), + WESTERN_PROVINCE_EAGLES_PEAK(new WorldPoint(2297, 3529, 0), WESTERN_PROVINCE, "North-west of Eagles' Peak."), + WESTERN_PROVINCE_PISCATORIS(new WorldPoint(2334, 3685, 0), WESTERN_PROVINCE, "Piscatoris Fishing Colony"), WESTERN_PROVINCE_PISCATORIS_HUNTER_AREA(new WorldPoint(2359, 3564, 0), WESTERN_PROVINCE, "Eastern part of Piscatoris Hunter area, south-west of the Falconry."), - WESTERN_PROVINCE_ARANDAR(new WorldPoint(2366, 3318, 0), WESTERN_PROVINCE, "South-west of the crystal gate to Arandar."), + WESTERN_PROVINCE_ARANDAR(new WorldPoint(2370, 3319, 0), WESTERN_PROVINCE, "South-west of the crystal gate to Arandar."), WESTERN_PROVINCE_ELF_CAMP_EAST(new WorldPoint(2270, 3244, 0), WESTERN_PROVINCE, "East of Iorwerth Camp."), WESTERN_PROVINCE_ELF_CAMP_NW(new WorldPoint(2174, 3280, 0), WESTERN_PROVINCE, "North-west of Iorwerth Camp."), - WESTERN_PROVINCE_LLETYA(new WorldPoint(2335, 3166, 0), WESTERN_PROVINCE, "In Lletya."), + WESTERN_PROVINCE_LLETYA(new WorldPoint(2337, 3166, 0), WESTERN_PROVINCE, "In Lletya."), WESTERN_PROVINCE_TYRAS(new WorldPoint(2204, 3157, 0), WESTERN_PROVINCE, "Near Tyras Camp."), WESTERN_PROVINCE_ZULANDRA(new WorldPoint(2196, 3057, 0), WESTERN_PROVINCE, "The northern house at Zul-Andra."), WILDERNESS_5(new WorldPoint(3173, 3556, 0), WILDERNESS, "North of the Grand Exchange, level 5 Wilderness."), WILDERNESS_12(new WorldPoint(3038, 3612, 0), WILDERNESS, "South-east of the Dark Warriors' Fortress, level 12 Wilderness."), WILDERNESS_20(new WorldPoint(3225, 3676, 0), WILDERNESS, "East of the Corporeal Beast's lair, level 20 Wilderness."), - WILDERNESS_27(new WorldPoint(3174, 3735, 0), WILDERNESS, "Inside the Ruins north of the Graveyard of Shadows, level 27 Wilderness."), + WILDERNESS_27(new WorldPoint(3174, 3736, 0), WILDERNESS, "Inside the Ruins north of the Graveyard of Shadows, level 27 Wilderness."), WILDERNESS_28(new WorldPoint(3374, 3734, 0), WILDERNESS, "East of Venenatis' nest, level 28 Wilderness."), WILDERNESS_32(new WorldPoint(3311, 3773, 0), WILDERNESS, "North of Venenatis' nest, level 32 Wilderness."), WILDERNESS_35(new WorldPoint(3153, 3795, 0), WILDERNESS, "East of the Wilderness canoe exit, level 35 Wilderness."), @@ -160,18 +160,18 @@ public enum HotColdLocation ZEAH_BLASTMINE_NORTH(new WorldPoint(1488, 3881, 0), ZEAH, "Northern part of the Lovakengj blast mine."), ZEAH_LOVAKITE_FURNACE(new WorldPoint(1507, 3819, 0), ZEAH, "Next to the lovakite furnace in Lovakengj."), ZEAH_LOVAKENGJ_MINE(new WorldPoint(1477, 3779, 0), ZEAH, "Next to mithril rock in the Lovakengj mine."), - ZEAH_SULPHR_MINE(new WorldPoint(1428, 3866, 0), ZEAH, "Western entrance in the Lovakengj sulphur mine."), + ZEAH_SULPHR_MINE(new WorldPoint(1428, 3869, 0), ZEAH, "Western entrance in the Lovakengj sulphur mine."), ZEAH_SHAYZIEN_BANK(new WorldPoint(1517, 3603, 0), ZEAH, "South-east of the bank in Shayzien."), ZEAH_OVERPASS(new WorldPoint(1467, 3714, 0), ZEAH, "Overpass between Lovakengj and Shayzien."), - ZEAH_LIZARDMAN(new WorldPoint(1493, 3694, 0), ZEAH, "Within Lizardman Canyon, east of the ladder. Requires 5% favour with Shayzien."), - ZEAH_COMBAT_RING(new WorldPoint(1557, 3580, 0), ZEAH, "Shayzien, south-east of the Combat Ring."), + ZEAH_LIZARDMAN(new WorldPoint(1490, 3698, 0), ZEAH, "Within Lizardman Canyon, east of the ladder. Requires 5% favour with Shayzien."), + ZEAH_COMBAT_RING(new WorldPoint(1559, 3582, 0), ZEAH, "Shayzien, south-east of the Combat Ring."), ZEAH_SHAYZIEN_BANK_2(new WorldPoint(1494, 3622, 0), ZEAH, "North-west of the bank in Shayzien."), - ZEAH_LIBRARY(new WorldPoint(1601, 3842, 0), ZEAH, "North-west of the Arceuus Library."), + ZEAH_LIBRARY(new WorldPoint(1603, 3843, 0), ZEAH, "North-west of the Arceuus Library."), ZEAH_HOUSECHURCH(new WorldPoint(1682, 3792, 0), ZEAH, "By the entrance to the Arceuus church."), ZEAH_DARK_ALTAR(new WorldPoint(1699, 3879, 0), ZEAH, "West of the Dark Altar."), - ZEAH_ARCEUUS_HOUSE(new WorldPoint(1708, 3701, 0), ZEAH, "By the southern entrance to Arceuus."), + ZEAH_ARCEUUS_HOUSE(new WorldPoint(1710, 3700, 0), ZEAH, "By the southern entrance to Arceuus."), ZEAH_ESSENCE_MINE(new WorldPoint(1762, 3852, 0), ZEAH, "By the Arceuus essence mine."), - ZEAH_ESSENCE_MINE_NE(new WorldPoint(1772, 3866, 0), ZEAH, "North-east of the Arceuus essence mine."), + ZEAH_ESSENCE_MINE_NE(new WorldPoint(1773, 3867, 0), ZEAH, "North-east of the Arceuus essence mine."), ZEAH_PISCARILUS_MINE(new WorldPoint(1768, 3705, 0), ZEAH, "South of the Piscarilius mine."), ZEAH_GOLDEN_FIELD_TAVERN(new WorldPoint(1718, 3647, 0), ZEAH, "South of The Golden Field tavern in the northern area of Hosidius."), ZEAH_MESS_HALL(new WorldPoint(1658, 3621, 0), ZEAH, "East of the Mess hall."), From a663770563f89b91ce87dc0047d09b24d1f5bddd Mon Sep 17 00:00:00 2001 From: Ron Young Date: Mon, 7 Oct 2019 10:18:57 -0500 Subject: [PATCH 04/15] scripts: add LayoutResizableStones script --- .../main/scripts/LayoutResizableStones.hash | 1 + .../main/scripts/LayoutResizableStones.rs2asm | 242 ++++++++++++++++++ 2 files changed, 243 insertions(+) create mode 100644 runelite-client/src/main/scripts/LayoutResizableStones.hash create mode 100644 runelite-client/src/main/scripts/LayoutResizableStones.rs2asm diff --git a/runelite-client/src/main/scripts/LayoutResizableStones.hash b/runelite-client/src/main/scripts/LayoutResizableStones.hash new file mode 100644 index 0000000000..1fa97dfff0 --- /dev/null +++ b/runelite-client/src/main/scripts/LayoutResizableStones.hash @@ -0,0 +1 @@ +A358C6B0EC9AF746487EA8A20507B8C03073A5C2DE16EA2FC94751957A49DA09 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm new file mode 100644 index 0000000000..ee29b9eb36 --- /dev/null +++ b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm @@ -0,0 +1,242 @@ +.id 920 +.int_stack_count 2 +.string_stack_count 0 +.int_var_count 5 +.string_var_count 0 + iconst 0 + istore 2 + iconst 0 + istore 3 + iconst -1 + istore 4 + iload 1 + switch + 1745: LABEL129 + 1129: LABEL109 + 1130: LABEL87 + 1131: LABEL9 + jump LABEL201 +LABEL9: + iconst 10747937 + if_getwidth + iconst 33 + sub + iconst 10747937 + if_getheight + istore 3 + istore 2 + iload 0 + if_getwidth + iconst 73 + iconst 73 + iload 1 + iconst 10551326 + enum + if_getwidth + sub + iconst 429 + if_icmplt LABEL29 + jump LABEL49 +LABEL29: + iconst 0 + iload 3 + iconst 10747952 + if_getheight + add + iconst 2 + iconst 2 + iconst 73 + iconst 73 + iload 1 + iconst 10747969 + enum + if_setposition + iconst 0 + iload 3 + iconst 2 + iconst 2 + iconst 10747952 + if_setposition + jump LABEL65 +LABEL49: + iconst 0 + iload 3 + iconst 2 + iconst 2 + iconst 73 + iconst 73 + iload 1 + iconst 10747969 + enum + if_setposition + iload 2 + iconst 0 + iconst 2 + iconst 2 + iconst 10747952 + if_setposition +LABEL65: + get_varbit 4084 + iconst 1 + if_icmpeq LABEL69 + jump LABEL77 +LABEL69: + iconst 1178 + iconst 73 + iconst 73 + iload 1 + iconst 10551322 + enum + 2122 + jump LABEL84 +LABEL77: + iconst 2154 + iconst 73 + iconst 73 + iload 1 + iconst 10551322 + enum + 2122 +LABEL84: + clientclock + set_varc_int 384 + jump LABEL201 +LABEL87: + get_varbit 4084 + iconst 1 + if_icmpeq LABEL91 + jump LABEL99 +LABEL91: + iconst 1178 + iconst 73 + iconst 73 + iload 1 + iconst 10551322 + enum + 2122 + jump LABEL106 +LABEL99: + iconst 2154 + iconst 73 + iconst 73 + iload 1 + iconst 10551322 + enum + 2122 +LABEL106: + clientclock + set_varc_int 384 + jump LABEL201 +LABEL109: + invoke 3297 + iconst 1 + if_icmpeq LABEL113 + jump LABEL121 +LABEL113: + iconst 2422 + iconst 73 + iconst 73 + iload 1 + iconst 10551322 + enum + 2122 + jump LABEL128 +LABEL121: + iconst 1200 + iconst 73 + iconst 73 + iload 1 + iconst 10551322 + enum + 2122 +LABEL128: + jump LABEL201 +LABEL129: + get_varbit 6257 + iconst 1 + if_icmpeq LABEL133 + jump LABEL137 +LABEL133: + iconst 1 + iconst 39387167 + if_sethide + jump LABEL192 +LABEL137: + iconst 0 + iconst 39387167 + if_sethide + iconst 1 + iconst 39387167 + 2308 + get_varbit 6255 + switch + 1: LABEL154 + 2: LABEL146 + 3: LABEL162 + jump LABEL170 +LABEL146: + iconst 1718 + iconst 39387169 + if_setgraphic + iconst 1 + sconst "Toggle single-tap mode" + iconst 39387167 + if_setop + jump LABEL177 +LABEL154: + iconst 1717 + iconst 39387169 + if_setgraphic + iconst 1 + sconst "Toggle tap-to-drop mode" + iconst 39387167 + if_setop + jump LABEL177 +LABEL162: + iconst 1716 + iconst 39387169 + if_setgraphic + iconst 1 + sconst "Show Keyboard" + iconst 39387167 + if_setop + jump LABEL177 +LABEL170: + iconst 1715 + iconst 39387169 + if_setgraphic + iconst 1 + sconst "" + iconst 39387167 + if_setop +LABEL177: + get_varbit 6255 + iconst 3 + if_icmpne LABEL181 + jump LABEL189 +LABEL181: + get_varbit 6256 + iconst 0 + if_icmpeq LABEL185 + jump LABEL189 +LABEL185: + iconst 155 + iconst 39387169 + if_settrans + jump LABEL192 +LABEL189: + iconst 0 + iconst 39387169 + if_settrans +LABEL192: + invoke 2581 + get_varbit 6254 + invoke 633 + iconst 39387158 + if_sethide + invoke 2526 + pop_int + clientclock + set_varc_int 384 +LABEL201: + return From 73d37c061b641a4c606f47af0291975bacd521b1 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sun, 2 Feb 2020 15:46:50 -0800 Subject: [PATCH 05/15] HotColdSolver: Add same-temperature solution narrowing The hot-cold solver previously was unable to perform narrowing if given a temperature change of "SAME", leading to less-than-optimal results when a number of otherwise-possible solutions could be removed from the possible results by inferring that since they would have yielded a "COLDER" or "WARMER" temperature change. This commit removes possible solutions which are absolutely closer or farther from the previous tested location. One pre-exisitng test needed to be updated to pass with this change, as it expected results to be narrowed more slowly than they now are. In addition, a minimal test case with only two starting locations has been added to demonstrate this change is working correctly. --- .../clues/hotcold/HotColdSolver.java | 6 +++-- .../clues/hotcold/HotColdSolverTest.java | 27 ++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolver.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolver.java index 052fef03ea..daa57e2bf7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolver.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolver.java @@ -102,8 +102,10 @@ public class HotColdSolver possibleLocations.removeIf(entry -> isFirstPointCloserRect(lastWorldPoint, worldPoint, entry.getRect())); break; case SAME: - // I couldn't figure out a clean implementation for this case - // not necessary for quickly determining final location + // eliminate spots which are absolutely colder or warmer (as they would not yield a SAME temperature change) + possibleLocations.removeIf(entry -> + isFirstPointCloserRect(worldPoint, lastWorldPoint, entry.getRect()) + || isFirstPointCloserRect(lastWorldPoint, worldPoint, entry.getRect())); } } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolverTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolverTest.java index a5c4cc4e31..37f87189dd 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolverTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdSolverTest.java @@ -46,6 +46,8 @@ public class HotColdSolverTest private static final String RESPONSE_TEXT_COLD_COLDER = "The device is cold, but colder than last time."; private static final String RESPONSE_TEXT_COLD_WARMER = "The device is cold, and warmer than last time."; private static final String RESPONSE_TEXT_COLD_SAME_TEMP = "The device is cold, and the same temperature as last time."; + private static final String RESPONSE_TEXT_WARM = "The device is warm."; + private static final String RESPONSE_TEXT_WARM_SAME_TEMP = "The device is warm, and the same temperature as last time."; private static final String RESPONSE_TEXT_VERY_HOT = "The device is very hot."; private static final String RESPONSE_TEXT_VERY_HOT_COLDER = "The device is very hot, but colder than last time."; private static final String RESPONSE_TEXT_VERY_HOT_WARMER = "The device is very hot, and warmer than last time."; @@ -111,18 +113,18 @@ public class HotColdSolverTest HotColdLocation.KARAMJA_KHARAZI_NE, HotColdLocation.KARAMJA_CRASH_ISLAND); final Set secondLocationsSet = firstLocationsSet.stream() - .filter(location -> location != HotColdLocation.FELDIP_HILLS_RED_CHIN) + .filter(location -> location != HotColdLocation.FELDIP_HILLS_GNOME_GLITER) .collect(Collectors.toSet()); final Set thirdLocationSet = secondLocationsSet.stream() - .filter(location -> location != HotColdLocation.FELDIP_HILLS_GNOME_GLITER) + .filter(location -> location != HotColdLocation.FELDIP_HILLS_RED_CHIN) .collect(Collectors.toSet()); final Set finalLocation = thirdLocationSet.stream() .filter(location -> location != HotColdLocation.KARAMJA_CRASH_ISLAND) .collect(Collectors.toSet()); testSolver(solver, new WorldPoint(2711, 2803, 0), RESPONSE_TEXT_COLD, firstLocationsSet); - testSolver(solver, new WorldPoint(2711, 2802, 0), RESPONSE_TEXT_COLD_SAME_TEMP, firstLocationsSet); - testSolver(solver, new WorldPoint(2716, 2802, 0), RESPONSE_TEXT_COLD_WARMER, secondLocationsSet); + testSolver(solver, new WorldPoint(2711, 2802, 0), RESPONSE_TEXT_COLD_SAME_TEMP, secondLocationsSet); + testSolver(solver, new WorldPoint(2716, 2802, 0), RESPONSE_TEXT_COLD_WARMER, thirdLocationSet); testSolver(solver, new WorldPoint(2739, 2808, 0), RESPONSE_TEXT_COLD_WARMER, thirdLocationSet); testSolver(solver, new WorldPoint(2810, 2757, 0), RESPONSE_TEXT_COLD_COLDER, finalLocation); } @@ -162,6 +164,23 @@ public class HotColdSolverTest HotColdLocation.DESERT_BEDABIN_CAMP)); } + @Test + public void testZeahLocationNarrowing() + { + // Start with western Lovakengj sulphur mine and west of farming guild locations remaining + HotColdSolver solver = new HotColdSolver(EnumSet.of( + HotColdLocation.ZEAH_SULPHR_MINE, + HotColdLocation.ZEAH_FARMING_GUILD_W + )); + + testSolver(solver, new WorldPoint(1348, 3740, 0), RESPONSE_TEXT_WARM, + Sets.immutableEnumSet( + HotColdLocation.ZEAH_SULPHR_MINE, + HotColdLocation.ZEAH_FARMING_GUILD_W)); + testSolver(solver, new WorldPoint(1347, 3740, 0), RESPONSE_TEXT_WARM_SAME_TEMP, + Sets.immutableEnumSet(HotColdLocation.ZEAH_SULPHR_MINE)); + } + @Test public void testIsFirstPointCloserRect() { From 88c2736e8b2acc740f48e5a1f6f77edfc613df59 Mon Sep 17 00:00:00 2001 From: Ron Young Date: Mon, 7 Oct 2019 10:19:49 -0500 Subject: [PATCH 06/15] interfacestyles: add ability to always stack resizable stones --- .../interfacestyles/InterfaceStylesConfig.java | 10 ++++++++++ .../interfacestyles/InterfaceStylesPlugin.java | 12 ++++++++++++ .../src/main/scripts/LayoutResizableStones.rs2asm | 9 ++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesConfig.java index 3f64778e52..0d372602c4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesConfig.java @@ -72,4 +72,14 @@ public interface InterfaceStylesConfig extends Config { return false; } + + @ConfigItem( + keyName = "alwaysStack", + name = "Always stack bottom bar", + description = "Always stack the bottom bar in resizable" + ) + default boolean alwaysStack() + { + return false; + } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesPlugin.java index 9e3ed2e6b0..a7570dc9d1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/interfacestyles/InterfaceStylesPlugin.java @@ -40,6 +40,7 @@ import net.runelite.api.events.ClientTick; import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.PostHealthBar; +import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.callback.ClientThread; @@ -106,6 +107,17 @@ public class InterfaceStylesPlugin extends Plugin } } + @Subscribe + public void onScriptCallbackEvent(ScriptCallbackEvent event) + { + if ("forceStackStones".equals(event.getEventName()) && config.alwaysStack()) + { + int[] intStack = client.getIntStack(); + int intStackSize = client.getIntStackSize(); + intStack[intStackSize - 1] = 1; + } + } + @Subscribe public void onClientTick(ClientTick event) { diff --git a/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm index ee29b9eb36..c3bec33bb8 100644 --- a/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm +++ b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm @@ -3,6 +3,9 @@ .string_stack_count 0 .int_var_count 5 .string_var_count 0 +; callback "forceStackStones" +; Used by the InterfaceStylesPlugin to enable it's Always stack bottom bar option +; Toggle the option when you have the bottom line top level interface on and your screen is large enough for the stones to be in a single line iconst 0 istore 2 iconst 0 @@ -36,7 +39,11 @@ LABEL9: sub iconst 429 if_icmplt LABEL29 - jump LABEL49 + iconst 0 ; should resizable stones be forced to stack + sconst "forceStackStones" ; push event name + runelite_callback ; invoke callback + iconst 0 ; if 0 is returned, continue normal layout + if_icmpeq LABEL49 LABEL29: iconst 0 iload 3 From eed403988c240688f8cc00d86e6205f45c49c142 Mon Sep 17 00:00:00 2001 From: Paveldin <40346808+Paveldin@users.noreply.github.com> Date: Fri, 7 Feb 2020 09:27:41 -0500 Subject: [PATCH 07/15] skill calc: add Spice Rack --- .../client/plugins/skillcalculator/skill_construction.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_construction.json b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_construction.json index 6d615d5d4d..3d38ce9e0e 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_construction.json +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_construction.json @@ -786,6 +786,12 @@ "name": "Posh Bell-Pull", "xp": 420 }, + { + "level": 60, + "icon": 24479, + "name": "Spice Rack", + "xp": 374 + }, { "level": 60, "icon": 8178, From 77694d65bccf7a2333a7fbdfc911ba61f9d8ae33 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 7 Feb 2020 10:36:28 -0500 Subject: [PATCH 08/15] api: add both normal and dragging bounds to widgetitem --- .../net/runelite/api/widgets/WidgetItem.java | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetItem.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetItem.java index 1d868e62b6..ccf89812b5 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetItem.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetItem.java @@ -25,6 +25,7 @@ package net.runelite.api.widgets; import java.awt.Rectangle; +import javax.annotation.Nullable; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.ToString; @@ -64,19 +65,40 @@ public class WidgetItem */ private final Widget widget; /** - * Whether or not this widget item is being dragged. + * The canvas bounds for the widget, if it is being dragged. */ - private final boolean dragging; + @Nullable + private final Rectangle draggingCanvasBounds; + + /** + * Get the area where the widget item is drawn on the canvas, accounting for drag + * @return + */ + public Rectangle getCanvasBounds() + { + return draggingCanvasBounds == null ? canvasBounds : draggingCanvasBounds; + } + + /** + * Get the area where the widget item is drawn on the canvas + * @param dragging whether the returned area should account for widget drag + * @return + */ + public Rectangle getCanvasBounds(boolean dragging) + { + return dragging ? draggingCanvasBounds : canvasBounds; + } /** * Gets the upper-left coordinate of where the widget is being drawn - * on the canvas. + * on the canvas, accounting for drag. * * @return the upper-left coordinate of where this widget is drawn */ public Point getCanvasLocation() { - return new Point((int) canvasBounds.getX(), (int) canvasBounds.getY()); + Rectangle bounds = getCanvasBounds(); + return new Point((int) bounds.getX(), (int) bounds.getY()); } } From cda92a18dc74af087a7e66b916a5a4d512a0911d Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 7 Feb 2020 10:37:18 -0500 Subject: [PATCH 09/15] inventory grid: don't drag grid square when dragging items --- .../client/plugins/inventorygrid/InventoryGridOverlay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java index 9eaced470d..ae3744fd6d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorygrid/InventoryGridOverlay.java @@ -103,7 +103,7 @@ class InventoryGridOverlay extends Overlay { WidgetItem targetWidgetItem = inventoryWidget.getWidgetItem(i); - final Rectangle bounds = targetWidgetItem.getCanvasBounds(); + final Rectangle bounds = targetWidgetItem.getCanvasBounds(false); boolean inBounds = bounds.contains(mousePoint); if (config.showItem() && inBounds) From aa21ad067525a1b66e4e6eebe804313745644d11 Mon Sep 17 00:00:00 2001 From: JBerben Date: Sun, 24 Nov 2019 22:41:10 +1300 Subject: [PATCH 10/15] antidrag: support bank interface --- .../plugins/antidrag/AntiDragPlugin.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 26f926be4a..196f2846e3 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,6 +29,8 @@ import java.awt.event.KeyEvent; import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.api.events.FocusChanged; +import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.input.KeyListener; @@ -84,7 +86,9 @@ public class AntiDragPlugin extends Plugin implements KeyListener { if (e.getKeyCode() == KeyEvent.VK_SHIFT) { - client.setInventoryDragDelay(config.dragDelay()); + final int delay = config.dragDelay(); + client.setInventoryDragDelay(delay); + setBankDragDelay(delay); } } @@ -94,6 +98,8 @@ public class AntiDragPlugin extends Plugin implements KeyListener if (e.getKeyCode() == KeyEvent.VK_SHIFT) { client.setInventoryDragDelay(DEFAULT_DELAY); + // In this case, 0 is the default for bank item widgets. + setBankDragDelay(0); } } @@ -103,6 +109,21 @@ public class AntiDragPlugin extends Plugin implements KeyListener if (!focusChanged.isFocused()) { client.setInventoryDragDelay(DEFAULT_DELAY); + setBankDragDelay(0); } } + + private void setBankDragDelay(int delay) + { + final Widget bankItemContainer = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER); + if (bankItemContainer != null) + { + Widget[] items = bankItemContainer.getDynamicChildren(); + for (Widget item : items) + { + item.setDragDeadTime(delay); + } + } + } + } From 94b44b24851b0e2c8e5c816d85ccf96b9ffff36a Mon Sep 17 00:00:00 2001 From: Alex Germann <17389577+alexgermann@users.noreply.github.com> Date: Sat, 18 Jan 2020 09:57:38 -0700 Subject: [PATCH 11/15] Update General Bentnoze clue step solution --- .../runelite/client/plugins/cluescrolls/clues/CrypticClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 899fde4302..2714a7e345 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 @@ -166,7 +166,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc new CrypticClue("Search the drawers in Falador's chain mail shop.", DRAWERS, new WorldPoint(2969, 3311, 0), "Wayne's Chains - Chainmail Specialist store at the southern Falador walls."), new CrypticClue("Talk to the barber in the Falador barber shop.", "Hairdresser", new WorldPoint(2945, 3379, 0), "The Hairdresser can be found in the barber shop, north of the west Falador bank."), new CrypticClue("Often sought out by scholars of histories past, find me where words of wisdom speak volumes.", "Examiner", new WorldPoint(3362, 3341, 0), "Speak to an examiner at the Exam Centre."), - new CrypticClue("Generally speaking, his nose was very bent.", "General Bentnoze", new WorldPoint(2957, 3511, 0), "Talk to General Bentnoze"), + new CrypticClue("Generally speaking, his nose was very bent.", "General Bentnoze", new WorldPoint(2957, 3511, 0), "Talk to General Bentnoze in the Goblin Village north of Falador."), new CrypticClue("Search the bush at the digsite centre.", BUSH_2357, new WorldPoint(3345, 3378, 0), "The bush is on the east side of the first pathway towards the digsite from the Exam Centre."), new CrypticClue("Someone watching the fights in the Duel Arena is your next destination.", "Jeed", new WorldPoint(3360, 3242, 0), "Talk to Jeed, found on the upper floors, at the Duel Arena."), new CrypticClue("It seems to have reached the end of the line, and it's still empty.", MINE_CART_6045, new WorldPoint(3041, 9820, 0), "Search the carts in the northern part of the Dwarven Mine."), From 7e0c935e044f41e222a862ad2e7137665ddea06c Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 7 Feb 2020 13:36:10 -0500 Subject: [PATCH 12/15] clue plugin: add clue dev command --- .../plugins/cluescrolls/ClueScrollPlugin.java | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java index e4a1e1008f..6e27f10c44 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollPlugin.java @@ -41,6 +41,8 @@ import java.util.List; import java.util.Objects; import java.util.stream.Stream; import javax.inject.Inject; +import javax.inject.Named; +import joptsimple.internal.Strings; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.runelite.api.ChatMessageType; @@ -61,7 +63,7 @@ import net.runelite.api.TileObject; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ChatMessage; -import net.runelite.client.events.ConfigChanged; +import net.runelite.api.events.CommandExecuted; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.ItemContainerChanged; @@ -74,6 +76,7 @@ import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.events.ConfigChanged; import net.runelite.client.game.ItemManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; @@ -165,6 +168,10 @@ public class ClueScrollPlugin extends Plugin @Inject private WorldMapPointManager worldMapPointManager; + @Inject + @Named("developerMode") + boolean developerMode; + private BufferedImage emoteImage; private BufferedImage mapArrow; private Integer clueItemId; @@ -409,9 +416,13 @@ public class ClueScrollPlugin extends Plugin resetClue(true); } - // If we have a clue, save that knowledge - // so the clue window doesn't have to be open. - updateClue(findClueScroll()); + final Widget clueScrollText = client.getWidget(WidgetInfo.CLUE_SCROLL_TEXT); + + if (clueScrollText != null) + { + ClueScroll clueScroll = findClueScroll(clueScrollText.getText()); + updateClue(clueScroll); + } } @Subscribe @@ -426,6 +437,18 @@ public class ClueScrollPlugin extends Plugin updateClue(BeginnerMapClue.forWidgetID(event.getGroupId())); } + @Subscribe + public void onCommandExecuted(CommandExecuted commandExecuted) + { + if (developerMode && commandExecuted.getCommand().equals("clue")) + { + String text = Strings.join(commandExecuted.getArguments(), " "); + ClueScroll clueScroll = findClueScroll(text); + log.debug("Found clue scroll for '{}': {}", text, clueScroll); + updateClue(clueScroll); + } + } + public BufferedImage getClueScrollImage() { return itemManager.getImage(ItemID.CLUE_SCROLL_MASTER); @@ -483,17 +506,10 @@ public class ClueScrollPlugin extends Plugin } } - private ClueScroll findClueScroll() + private ClueScroll findClueScroll(String rawText) { - final Widget clueScrollText = client.getWidget(WidgetInfo.CLUE_SCROLL_TEXT); - - if (clueScrollText == null) - { - return null; - } - // Remove line breaks and also the rare occasion where there are double line breaks - final String text = Text.sanitizeMultilineText(clueScrollText.getText()).toLowerCase(); + final String text = Text.sanitizeMultilineText(rawText).toLowerCase(); // Early return if this is same clue as already existing one if (clue instanceof TextClueScroll) @@ -506,7 +522,7 @@ public class ClueScrollPlugin extends Plugin if (text.startsWith("i'd like to hear some music.")) { - return MusicClue.forText(clueScrollText.getText()); + return MusicClue.forText(rawText); } if (text.contains("degrees") && text.contains("minutes")) @@ -561,7 +577,7 @@ public class ClueScrollPlugin extends Plugin return hotColdClue; } - final SkillChallengeClue skillChallengeClue = SkillChallengeClue.forText(text, clueScrollText.getText()); + final SkillChallengeClue skillChallengeClue = SkillChallengeClue.forText(text, rawText); if (skillChallengeClue != null) { @@ -569,7 +585,7 @@ public class ClueScrollPlugin extends Plugin } // three step cryptic clues need unedited text to check which steps are already done - final ThreeStepCrypticClue threeStepCrypticClue = ThreeStepCrypticClue.forText(text, clueScrollText.getText()); + final ThreeStepCrypticClue threeStepCrypticClue = ThreeStepCrypticClue.forText(text, rawText); if (threeStepCrypticClue != null) { @@ -577,7 +593,7 @@ public class ClueScrollPlugin extends Plugin } // We have unknown clue, reset - log.warn("Encountered unhandled clue text: {}", clueScrollText.getText()); + log.warn("Encountered unhandled clue text: {}", rawText); resetClue(true); return null; } @@ -748,6 +764,8 @@ public class ClueScrollPlugin extends Plugin resetClue(false); checkClueNPCs(clue, client.getCachedNPCs()); + // If we have a clue, save that knowledge + // so the clue window doesn't have to be open. this.clue = clue; } From c00559ee5c0059922125775a607d2c6d9653b2b1 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 2 Feb 2020 14:13:47 -0800 Subject: [PATCH 13/15] clue plugin: add light requirements to clues This commit adds a warning message to the clue scroll overlay when a player has a clue requiring a light source and does not have a light source equipped or in their inventory. It adds logic to check for the status of fire pits in areas which would remain permanently lit that way. Closes runelite/runelite#9626 Co-authored-by: David Co-authored-by: Jordan Atwood Co-authored-by: Adam --- .../main/java/net/runelite/api/Varbits.java | 11 + .../cluescrolls/ClueScrollOverlay.java | 50 ++- .../plugins/cluescrolls/clues/ClueScroll.java | 9 + .../cluescrolls/clues/CoordinateClue.java | 340 ++++++++++-------- .../cluescrolls/clues/CrypticClue.java | 8 +- .../plugins/cluescrolls/clues/EmoteClue.java | 10 +- 6 files changed, 268 insertions(+), 160 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Varbits.java b/runelite-api/src/main/java/net/runelite/api/Varbits.java index a7687b9af3..2921c5ed2c 100644 --- a/runelite-api/src/main/java/net/runelite/api/Varbits.java +++ b/runelite-api/src/main/java/net/runelite/api/Varbits.java @@ -297,6 +297,17 @@ public enum Varbits PERSONAL_POINTS(5422), RAID_PARTY_SIZE(5424), + /** + * Making Friends with My Arm fire pits + * + * Expected values: + * 0 = Not built + * 1 = Built + */ + FIRE_PIT_GIANT_MOLE(6532), + FIRE_PIT_LUMBRIDGE_SWAMP(6533), + FIRE_PIT_MOS_LE_HARMLESS(6544), + /** * Theatre of Blood 1=In Party, 2=Inside/Spectator, 3=Dead Spectating */ diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollOverlay.java index c0c98b36b8..d08433c7d3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/ClueScrollOverlay.java @@ -1,6 +1,7 @@ /* * Copyright (c) 2016-2017, Seth * Copyright (c) 2018, Lotto + * Copyright (c) 2019, David * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,10 +31,14 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import javax.inject.Inject; -import static net.runelite.api.ItemID.SPADE; +import net.runelite.api.Client; +import net.runelite.api.Item; +import static net.runelite.api.ItemID.*; import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG; import net.runelite.client.plugins.cluescrolls.clues.ClueScroll; +import net.runelite.client.plugins.cluescrolls.clues.item.AnyRequirementCollection; import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement; +import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.item; import net.runelite.client.plugins.cluescrolls.clues.item.SingleItemRequirement; import net.runelite.client.ui.overlay.Overlay; import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE; @@ -46,17 +51,42 @@ import net.runelite.client.ui.overlay.components.PanelComponent; public class ClueScrollOverlay extends Overlay { private static final ItemRequirement HAS_SPADE = new SingleItemRequirement(SPADE); + private static final ItemRequirement HAS_LIGHT = new AnyRequirementCollection("Light Source", + item(LIT_TORCH), + item(LIT_CANDLE), + item(LIT_BLACK_CANDLE), + item(CANDLE_LANTERN_4531), + item(CANDLE_LANTERN_4534), // lit black candle lantern + item(OIL_LAMP_4524), + item(OIL_LANTERN_4539), + item(BULLSEYE_LANTERN_4550), + item(SAPPHIRE_LANTERN_4702), + item(EMERALD_LANTERN_9065), + item(MINING_HELMET), + item(FIREMAKING_CAPE), + item(FIREMAKING_CAPE_10659), + item(FIREMAKING_CAPET), + item(KANDARIN_HEADGEAR_1), + item(KANDARIN_HEADGEAR_2), + item(KANDARIN_HEADGEAR_3), + item(KANDARIN_HEADGEAR_4), + item(BRUMA_TORCH), + item(MAX_CAPE), + item(MAX_CAPE_13282), + item(MAX_CAPE_13342)); public static final Color TITLED_CONTENT_COLOR = new Color(190, 190, 190); private final ClueScrollPlugin plugin; private final PanelComponent panelComponent = new PanelComponent(); + private final Client client; @Inject - private ClueScrollOverlay(ClueScrollPlugin plugin) + private ClueScrollOverlay(ClueScrollPlugin plugin, Client client) { super(plugin); this.plugin = plugin; + this.client = client; setPriority(OverlayPriority.LOW); getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Clue Scroll overlay")); } @@ -76,15 +106,27 @@ public class ClueScrollOverlay extends Overlay clue.makeOverlayHint(panelComponent, plugin); - if (clue.isRequiresSpade() && plugin.getInventoryItems() != null) + final Item[] inventoryItems = plugin.getInventoryItems(); + final Item[] equippedItems = plugin.getEquippedItems(); + + if (clue.isRequiresSpade() && inventoryItems != null) { - if (!HAS_SPADE.fulfilledBy(plugin.getInventoryItems())) + if (!HAS_SPADE.fulfilledBy(inventoryItems)) { panelComponent.getChildren().add(LineComponent.builder().left("").build()); panelComponent.getChildren().add(LineComponent.builder().left("Requires Spade!").leftColor(Color.RED).build()); } } + if (clue.isRequiresLight() + && ((clue.getHasFirePit() == null || client.getVar(clue.getHasFirePit()) != 1) + && (inventoryItems == null || !HAS_LIGHT.fulfilledBy(inventoryItems)) + && (equippedItems == null || !HAS_LIGHT.fulfilledBy(equippedItems)))) + { + panelComponent.getChildren().add(LineComponent.builder().left("").build()); + panelComponent.getChildren().add(LineComponent.builder().left("Requires Light Source!").leftColor(Color.RED).build()); + } + return panelComponent.render(graphics); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/ClueScroll.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/ClueScroll.java index 0b6bf8f724..ea3631f14c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/ClueScroll.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/ClueScroll.java @@ -28,6 +28,7 @@ import java.awt.Graphics2D; import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; +import net.runelite.api.Varbits; import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin; import net.runelite.client.ui.overlay.components.PanelComponent; @@ -37,6 +38,14 @@ public abstract class ClueScroll @Getter(AccessLevel.PUBLIC) private boolean requiresSpade; + @Setter(AccessLevel.PROTECTED) + @Getter(AccessLevel.PUBLIC) + private boolean requiresLight; + + @Setter(AccessLevel.PROTECTED) + @Getter(AccessLevel.PUBLIC) + private Varbits hasFirePit; + public abstract void makeOverlayHint(PanelComponent panelComponent, ClueScrollPlugin plugin); public abstract void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java index bc8ef25910..e485b6fe11 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java @@ -27,8 +27,11 @@ package net.runelite.client.plugins.cluescrolls.clues; import com.google.common.collect.ImmutableMap; import java.awt.Color; import java.awt.Graphics2D; +import javax.annotation.Nonnull; import javax.annotation.Nullable; import lombok.Getter; +import lombok.NonNull; +import net.runelite.api.Varbits; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin; @@ -40,162 +43,184 @@ import net.runelite.client.ui.overlay.components.TitleComponent; @Getter public class CoordinateClue extends ClueScroll implements TextClueScroll, LocationClueScroll { - private static final ImmutableMap CLUES = new ImmutableMap.Builder() + @Getter + private static class CoordinateClueInfo + { + private final String directions; + private final boolean lightRequired; + private final Varbits lightSource; + + private CoordinateClueInfo(@NonNull String directions) + { + this.directions = directions; + this.lightRequired = false; + this.lightSource = null; + } + + private CoordinateClueInfo(@Nonnull String directions, boolean lightRequired, Varbits lightSource) + { + this.directions = directions; + this.lightRequired = lightRequired; + this.lightSource = lightSource; + } + } + + private static final ImmutableMap CLUES = new ImmutableMap.Builder() // Medium - .put(new WorldPoint(2479, 3158, 0), "South of fruit tree patch, west of Tree Gnome Village.") - .put(new WorldPoint(2887, 3154, 0), "West of Banana plantation on Karamja.") - .put(new WorldPoint(2743, 3151, 0), "Entrance of Brimhaven dungeon.") - .put(new WorldPoint(3184, 3150, 0), "South of Lumbridge Swamp.") - .put(new WorldPoint(3217, 3177, 0), "East of Lumbridge Swamp.") - .put(new WorldPoint(3007, 3144, 0), "Near the entrance to the Asgarnian Ice Dungeon, south of Port Sarim (AIQ).") - .put(new WorldPoint(2896, 3119, 0), "Near Karambwan fishing spot (DKP).") - .put(new WorldPoint(2697, 3207, 0), "Centre of Moss Giant Island, west of Brimhaven.") - .put(new WorldPoint(2679, 3110, 0), "North of Hazelmere's house (CLS).") - .put(new WorldPoint(3510, 3074, 0), "East of Uzer (DLQ).") - .put(new WorldPoint(3160, 3251, 0), "West of trapdoor leading to H.A.M Hideout.") - .put(new WorldPoint(2643, 3252, 0), "South of Ardougne Zoo, North of Tower of Life (DJP).") - .put(new WorldPoint(2322, 3061, 0), "South-west of Castle wars (BKP).") - .put(new WorldPoint(2875, 3046, 0), "North of nature altar, north of Shilo Village (CKR).") - .put(new WorldPoint(2849, 3033, 0), "West of nature altar, north of Shilo Village (CKR).") - .put(new WorldPoint(2848, 3296, 0), "North of Crandor island.") - .put(new WorldPoint(2583, 2990, 0), "Feldip Hills, south-east of Gu'Thanoth (AKS).") - .put(new WorldPoint(3179, 3344, 0), "In the cow pen north of the Lumbridge windmill.") - .put(new WorldPoint(2383, 3370, 0), "West of the outpost") - .put(new WorldPoint(3312, 3375, 0), "North-west of Exam Centre, on the hill.") - .put(new WorldPoint(3121, 3384, 0), "North-east of Draynor Manor, near River Lum.") - .put(new WorldPoint(3430, 3388, 0), "West of Mort Myre Swamp (BKR).") - .put(new WorldPoint(2920, 3403, 0), "South-east of Taverley, near Lady of the Lake.") - .put(new WorldPoint(2594, 2899, 0), "South-east of Feldip Hills, by the crimson swifts (AKS).") - .put(new WorldPoint(2387, 3435, 0), "West of Tree Gnome Stronghold, near the pen containing terrorbirds.") - .put(new WorldPoint(2512, 3467, 0), "Baxtorian Falls (Bring rope).") - .put(new WorldPoint(2381, 3468, 0), "West of Tree Gnome Stronghold, north of the pen with terrorbirds.") - .put(new WorldPoint(3005, 3475, 0), "Ice Mountain, west of Edgeville.") - .put(new WorldPoint(2585, 3505, 0), "By the shore line north of the Coal Trucks.") - .put(new WorldPoint(3443, 3515, 0), "South of Slayer Tower (CKS).") - .put(new WorldPoint(2416, 3516, 0), "Tree Gnome Stronghold, west of Grand Tree, near swamp.") - .put(new WorldPoint(3429, 3523, 0), "South of Slayer Tower (CKS).") - .put(new WorldPoint(2363, 3531, 0), "North-east of Eagles' Peak (AKQ).") - .put(new WorldPoint(2919, 3535, 0), "East of Burthorpe pub.") - .put(new WorldPoint(3548, 3560, 0), "Inside Fenkenstrain's Castle.") - .put(new WorldPoint(1456, 3620, 0), "Graveyard west of Shayzien (DJR).") - .put(new WorldPoint(2735, 3638, 0), "East of Rellekka, north-west of Golden Apple Tree (AJR).") - .put(new WorldPoint(2681, 3653, 0), "Rellekka, in the garden of the south-east house.") - .put(new WorldPoint(2537, 3881, 0), "Miscellania (CIP).") - .put(new WorldPoint(2828, 3234, 0), "Southern coast of Crandor.") - .put(new WorldPoint(1247, 3726, 0), "Just inside the Farming Guild") - .put(new WorldPoint(3770, 3898, 0), "On the small island north-east of Fossil Island's mushroom forest.") + .put(new WorldPoint(2479, 3158, 0), new CoordinateClueInfo("South of fruit tree patch, west of Tree Gnome Village.")) + .put(new WorldPoint(2887, 3154, 0), new CoordinateClueInfo("West of Banana plantation on Karamja.")) + .put(new WorldPoint(2743, 3151, 0), new CoordinateClueInfo("Entrance of Brimhaven dungeon.")) + .put(new WorldPoint(3184, 3150, 0), new CoordinateClueInfo("South of Lumbridge Swamp.")) + .put(new WorldPoint(3217, 3177, 0), new CoordinateClueInfo("East of Lumbridge Swamp.")) + .put(new WorldPoint(3007, 3144, 0), new CoordinateClueInfo("Near the entrance to the Asgarnian Ice Dungeon, south of Port Sarim (AIQ).")) + .put(new WorldPoint(2896, 3119, 0), new CoordinateClueInfo("Near Karambwan fishing spot (DKP).")) + .put(new WorldPoint(2697, 3207, 0), new CoordinateClueInfo("Centre of Moss Giant Island, west of Brimhaven.")) + .put(new WorldPoint(2679, 3110, 0), new CoordinateClueInfo("North of Hazelmere's house (CLS).")) + .put(new WorldPoint(3510, 3074, 0), new CoordinateClueInfo("East of Uzer (DLQ).")) + .put(new WorldPoint(3160, 3251, 0), new CoordinateClueInfo("West of trapdoor leading to H.A.M Hideout.")) + .put(new WorldPoint(2643, 3252, 0), new CoordinateClueInfo("South of Ardougne Zoo, North of Tower of Life (DJP).")) + .put(new WorldPoint(2322, 3061, 0), new CoordinateClueInfo("South-west of Castle wars (BKP).")) + .put(new WorldPoint(2875, 3046, 0), new CoordinateClueInfo("North of nature altar, north of Shilo Village (CKR).")) + .put(new WorldPoint(2849, 3033, 0), new CoordinateClueInfo("West of nature altar, north of Shilo Village (CKR).")) + .put(new WorldPoint(2848, 3296, 0), new CoordinateClueInfo("North of Crandor island.")) + .put(new WorldPoint(2583, 2990, 0), new CoordinateClueInfo("Feldip Hills, south-east of Gu'Thanoth (AKS).")) + .put(new WorldPoint(3179, 3344, 0), new CoordinateClueInfo("In the cow pen north of the Lumbridge windmill.")) + .put(new WorldPoint(2383, 3370, 0), new CoordinateClueInfo("West of the outpost")) + .put(new WorldPoint(3312, 3375, 0), new CoordinateClueInfo("North-west of Exam Centre, on the hill.")) + .put(new WorldPoint(3121, 3384, 0), new CoordinateClueInfo("North-east of Draynor Manor, near River Lum.")) + .put(new WorldPoint(3430, 3388, 0), new CoordinateClueInfo("West of Mort Myre Swamp (BKR).")) + .put(new WorldPoint(2920, 3403, 0), new CoordinateClueInfo("South-east of Taverley, near Lady of the Lake.")) + .put(new WorldPoint(2594, 2899, 0), new CoordinateClueInfo("South-east of Feldip Hills, by the crimson swifts (AKS).")) + .put(new WorldPoint(2387, 3435, 0), new CoordinateClueInfo("West of Tree Gnome Stronghold, near the pen containing terrorbirds.")) + .put(new WorldPoint(2512, 3467, 0), new CoordinateClueInfo("Baxtorian Falls (Bring rope).")) + .put(new WorldPoint(2381, 3468, 0), new CoordinateClueInfo("West of Tree Gnome Stronghold, north of the pen with terrorbirds.")) + .put(new WorldPoint(3005, 3475, 0), new CoordinateClueInfo("Ice Mountain, west of Edgeville.")) + .put(new WorldPoint(2585, 3505, 0), new CoordinateClueInfo("By the shore line north of the Coal Trucks.")) + .put(new WorldPoint(3443, 3515, 0), new CoordinateClueInfo("South of Slayer Tower (CKS).")) + .put(new WorldPoint(2416, 3516, 0), new CoordinateClueInfo("Tree Gnome Stronghold, west of Grand Tree, near swamp.")) + .put(new WorldPoint(3429, 3523, 0), new CoordinateClueInfo("South of Slayer Tower (CKS).")) + .put(new WorldPoint(2363, 3531, 0), new CoordinateClueInfo("North-east of Eagles' Peak (AKQ).")) + .put(new WorldPoint(2919, 3535, 0), new CoordinateClueInfo("East of Burthorpe pub.")) + .put(new WorldPoint(3548, 3560, 0), new CoordinateClueInfo("Inside Fenkenstrain's Castle.")) + .put(new WorldPoint(1456, 3620, 0), new CoordinateClueInfo("Graveyard west of Shayzien (DJR).")) + .put(new WorldPoint(2735, 3638, 0), new CoordinateClueInfo("East of Rellekka, north-west of Golden Apple Tree (AJR).")) + .put(new WorldPoint(2681, 3653, 0), new CoordinateClueInfo("Rellekka, in the garden of the south-east house.")) + .put(new WorldPoint(2537, 3881, 0), new CoordinateClueInfo("Miscellania (CIP).")) + .put(new WorldPoint(2828, 3234, 0), new CoordinateClueInfo("Southern coast of Crandor.")) + .put(new WorldPoint(1247, 3726, 0), new CoordinateClueInfo("Just inside the Farming Guild")) + .put(new WorldPoint(3770, 3898, 0), new CoordinateClueInfo("On the small island north-east of Fossil Island's mushroom forest.")) // Hard - .put(new WorldPoint(2209, 3161, 0), "North-east of Tyras Camp (BJS).") - .put(new WorldPoint(2181, 3206, 0), "South of Iorwerth Camp.") - .put(new WorldPoint(3081, 3209, 0), "Small Island (CLP).") - .put(new WorldPoint(3399, 3246, 0), "Behind the Duel Arena.") - .put(new WorldPoint(2699, 3251, 0), "Little island (AIR).") - .put(new WorldPoint(3546, 3251, 0), "North-east of Burgh de Rott.") - .put(new WorldPoint(3544, 3256, 0), "North-east of Burgh de Rott.") - .put(new WorldPoint(2841, 3267, 0), "Crandor island.") - .put(new WorldPoint(3168, 3041, 0), "Bedabin Camp.") - .put(new WorldPoint(2542, 3031, 0), "Gu'Tanoth, may require 20gp.") - .put(new WorldPoint(2581, 3030, 0), "Gu'Tanoth island, enter cave north-west of Feldip Hills (AKS).") - .put(new WorldPoint(2961, 3024, 0), "Ship yard (DKP).") - .put(new WorldPoint(2339, 3311, 0), "East of Prifddinas on Arandar mountain pass.") - .put(new WorldPoint(3440, 3341, 0), "Nature Spirit's grotto (BIP).") - .put(new WorldPoint(2763, 2974, 0), "Cairn Isle, west of Shilo Village (CKR).") - .put(new WorldPoint(3138, 2969, 0), "West of Bandit Camp in Kharidian Desert.") - .put(new WorldPoint(2924, 2963, 0), "On the southern part of eastern Karamja.") - .put(new WorldPoint(2838, 2914, 0), "Kharazi Jungle, near water pool (CKR).") - .put(new WorldPoint(3441, 3419, 0), "Mort Myre Swamp (BKR).") - .put(new WorldPoint(2950, 2902, 0), "South-east of Kharazi Jungle.") - .put(new WorldPoint(2775, 2891, 0), "South-west of Kharazi Jungle.") - .put(new WorldPoint(3113, 3602, 0), "Wilderness. North of Edgeville (level 11).") - .put(new WorldPoint(2892, 3675, 0), "On the summit of Trollheim.") - .put(new WorldPoint(3168, 3677, 0), "Wilderness. Graveyard of Shadows.") - .put(new WorldPoint(2853, 3690, 0), "Entrance to the troll Stronghold.") - .put(new WorldPoint(3305, 3692, 0), "Wilderness. West of eastern green dragon.") - .put(new WorldPoint(3055, 3696, 0), "Wilderness. Bandit Camp.") - .put(new WorldPoint(3302, 3696, 0), "Wilderness. West of eastern green dragon.") - .put(new WorldPoint(1479, 3696, 0), "Lizardman Canyon (DJR).") - .put(new WorldPoint(2712, 3732, 0), "North-east of Rellekka (DKS).") - .put(new WorldPoint(2970, 3749, 0), "Wilderness. Forgotten Cemetery.") - .put(new WorldPoint(3094, 3764, 0), "Wilderness. Mining site north of Bandit Camp.") - .put(new WorldPoint(3311, 3769, 0), "Wilderness. North of Venenatis.") - .put(new WorldPoint(1460, 3782, 0), "Lovakengj, near burning man.") - .put(new WorldPoint(3244, 3792, 0), "Wilderness. South-east of Lava Dragon Isle by some Chaos Dwarves.") - .put(new WorldPoint(3140, 3804, 0), "Wilderness. North of Ruins.") - .put(new WorldPoint(2946, 3819, 0), "Wilderness. Chaos Temple (level 38).") - .put(new WorldPoint(3771, 3825, 0), "Fossil Island. East of Museum Camp.") - .put(new WorldPoint(3013, 3846, 0), "Wilderness. West of Lava Maze, before KBD's lair.") - .put(new WorldPoint(3058, 3884, 0), "Wilderness. Near runite ore north of Lava Maze.") - .put(new WorldPoint(3290, 3889, 0), "Wilderness. Demonic Ruins.") - .put(new WorldPoint(3770, 3897, 0), "Small Island north of Fossil Island.") - .put(new WorldPoint(2505, 3899, 0), "Small Island north-west of Miscellania (AJS).") - .put(new WorldPoint(3285, 3942, 0), "Wilderness. Rogues' Castle.") - .put(new WorldPoint(3159, 3959, 0), "Wilderness. North of Deserted Keep, west of Resource Area.") - .put(new WorldPoint(3039, 3960, 0), "Wilderness. Pirates' Hideout.") - .put(new WorldPoint(2987, 3963, 0), "Wilderness. West of Wilderness Agility Course.") - .put(new WorldPoint(3189, 3963, 0), "Wilderness. North of Resource Area, near magic axe hut.") - .put(new WorldPoint(2341, 3697, 0), "North-east of the Piscatoris Fishing Colony bank.") - .put(new WorldPoint(3143, 3774, 0), "In level 32 Wilderness, by the black chinchompa hunting area.") - .put(new WorldPoint(2992, 3941, 0), "Wilderness Agility Course, past the log balance.") + .put(new WorldPoint(2209, 3161, 0), new CoordinateClueInfo("North-east of Tyras Camp (BJS).")) + .put(new WorldPoint(2181, 3206, 0), new CoordinateClueInfo("South of Iorwerth Camp.")) + .put(new WorldPoint(3081, 3209, 0), new CoordinateClueInfo("Small Island (CLP).")) + .put(new WorldPoint(3399, 3246, 0), new CoordinateClueInfo("Behind the Duel Arena.")) + .put(new WorldPoint(2699, 3251, 0), new CoordinateClueInfo("Little island (AIR).")) + .put(new WorldPoint(3546, 3251, 0), new CoordinateClueInfo("North-east of Burgh de Rott.")) + .put(new WorldPoint(3544, 3256, 0), new CoordinateClueInfo("North-east of Burgh de Rott.")) + .put(new WorldPoint(2841, 3267, 0), new CoordinateClueInfo("Crandor island.")) + .put(new WorldPoint(3168, 3041, 0), new CoordinateClueInfo("Bedabin Camp.")) + .put(new WorldPoint(2542, 3031, 0), new CoordinateClueInfo("Gu'Tanoth, may require 20gp.")) + .put(new WorldPoint(2581, 3030, 0), new CoordinateClueInfo("Gu'Tanoth island, enter cave north-west of Feldip Hills (AKS).")) + .put(new WorldPoint(2961, 3024, 0), new CoordinateClueInfo("Ship yard (DKP).")) + .put(new WorldPoint(2339, 3311, 0), new CoordinateClueInfo("East of Prifddinas on Arandar mountain pass.")) + .put(new WorldPoint(3440, 3341, 0), new CoordinateClueInfo("Nature Spirit's grotto (BIP).")) + .put(new WorldPoint(2763, 2974, 0), new CoordinateClueInfo("Cairn Isle, west of Shilo Village (CKR).")) + .put(new WorldPoint(3138, 2969, 0), new CoordinateClueInfo("West of Bandit Camp in Kharidian Desert.")) + .put(new WorldPoint(2924, 2963, 0), new CoordinateClueInfo("On the southern part of eastern Karamja.")) + .put(new WorldPoint(2838, 2914, 0), new CoordinateClueInfo("Kharazi Jungle, near water pool (CKR).")) + .put(new WorldPoint(3441, 3419, 0), new CoordinateClueInfo("Mort Myre Swamp (BKR).")) + .put(new WorldPoint(2950, 2902, 0), new CoordinateClueInfo("South-east of Kharazi Jungle.")) + .put(new WorldPoint(2775, 2891, 0), new CoordinateClueInfo("South-west of Kharazi Jungle.")) + .put(new WorldPoint(3113, 3602, 0), new CoordinateClueInfo("Wilderness. North of Edgeville (level 11).")) + .put(new WorldPoint(2892, 3675, 0), new CoordinateClueInfo("On the summit of Trollheim.")) + .put(new WorldPoint(3168, 3677, 0), new CoordinateClueInfo("Wilderness. Graveyard of Shadows.")) + .put(new WorldPoint(2853, 3690, 0), new CoordinateClueInfo("Entrance to the troll Stronghold.")) + .put(new WorldPoint(3305, 3692, 0), new CoordinateClueInfo("Wilderness. West of eastern green dragon.")) + .put(new WorldPoint(3055, 3696, 0), new CoordinateClueInfo("Wilderness. Bandit Camp.")) + .put(new WorldPoint(3302, 3696, 0), new CoordinateClueInfo("Wilderness. West of eastern green dragon.")) + .put(new WorldPoint(1479, 3696, 0), new CoordinateClueInfo("Lizardman Canyon (DJR).")) + .put(new WorldPoint(2712, 3732, 0), new CoordinateClueInfo("North-east of Rellekka (DKS).")) + .put(new WorldPoint(2970, 3749, 0), new CoordinateClueInfo("Wilderness. Forgotten Cemetery.")) + .put(new WorldPoint(3094, 3764, 0), new CoordinateClueInfo("Wilderness. Mining site north of Bandit Camp.")) + .put(new WorldPoint(3311, 3769, 0), new CoordinateClueInfo("Wilderness. North of Venenatis.")) + .put(new WorldPoint(1460, 3782, 0), new CoordinateClueInfo("Lovakengj, near burning man.")) + .put(new WorldPoint(3244, 3792, 0), new CoordinateClueInfo("Wilderness. South-east of Lava Dragon Isle by some Chaos Dwarves.")) + .put(new WorldPoint(3140, 3804, 0), new CoordinateClueInfo("Wilderness. North of Ruins.")) + .put(new WorldPoint(2946, 3819, 0), new CoordinateClueInfo("Wilderness. Chaos Temple (level 38).")) + .put(new WorldPoint(3771, 3825, 0), new CoordinateClueInfo("Fossil Island. East of Museum Camp.")) + .put(new WorldPoint(3013, 3846, 0), new CoordinateClueInfo("Wilderness. West of Lava Maze, before KBD's lair.")) + .put(new WorldPoint(3058, 3884, 0), new CoordinateClueInfo("Wilderness. Near runite ore north of Lava Maze.")) + .put(new WorldPoint(3290, 3889, 0), new CoordinateClueInfo("Wilderness. Demonic Ruins.")) + .put(new WorldPoint(3770, 3897, 0), new CoordinateClueInfo("Small Island north of Fossil Island.")) + .put(new WorldPoint(2505, 3899, 0), new CoordinateClueInfo("Small Island north-west of Miscellania (AJS).")) + .put(new WorldPoint(3285, 3942, 0), new CoordinateClueInfo("Wilderness. Rogues' Castle.")) + .put(new WorldPoint(3159, 3959, 0), new CoordinateClueInfo("Wilderness. North of Deserted Keep, west of Resource Area.")) + .put(new WorldPoint(3039, 3960, 0), new CoordinateClueInfo("Wilderness. Pirates' Hideout.")) + .put(new WorldPoint(2987, 3963, 0), new CoordinateClueInfo("Wilderness. West of Wilderness Agility Course.")) + .put(new WorldPoint(3189, 3963, 0), new CoordinateClueInfo("Wilderness. North of Resource Area, near magic axe hut.")) + .put(new WorldPoint(2341, 3697, 0), new CoordinateClueInfo("North-east of the Piscatoris Fishing Colony bank.")) + .put(new WorldPoint(3143, 3774, 0), new CoordinateClueInfo("In level 32 Wilderness, by the black chinchompa hunting area.")) + .put(new WorldPoint(2992, 3941, 0), new CoordinateClueInfo("Wilderness Agility Course, past the log balance.")) // Elite - .put(new WorldPoint(2357, 3151, 0), "Lletya.") - .put(new WorldPoint(3587, 3180, 0), "Meiyerditch.") - .put(new WorldPoint(2820, 3078, 0), "Tai Bwo Wannai. Hardwood Grove.") - .put(new WorldPoint(3811, 3060, 0), "Small island north-east of Mos Le'Harmless.") - .put(new WorldPoint(2180, 3282, 0), "North of Iorwerth Camp.") - .put(new WorldPoint(2870, 2997, 0), "North-east of Shilo Village.") - .put(new WorldPoint(3302, 2988, 0), "On top of a cliff to the west of Pollnivneach.") - .put(new WorldPoint(2511, 2980, 0), "Just south of Gu'Tanoth, west of gnome glider.") - .put(new WorldPoint(2732, 3372, 0), "Legends' Guild.") - .put(new WorldPoint(3573, 3425, 0), "North of Dessous's tomb from Desert Treasure.") - .put(new WorldPoint(3828, 2848, 0), "East of Harmony Island.") - .put(new WorldPoint(3225, 2838, 0), "South of Desert Treasure pyramid.") - .put(new WorldPoint(1773, 3510, 0), "Ruins north of the Hosidius mine.") - .put(new WorldPoint(3822, 3562, 0), "North-east of Dragontooth Island.") - .put(new WorldPoint(3603, 3564, 0), "North of the wrecked ship, outside of Port Phasmatys.") - .put(new WorldPoint(2936, 2721, 0), "Eastern shore of Crash Island.") - .put(new WorldPoint(2697, 2705, 0), "South-west of Ape Atoll.") - .put(new WorldPoint(2778, 3678, 0), "Mountain Camp.") - .put(new WorldPoint(2827, 3740, 0), "West of the entrance to the Ice Path, where the Troll child resides.") - .put(new WorldPoint(2359, 3799, 0), "Neitiznot.") - .put(new WorldPoint(2194, 3807, 0), "Pirates' Cove.") - .put(new WorldPoint(2700, 3808, 0), "Northwestern part of the Trollweiss and Rellekka Hunter area (DKS).") - .put(new WorldPoint(3215, 3835, 0), "Wilderness. Lava Dragon Isle.") - .put(new WorldPoint(3369, 3894, 0), "Wilderness. Fountain of Rune.") - .put(new WorldPoint(2065, 3923, 0), "Outside the western wall on Lunar Isle.") - .put(new WorldPoint(3188, 3933, 0), "Wilderness. Resource Area.") - .put(new WorldPoint(2997, 3953, 0), "Wilderness. Inside Agility Training Area.") - .put(new WorldPoint(3380, 3963, 0), "Wilderness. North of Volcano.") - .put(new WorldPoint(3051, 3736, 0), "East of the Wilderness Obelisk in 28 Wilderness.") - .put(new WorldPoint(2316, 3814, 0), "West of Neitiznot, near the bridge.") - .put(new WorldPoint(2872, 3937, 0), "Weiss.") - .put(new WorldPoint(2484, 4016, 0), "Northeast corner of the Island of Stone.") + .put(new WorldPoint(2357, 3151, 0), new CoordinateClueInfo("Lletya.")) + .put(new WorldPoint(3587, 3180, 0), new CoordinateClueInfo("Meiyerditch.")) + .put(new WorldPoint(2820, 3078, 0), new CoordinateClueInfo("Tai Bwo Wannai. Hardwood Grove.")) + .put(new WorldPoint(3811, 3060, 0), new CoordinateClueInfo("Small island north-east of Mos Le'Harmless.", true, Varbits.FIRE_PIT_MOS_LE_HARMLESS)) + .put(new WorldPoint(2180, 3282, 0), new CoordinateClueInfo("North of Iorwerth Camp.")) + .put(new WorldPoint(2870, 2997, 0), new CoordinateClueInfo("North-east of Shilo Village.")) + .put(new WorldPoint(3302, 2988, 0), new CoordinateClueInfo("On top of a cliff to the west of Pollnivneach.")) + .put(new WorldPoint(2511, 2980, 0), new CoordinateClueInfo("Just south of Gu'Tanoth, west of gnome glider.")) + .put(new WorldPoint(2732, 3372, 0), new CoordinateClueInfo("Legends' Guild.")) + .put(new WorldPoint(3573, 3425, 0), new CoordinateClueInfo("North of Dessous's tomb from Desert Treasure.")) + .put(new WorldPoint(3828, 2848, 0), new CoordinateClueInfo("East of Harmony Island.")) + .put(new WorldPoint(3225, 2838, 0), new CoordinateClueInfo("South of Desert Treasure pyramid.")) + .put(new WorldPoint(1773, 3510, 0), new CoordinateClueInfo("Ruins north of the Hosidius mine.")) + .put(new WorldPoint(3822, 3562, 0), new CoordinateClueInfo("North-east of Dragontooth Island.")) + .put(new WorldPoint(3603, 3564, 0), new CoordinateClueInfo("North of the wrecked ship, outside of Port Phasmatys.")) + .put(new WorldPoint(2936, 2721, 0), new CoordinateClueInfo("Eastern shore of Crash Island.")) + .put(new WorldPoint(2697, 2705, 0), new CoordinateClueInfo("South-west of Ape Atoll.")) + .put(new WorldPoint(2778, 3678, 0), new CoordinateClueInfo("Mountain Camp.")) + .put(new WorldPoint(2827, 3740, 0), new CoordinateClueInfo("West of the entrance to the Ice Path, where the Troll child resides.")) + .put(new WorldPoint(2359, 3799, 0), new CoordinateClueInfo("Neitiznot.")) + .put(new WorldPoint(2194, 3807, 0), new CoordinateClueInfo("Pirates' Cove.")) + .put(new WorldPoint(2700, 3808, 0), new CoordinateClueInfo("Northwestern part of the Trollweiss and Rellekka Hunter area (DKS).")) + .put(new WorldPoint(3215, 3835, 0), new CoordinateClueInfo("Wilderness. Lava Dragon Isle.")) + .put(new WorldPoint(3369, 3894, 0), new CoordinateClueInfo("Wilderness. Fountain of Rune.")) + .put(new WorldPoint(2065, 3923, 0), new CoordinateClueInfo("Outside the western wall on Lunar Isle.")) + .put(new WorldPoint(3188, 3933, 0), new CoordinateClueInfo("Wilderness. Resource Area.")) + .put(new WorldPoint(2997, 3953, 0), new CoordinateClueInfo("Wilderness. Inside Agility Training Area.")) + .put(new WorldPoint(3380, 3963, 0), new CoordinateClueInfo("Wilderness. North of Volcano.")) + .put(new WorldPoint(3051, 3736, 0), new CoordinateClueInfo("East of the Wilderness Obelisk in 28 Wilderness.")) + .put(new WorldPoint(2316, 3814, 0), new CoordinateClueInfo("West of Neitiznot, near the bridge.")) + .put(new WorldPoint(2872, 3937, 0), new CoordinateClueInfo("Weiss.")) + .put(new WorldPoint(2484, 4016, 0), new CoordinateClueInfo("Northeast corner of the Island of Stone.")) // Master - .put(new WorldPoint(2178, 3209, 0), "South of Iorwerth Camp.") - .put(new WorldPoint(2155, 3100, 0), "South of Port Tyras (BJS).") - .put(new WorldPoint(2217, 3092, 0), "Poison Waste island (DLR).") - .put(new WorldPoint(3830, 3060, 0), "Small island located north-east of Mos Le'Harmless.") - .put(new WorldPoint(2834, 3271, 0), "Crandor island.") - .put(new WorldPoint(2732, 3284, 0), "Witchaven.") - .put(new WorldPoint(3622, 3320, 0), "Meiyerditch. Outside mine.") - .put(new WorldPoint(2303, 3328, 0), "East of Prifddinas.") - .put(new WorldPoint(3570, 3405, 0), "North of Dessous's tomb from Desert Treasure.") - .put(new WorldPoint(2840, 3423, 0), "Water Obelisk Island.") - .put(new WorldPoint(3604, 3564, 0), "North of the wrecked ship, outside of Port Phasmatys (ALQ).") - .put(new WorldPoint(3085, 3569, 0), "Wilderness. Obelisk of Air.") - .put(new WorldPoint(2934, 2727, 0), "Eastern shore of Crash Island.") - .put(new WorldPoint(1451, 3695, 0), "West side of Lizardman Canyon with Lizardman shaman.") - .put(new WorldPoint(2538, 3739, 0), "Waterbirth Island. Bring a pet rock and rune thrownaxe.") - .put(new WorldPoint(1698, 3792, 0), "Arceuus church.") - .put(new WorldPoint(2951, 3820, 0), "Wilderness. Chaos Temple (level 38).") - .put(new WorldPoint(2202, 3825, 0), "Pirates' Cove, between Lunar Isle and Rellekka.") - .put(new WorldPoint(1761, 3853, 0), "Arceuus essence mine (CIS).") - .put(new WorldPoint(2090, 3863, 0), "South of Lunar Isle, west of Astral altar.") - .put(new WorldPoint(1442, 3878, 0), "Sulphur Mine.") - .put(new WorldPoint(3380, 3929, 0), "Wilderness. Near Volcano.") - .put(new WorldPoint(3188, 3939, 0), "Wilderness. Resource Area.") - .put(new WorldPoint(3304, 3941, 0), "Wilderness. East of Rogues' Castle.") - .put(new WorldPoint(2994, 3961, 0), "Wilderness. Inside Agility Training Area.") - .put(new WorldPoint(1248, 3751, 0), "In the north wing of the Farming Guild.") + .put(new WorldPoint(2178, 3209, 0), new CoordinateClueInfo("South of Iorwerth Camp.")) + .put(new WorldPoint(2155, 3100, 0), new CoordinateClueInfo("South of Port Tyras (BJS).")) + .put(new WorldPoint(2217, 3092, 0), new CoordinateClueInfo("Poison Waste island (DLR).")) + .put(new WorldPoint(3830, 3060, 0), new CoordinateClueInfo("Small island located north-east of Mos Le'Harmless.", true, Varbits.FIRE_PIT_MOS_LE_HARMLESS)) + .put(new WorldPoint(2834, 3271, 0), new CoordinateClueInfo("Crandor island.")) + .put(new WorldPoint(2732, 3284, 0), new CoordinateClueInfo("Witchaven.")) + .put(new WorldPoint(3622, 3320, 0), new CoordinateClueInfo("Meiyerditch. Outside mine.")) + .put(new WorldPoint(2303, 3328, 0), new CoordinateClueInfo("East of Prifddinas.")) + .put(new WorldPoint(3570, 3405, 0), new CoordinateClueInfo("North of Dessous's tomb from Desert Treasure.")) + .put(new WorldPoint(2840, 3423, 0), new CoordinateClueInfo("Water Obelisk Island.")) + .put(new WorldPoint(3604, 3564, 0), new CoordinateClueInfo("North of the wrecked ship, outside of Port Phasmatys (ALQ).")) + .put(new WorldPoint(3085, 3569, 0), new CoordinateClueInfo("Wilderness. Obelisk of Air.")) + .put(new WorldPoint(2934, 2727, 0), new CoordinateClueInfo("Eastern shore of Crash Island.")) + .put(new WorldPoint(1451, 3695, 0), new CoordinateClueInfo("West side of Lizardman Canyon with Lizardman shaman.")) + .put(new WorldPoint(2538, 3739, 0), new CoordinateClueInfo("Waterbirth Island. Bring a pet rock and rune thrownaxe.")) + .put(new WorldPoint(1698, 3792, 0), new CoordinateClueInfo("Arceuus church.")) + .put(new WorldPoint(2951, 3820, 0), new CoordinateClueInfo("Wilderness. Chaos Temple (level 38).")) + .put(new WorldPoint(2202, 3825, 0), new CoordinateClueInfo("Pirates' Cove, between Lunar Isle and Rellekka.")) + .put(new WorldPoint(1761, 3853, 0), new CoordinateClueInfo("Arceuus essence mine (CIS).")) + .put(new WorldPoint(2090, 3863, 0), new CoordinateClueInfo("South of Lunar Isle, west of Astral altar.")) + .put(new WorldPoint(1442, 3878, 0), new CoordinateClueInfo("Sulphur Mine.")) + .put(new WorldPoint(3380, 3929, 0), new CoordinateClueInfo("Wilderness. Near Volcano.")) + .put(new WorldPoint(3188, 3939, 0), new CoordinateClueInfo("Wilderness. Resource Area.")) + .put(new WorldPoint(3304, 3941, 0), new CoordinateClueInfo("Wilderness. East of Rogues' Castle.")) + .put(new WorldPoint(2994, 3961, 0), new CoordinateClueInfo("Wilderness. Inside Agility Training Area.")) + .put(new WorldPoint(1248, 3751, 0), new CoordinateClueInfo("In the north wing of the Farming Guild.")) .build(); private final String text; @@ -211,6 +236,13 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati this.text = text; this.location = location; this.mirrorLocation = mirrorLocation; + + final CoordinateClueInfo clueInfo = CLUES.get(location); + if (clueInfo != null) + { + setHasFirePit(clueInfo.getLightSource()); + setRequiresLight(clueInfo.lightRequired); + } setRequiresSpade(true); } @@ -232,12 +264,12 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati { panelComponent.getChildren().add(TitleComponent.builder().text("Coordinate Clue").build()); - String solution = CLUES.get(location); + final CoordinateClueInfo solution = CLUES.get(location); if (solution != null) { panelComponent.getChildren().add(LineComponent.builder() - .left(solution) + .left(solution.getDirections()) .build()); panelComponent.getChildren().add(LineComponent.builder().build()); } 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 2714a7e345..bd1c30c01c 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 @@ -134,7 +134,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc new CrypticClue("If you look closely enough, it seems that the archers have lost more than their needles.", HAYSTACK, new WorldPoint(2672, 3416, 0), "Search the haystack by the south corner of the Rangers' Guild"), new CrypticClue("Search the crate in the left-hand tower of Lumbridge Castle.", CRATE_357, new WorldPoint(3228, 3212, 1), "Located on the first floor of the southern tower at the Lumbridge Castle entrance."), new CrypticClue("'Small shoe.' Often found with rod on mushroom.", "Gnome trainer", new WorldPoint(2476, 3428, 0), "Talk to any Gnome trainer in the agility area of the Tree Gnome Stronghold."), - new CrypticClue("I live in a deserted crack collecting soles.", "Genie", new WorldPoint(3371, 9320, 0), "Enter the crack west of Nardah Rug merchant, and talk to the Genie. You'll need a light source and a rope."), + new CrypticClue("I live in a deserted crack collecting soles.", "Genie", new WorldPoint(3371, 9320, 0), "Enter the crack west of Nardah Rug merchant, and talk to the Genie. You'll need a light source and a rope.", true), new CrypticClue("46 is my number. My body is the colour of burnt orange and crawls among those with eight. Three mouths I have, yet I cannot eat. My blinking blue eye hides my grave.", new WorldPoint(3170, 3885, 0), "Sapphire respawn in the Spider's Nest, lvl 46 Wilderness. Dig under the sapphire spawn."), new CrypticClue("Green is the colour of my death as the winter-guise, I swoop towards the ground.", new WorldPoint(2780, 3783, 0), "Players need to slide down to where Trollweiss grows on Trollweiss Mountain."), new CrypticClue("Talk to a party-goer in Falador.", "Lucy", new WorldPoint(3046, 3382, 0), "Lucy is the bartender on the first floor of the party room."), @@ -348,6 +348,12 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc this(text, npc, -1, location, solution, ""); } + private CrypticClue(String text, String npc, WorldPoint location, String solution, boolean requiresLight) + { + this(text, npc, location, solution); + setRequiresLight(requiresLight); + } + private CrypticClue(String text, int objectId, WorldPoint location, String solution, String questionText) { this(text, null, objectId, location, solution, questionText); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java index 4a2d00095c..89de1e4cbe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java @@ -40,6 +40,7 @@ import net.runelite.api.ItemID; import static net.runelite.api.ItemID.*; import net.runelite.api.Perspective; import net.runelite.api.ScriptID; +import net.runelite.api.Varbits; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR; @@ -109,7 +110,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Dance at the crossroads north of Draynor. Equip an iron chain body, a sapphire ring and a longbow.", "Draynor Village", CROSSROADS_NORTH_OF_DRAYNOR_VILLAGE, new WorldPoint(3109, 3294, 0), DANCE, item(IRON_CHAINBODY), item(SAPPHIRE_RING), item(LONGBOW)), new EmoteClue("Dance in the Party Room. Equip a steel full helmet, steel platebody and an iron plateskirt.", "Falador Party Room", OUTSIDE_THE_FALADOR_PARTY_ROOM, new WorldPoint(3045, 3376, 0), DANCE, item(STEEL_FULL_HELM), item(STEEL_PLATEBODY), item(IRON_PLATESKIRT)), new EmoteClue("Dance in the shack in Lumbridge Swamp. Equip a bronze dagger, iron full helmet and a gold ring.", "Lumbridge swamp", NEAR_A_SHED_IN_LUMBRIDGE_SWAMP, new WorldPoint(3203, 3169, 0), DANCE, item(BRONZE_DAGGER), item(IRON_FULL_HELM), item(GOLD_RING)), - new EmoteClue("Dance in the dark caves beneath Lumbridge Swamp. Blow a kiss before you talk to me. Equip an air staff, Bronze full helm and an amulet of power.", "Lumbridge swamp", LUMBRIDGE_SWAMP_CAVES, new WorldPoint(3168, 9571, 0), DANCE, BLOW_KISS, item(STAFF_OF_AIR), item(BRONZE_FULL_HELM), item(AMULET_OF_POWER)), + new EmoteClue("Dance in the dark caves beneath Lumbridge Swamp. Blow a kiss before you talk to me. Equip an air staff, Bronze full helm and an amulet of power.", "Lumbridge swamp caves", LUMBRIDGE_SWAMP_CAVES, new WorldPoint(3168, 9571, 0), DANCE, BLOW_KISS, Varbits.FIRE_PIT_LUMBRIDGE_SWAMP, item(STAFF_OF_AIR), item(BRONZE_FULL_HELM), item(AMULET_OF_POWER)), new EmoteClue("Dance at the cat-doored pyramid in Sophanem. Beware of double agents! Equip a ring of life, an uncharged amulet of glory and an adamant two-handed sword.", "Pyramid Of Sophanem", OUTSIDE_THE_GREAT_PYRAMID_OF_SOPHANEM, new WorldPoint(3294, 2781, 0), DANCE, item(RING_OF_LIFE), item(AMULET_OF_GLORY), item(ADAMANT_2H_SWORD)), new EmoteClue("Dance in the centre of Canifis. Bow before you talk to me. Equip a green gnome robe top, mithril plate legs and an iron two-handed sword.", "Canifis", CENTRE_OF_CANIFIS, new WorldPoint(3492, 3488, 0), DANCE, BOW, item(GREEN_ROBE_TOP), item(MITHRIL_PLATELEGS), item(IRON_2H_SWORD)), new EmoteClue("Dance in the King Black Dragon's lair. Beware of double agents! Equip a black dragonhide body, black dragonhide vambs and a black dragon mask.", "King black dragon's lair", KING_BLACK_DRAGONS_LAIR, new WorldPoint(2271, 4680, 0), DANCE, item(BLACK_DHIDE_BODY), item(BLACK_DHIDE_VAMB), item(BLACK_DRAGON_MASK)), @@ -206,6 +207,13 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu this.itemRequirements = itemRequirements; } + private EmoteClue(String text, String locationName, @Nullable STASHUnit stashUnit, WorldPoint location, Emote firstEmote, Emote secondEmote, @Nonnull Varbits firePit, @Nonnull ItemRequirement... itemRequirements) + { + this(text, locationName, stashUnit, location, firstEmote, secondEmote, itemRequirements); + setRequiresLight(true); + setHasFirePit(firePit); + } + @Override public void makeOverlayHint(PanelComponent panelComponent, ClueScrollPlugin plugin) { From 34f94e973c18627a3d7f20faf8160647b87c09c9 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 8 Feb 2020 14:15:58 -0500 Subject: [PATCH 14/15] opponentinfo: add opponent's opponent for npcs Upon closer inspection it was realized this is allowed for NPCs --- .../opponentinfo/OpponentInfoConfig.java | 11 +++++++++ .../opponentinfo/OpponentInfoOverlay.java | 23 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoConfig.java index 6adb3af1f2..9f08e128af 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoConfig.java @@ -53,6 +53,17 @@ public interface OpponentInfoConfig extends Config return HitpointsDisplayStyle.HITPOINTS; } + @ConfigItem( + keyName = "showOpponentsOpponent", + name = "Show opponent's opponent", + description = "Toggle showing opponent's opponent if within a multi-combat area", + position = 2 + ) + default boolean showOpponentsOpponent() + { + return true; + } + @ConfigItem( keyName = "showOpponentsInMenu", name = "Show opponents in menu", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoOverlay.java index c20e33244a..d78036217c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoOverlay.java @@ -37,6 +37,7 @@ import net.runelite.api.Client; import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG; import net.runelite.api.NPC; import net.runelite.api.Player; +import net.runelite.api.Varbits; import net.runelite.client.game.HiscoreManager; import net.runelite.client.game.NPCManager; import net.runelite.client.ui.overlay.Overlay; @@ -68,6 +69,7 @@ class OpponentInfoOverlay extends Overlay private int lastRatio = 0; private int lastHealthScale = 0; private String opponentName; + private String opponentsOpponentName; @Inject private OpponentInfoOverlay( @@ -126,6 +128,17 @@ class OpponentInfoOverlay extends Overlay } } } + + final Actor opponentsOpponent = opponent.getInteracting(); + if (opponent instanceof NPC && opponentsOpponent != null + && (opponentsOpponent != client.getLocalPlayer() || client.getVar(Varbits.MULTICOMBAT_AREA) == 1)) + { + opponentsOpponentName = Text.removeTags(opponentsOpponent.getName()); + } + else + { + opponentsOpponentName = null; + } } if (opponentName == null) @@ -205,6 +218,16 @@ class OpponentInfoOverlay extends Overlay panelComponent.getChildren().add(progressBarComponent); } + // Opponents opponent + if (opponentsOpponentName != null && opponentInfoConfig.showOpponentsOpponent()) + { + textWidth = Math.max(textWidth, fontMetrics.stringWidth(opponentsOpponentName)); + panelComponent.setPreferredSize(new Dimension(textWidth, 0)); + panelComponent.getChildren().add(TitleComponent.builder() + .text(opponentsOpponentName) + .build()); + } + return panelComponent.render(graphics); } } From 8556a86333dc5954b05aef577766f1eb7a91f109 Mon Sep 17 00:00:00 2001 From: leopluerodon Date: Sat, 8 Feb 2020 15:24:40 -0700 Subject: [PATCH 15/15] Add twisted slayer helmet to item mappings and slayer plugin --- .../src/main/java/net/runelite/client/game/ItemMapping.java | 3 ++- .../java/net/runelite/client/plugins/slayer/SlayerOverlay.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java index 82b71a5720..c0dc440d2e 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java @@ -214,7 +214,7 @@ public enum ItemMapping BLACK_MASK, BLACK_MASK_I, BLACK_MASK_1, BLACK_MASK_1_I, BLACK_MASK_2, BLACK_MASK_2_I, BLACK_MASK_3, BLACK_MASK_3_I, BLACK_MASK_4, BLACK_MASK_4_I, BLACK_MASK_5, BLACK_MASK_5_I, BLACK_MASK_6, BLACK_MASK_6_I, BLACK_MASK_7, BLACK_MASK_7_I, BLACK_MASK_8, BLACK_MASK_8_I, BLACK_MASK_9, BLACK_MASK_9_I, BLACK_MASK_10_I, SLAYER_HELMET, SLAYER_HELMET_I, BLACK_SLAYER_HELMET, BLACK_SLAYER_HELMET_I, PURPLE_SLAYER_HELMET, PURPLE_SLAYER_HELMET_I, RED_SLAYER_HELMET, RED_SLAYER_HELMET_I, - GREEN_SLAYER_HELMET, GREEN_SLAYER_HELMET_I, TURQUOISE_SLAYER_HELMET, TURQUOISE_SLAYER_HELMET_I, HYDRA_SLAYER_HELMET, HYDRA_SLAYER_HELMET_I), + GREEN_SLAYER_HELMET, GREEN_SLAYER_HELMET_I, TURQUOISE_SLAYER_HELMET, TURQUOISE_SLAYER_HELMET_I, TWISTED_SLAYER_HELMET, TWISTED_SLAYER_HELMET_I, HYDRA_SLAYER_HELMET, HYDRA_SLAYER_HELMET_I), // Pharaoh's Sceptres ITEM_PHARAOHS_SCEPTRE_1(PHARAOHS_SCEPTRE, PHARAOHS_SCEPTRE_1), @@ -232,6 +232,7 @@ public enum ItemMapping ITEM_BOTTOMLESS_COMPOST_BUCKET(BOTTOMLESS_COMPOST_BUCKET, BOTTOMLESS_COMPOST_BUCKET_22997), ITEM_BASILISK_JAW(BASILISK_JAW, NEITIZNOT_FACEGUARD), ITEM_HELM_OF_NEITIZNOT(HELM_OF_NEITIZNOT, NEITIZNOT_FACEGUARD), + ITEM_TWISTED_HORNS(TWISTED_HORNS, TWISTED_SLAYER_HELMET, TWISTED_SLAYER_HELMET_I), // Crystal items ITEM_CRYSTAL_TOOL_SEED(CRYSTAL_TOOL_SEED, CRYSTAL_AXE, CRYSTAL_AXE_INACTIVE, CRYSTAL_HARPOON, CRYSTAL_HARPOON_INACTIVE, CRYSTAL_PICKAXE, CRYSTAL_PICKAXE_INACTIVE), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerOverlay.java index 09da9f7ac4..4d70d82f53 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerOverlay.java @@ -62,6 +62,8 @@ class SlayerOverlay extends WidgetItemOverlay ItemID.RED_SLAYER_HELMET_I, ItemID.TURQUOISE_SLAYER_HELMET, ItemID.TURQUOISE_SLAYER_HELMET_I, + ItemID.TWISTED_SLAYER_HELMET, + ItemID.TWISTED_SLAYER_HELMET_I, ItemID.HYDRA_SLAYER_HELMET, ItemID.HYDRA_SLAYER_HELMET_I, ItemID.SLAYER_RING_ETERNAL,