From 34c685a82d73a906d18347c756db94a4cbb7e17a Mon Sep 17 00:00:00 2001 From: Max Weber Date: Tue, 27 Aug 2019 13:32:46 -0600 Subject: [PATCH 01/19] runelite-api: Add setAllWidgetsAreOpTargetable --- .../src/main/java/net/runelite/api/Client.java | 11 +++++++++++ .../src/main/java/net/runelite/api/MenuAction.java | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/runelite-api/src/main/java/net/runelite/api/Client.java b/runelite-api/src/main/java/net/runelite/api/Client.java index 56e2995e32..31e7c8afe1 100644 --- a/runelite-api/src/main/java/net/runelite/api/Client.java +++ b/runelite-api/src/main/java/net/runelite/api/Client.java @@ -38,6 +38,7 @@ import net.runelite.api.hooks.Callbacks; import net.runelite.api.hooks.DrawCallbacks; import net.runelite.api.vars.AccountType; import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetConfig; import net.runelite.api.widgets.WidgetInfo; import org.slf4j.Logger; @@ -1635,6 +1636,11 @@ public interface Client extends GameEngine */ int getIf1DraggedItemIndex(); + /** + * Is a widget is in target mode? + */ + boolean getSpellSelected(); + /** * Sets if a widget is in target mode */ @@ -1660,4 +1666,9 @@ public interface Client extends GameEngine * Returns the max item index + 1 from cache */ int getItemCount(); + + /** + * Makes all widgets behave as if they are {@link WidgetConfig#WIDGET_USE_TARGET} + */ + void setAllWidgetsAreOpTargetable(boolean value); } diff --git a/runelite-api/src/main/java/net/runelite/api/MenuAction.java b/runelite-api/src/main/java/net/runelite/api/MenuAction.java index cafbbe7706..688b18f141 100644 --- a/runelite-api/src/main/java/net/runelite/api/MenuAction.java +++ b/runelite-api/src/main/java/net/runelite/api/MenuAction.java @@ -230,6 +230,11 @@ public enum MenuAction */ WIDGET_DEFAULT(57), + /** + * Casting a spell / op target on a widget + */ + SPELL_CAST_ON_WIDGET(58), + /** * Menu action triggered by examining an object. */ From c6632af7bf2c21cac0e9e02a5c12d4bff85f589f Mon Sep 17 00:00:00 2001 From: Max Weber Date: Mon, 26 Aug 2019 18:46:28 -0600 Subject: [PATCH 02/19] runelite-client: Don't add our menu options in spell casting/target mode --- .../src/main/java/net/runelite/client/menus/MenuManager.java | 5 +++++ .../java/net/runelite/client/ui/overlay/OverlayRenderer.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java index 955c3ef0e5..863e58ea10 100644 --- a/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java +++ b/runelite-client/src/main/java/net/runelite/client/menus/MenuManager.java @@ -117,6 +117,11 @@ public class MenuManager @Subscribe public void onMenuEntryAdded(MenuEntryAdded event) { + if (client.getSpellSelected()) + { + return; + } + int widgetId = event.getActionParam1(); Collection options = managedMenuOptions.get(widgetId); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java index e0810cef00..81b405fe83 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java @@ -304,7 +304,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener graphics.setColor(previous); } - if (menuEntries == null && !client.isMenuOpen() && bounds.contains(mouse)) + if (menuEntries == null && !client.isMenuOpen() && !client.getSpellSelected() && bounds.contains(mouse)) { menuEntries = createRightClickMenuEntries(overlay); } From 33d233d9a59bf1f6be0760e770708860e5e1ae99 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Tue, 27 Aug 2019 19:46:52 -0600 Subject: [PATCH 03/19] WidgetInspector: Add widget picker --- .../main/java/net/runelite/api/SpriteID.java | 1 + .../plugins/devtools/DevToolsOverlay.java | 78 ----- .../plugins/devtools/WidgetInspector.java | 323 ++++++++++++++++-- .../devtools/WidgetInspectorOverlay.java | 132 +++++++ 4 files changed, 431 insertions(+), 103 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspectorOverlay.java diff --git a/runelite-api/src/main/java/net/runelite/api/SpriteID.java b/runelite-api/src/main/java/net/runelite/api/SpriteID.java index 35419da483..962089c146 100644 --- a/runelite-api/src/main/java/net/runelite/api/SpriteID.java +++ b/runelite-api/src/main/java/net/runelite/api/SpriteID.java @@ -1564,6 +1564,7 @@ public final class SpriteID public static final int MOBILE_FUNCTION_MODE_DISABLED = 1624; public static final int MOBILE_YELLOW_TOUCH_ANIMATION_1 = 1625; public static final int MOBILE_YELLOW_TOUCH_ANIMATION_2 = 1626; + public static final int MOBILE_FINGER_ON_INTERFACE = 1653; /* Unmapped: 1627~1701 */ public static final int BUTTON_FRIENDS = 1702; public static final int BUTTON_IGNORES = 1703; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevToolsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevToolsOverlay.java index 9bb7292dc3..457a86b766 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevToolsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/DevToolsOverlay.java @@ -36,8 +36,6 @@ import java.awt.geom.Rectangle2D; import java.util.List; import javax.inject.Inject; import javax.inject.Singleton; -import lombok.Getter; -import lombok.Setter; import net.runelite.api.Client; import net.runelite.api.Constants; import net.runelite.api.DecorativeObject; @@ -72,9 +70,6 @@ import net.runelite.client.ui.overlay.tooltip.TooltipManager; @Singleton class DevToolsOverlay extends Overlay { - private static final int ITEM_EMPTY = 6512; - private static final int ITEM_FILLED = 20594; - private static final Font FONT = FontManager.getRunescapeFont().deriveFont(Font.BOLD, 16); private static final Color RED = new Color(221, 44, 0); private static final Color GREEN = new Color(0, 200, 83); @@ -92,13 +87,6 @@ class DevToolsOverlay extends Overlay private final DevToolsPlugin plugin; private final TooltipManager toolTipManager; - @Setter - @Getter - private Widget widget; - - @Setter - private int itemIndex = -1; - @Inject private DevToolsOverlay(Client client, DevToolsPlugin plugin, TooltipManager toolTipManager) { @@ -145,8 +133,6 @@ class DevToolsOverlay extends Overlay renderGraphicsObjects(graphics); } - renderWidgets(graphics); - return null; } @@ -430,70 +416,6 @@ class DevToolsOverlay extends Overlay } } - private void renderWidgets(Graphics2D graphics) - { - if (widget == null || widget.isHidden()) - { - return; - } - - Rectangle childBounds = widget.getBounds(); - graphics.setColor(CYAN); - graphics.draw(childBounds); - - if (itemIndex == -1) - { - return; - } - - if (widget.getItemId() != ITEM_EMPTY - && widget.getItemId() != ITEM_FILLED) - { - Rectangle componentBounds = widget.getBounds(); - - graphics.setColor(ORANGE); - graphics.draw(componentBounds); - - renderWidgetText(graphics, componentBounds, widget.getItemId(), YELLOW); - } - - WidgetItem widgetItem = widget.getWidgetItem(itemIndex); - if (widgetItem == null - || widgetItem.getId() < 0 - || widgetItem.getId() == ITEM_EMPTY - || widgetItem.getId() == ITEM_FILLED) - { - return; - } - - Rectangle itemBounds = widgetItem.getCanvasBounds(); - - graphics.setColor(ORANGE); - graphics.draw(itemBounds); - - renderWidgetText(graphics, itemBounds, widgetItem.getId(), YELLOW); - } - - private void renderWidgetText(Graphics2D graphics, Rectangle bounds, int itemId, Color color) - { - if (itemId == -1) - { - return; - } - - String text = itemId + ""; - FontMetrics fm = graphics.getFontMetrics(); - Rectangle2D textBounds = fm.getStringBounds(text, graphics); - - int textX = (int) (bounds.getX() + (bounds.getWidth() / 2) - (textBounds.getWidth() / 2)); - int textY = (int) (bounds.getY() + (bounds.getHeight() / 2) + (textBounds.getHeight() / 2)); - - graphics.setColor(Color.BLACK); - graphics.drawString(text, textX + 1, textY + 1); - graphics.setColor(color); - graphics.drawString(text, textX, textY); - } - private void renderPlayerWireframe(Graphics2D graphics, Player player, Color color) { Polygon[] polys = player.getPolygons(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java index cea9a2b9c1..44839a52de 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java @@ -27,13 +27,20 @@ package net.runelite.client.plugins.devtools; import com.google.inject.Inject; +import com.google.inject.Provider; +import com.google.inject.Singleton; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Dimension; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.Collection; +import java.util.Comparator; +import java.util.Enumeration; import java.util.HashMap; import java.util.Map; +import java.util.Stack; +import java.util.stream.Stream; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; @@ -45,31 +52,68 @@ import javax.swing.JTree; import javax.swing.SwingUtilities; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; +import net.runelite.api.MenuAction; +import net.runelite.api.MenuEntry; +import net.runelite.api.SpriteID; import net.runelite.api.events.ConfigChanged; +import net.runelite.api.events.MenuEntryAdded; +import net.runelite.api.events.MenuOptionClicked; +import net.runelite.api.widgets.JavaScriptCallback; import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetConfig; import net.runelite.api.widgets.WidgetInfo; import net.runelite.api.widgets.WidgetItem; +import net.runelite.api.widgets.WidgetType; import net.runelite.client.callback.ClientThread; import net.runelite.client.eventbus.EventBus; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.ui.ClientUI; +import net.runelite.client.ui.overlay.OverlayManager; +import net.runelite.client.util.ColorUtil; @Slf4j +@Singleton class WidgetInspector extends JFrame { + private static final Map widgetIdMap = new HashMap<>(); + + static final Color SELECTED_WIDGET_COLOR = Color.CYAN; + private static final float SELECTED_WIDGET_HUE; + + static + { + float[] hsb = new float[3]; + Color.RGBtoHSB(SELECTED_WIDGET_COLOR.getRed(), SELECTED_WIDGET_COLOR.getGreen(), SELECTED_WIDGET_COLOR.getBlue(), hsb); + SELECTED_WIDGET_HUE = hsb[0]; + } + private final Client client; private final ClientThread clientThread; private final DevToolsConfig config; - private final DevToolsOverlay overlay; - private final DevToolsPlugin plugin; + private final Provider overlay; + private final OverlayManager overlayManager; private final JTree widgetTree; private final WidgetInfoTableModel infoTableModel; private final JCheckBox alwaysOnTop; + private final JCheckBox hideHidden; - private static final Map widgetIdMap = new HashMap<>(); + private DefaultMutableTreeNode root; + + @Getter + private Widget selectedWidget; + + @Getter + private int selectedItem; + + private Widget picker = null; + + @Getter + private boolean pickerSelected = false; @Inject private WidgetInspector( @@ -77,16 +121,17 @@ class WidgetInspector extends JFrame ClientThread clientThread, WidgetInfoTableModel infoTableModel, DevToolsConfig config, + DevToolsPlugin plugin, EventBus eventBus, - DevToolsOverlay overlay, - DevToolsPlugin plugin) + Provider overlay, + OverlayManager overlayManager) { this.client = client; this.clientThread = clientThread; this.infoTableModel = infoTableModel; this.config = config; this.overlay = overlay; - this.plugin = plugin; + this.overlayManager = overlayManager; eventBus.register(this); @@ -116,16 +161,12 @@ class WidgetInspector extends JFrame { WidgetTreeNode node = (WidgetTreeNode) selected; Widget widget = node.getWidget(); - overlay.setWidget(widget); - overlay.setItemIndex(widget.getItemId()); - refreshInfo(); - log.debug("Set widget to {} and item index to {}", widget, widget.getItemId()); + setSelectedWidget(widget, -1, false); } else if (selected instanceof WidgetItemNode) { WidgetItemNode node = (WidgetItemNode) selected; - overlay.setItemIndex(node.getWidgetItem().getIndex()); - log.debug("Set item index to {}", node.getWidgetItem().getIndex()); + setSelectedWidget(node.getWidgetItem().getWidget(), node.getWidgetItem().getIndex(), false); } }); @@ -151,15 +192,20 @@ class WidgetInspector extends JFrame onConfigChanged(null); bottomPanel.add(alwaysOnTop); + hideHidden = new JCheckBox("Hide hidden"); + hideHidden.setSelected(true); + hideHidden.addItemListener(ev -> refreshWidgets()); + bottomPanel.add(hideHidden); + final JButton revalidateWidget = new JButton("Revalidate"); revalidateWidget.addActionListener(ev -> clientThread.invokeLater(() -> { - if (overlay.getWidget() == null) + if (selectedWidget == null) { return; } - overlay.getWidget().revalidate(); + selectedWidget.revalidate(); })); bottomPanel.add(revalidateWidget); @@ -182,10 +228,13 @@ class WidgetInspector extends JFrame clientThread.invokeLater(() -> { Widget[] rootWidgets = client.getWidgetRoots(); - DefaultMutableTreeNode root = new DefaultMutableTreeNode(); + root = new DefaultMutableTreeNode(); - overlay.setWidget(null); - overlay.setItemIndex(-1); + Widget wasSelectedWidget = selectedWidget; + int wasSelectedItem = selectedItem; + + selectedWidget = null; + selectedItem = -1; for (Widget widget : rootWidgets) { @@ -198,17 +247,15 @@ class WidgetInspector extends JFrame SwingUtilities.invokeLater(() -> { - overlay.setWidget(null); - overlay.setItemIndex(-1); - refreshInfo(); widgetTree.setModel(new DefaultTreeModel(root)); + setSelectedWidget(wasSelectedWidget, wasSelectedItem, true); }); }); } private DefaultMutableTreeNode addWidget(String type, Widget widget) { - if (widget == null || widget.isHidden()) + if (widget == null || (hideHidden.isSelected() && widget.isHidden())) { return null; } @@ -271,9 +318,70 @@ class WidgetInspector extends JFrame return node; } - private void refreshInfo() + private void setSelectedWidget(Widget widget, int item, boolean updateTree) { - infoTableModel.setWidget(overlay.getWidget()); + infoTableModel.setWidget(widget); + + if (this.selectedWidget == widget && this.selectedItem == item) + { + return; + } + + this.selectedWidget = widget; + this.selectedItem = item; + + if (root == null || !updateTree) + { + return; + } + + clientThread.invoke(() -> + { + Stack treePath = new Stack<>(); + for (Widget w = widget; w != null; w = w.getParent()) + { + treePath.push(w); + } + + DefaultMutableTreeNode node = root; + deeper: + for (; !treePath.empty(); ) + { + Widget w = treePath.pop(); + for (Enumeration it = node.children(); it.hasMoreElements(); ) + { + WidgetTreeNode inner = (WidgetTreeNode) it.nextElement(); + if (inner.getWidget().getId() == w.getId() && inner.getWidget().getIndex() == w.getIndex()) + { + node = inner; + continue deeper; + } + } + } + if (selectedItem != -1) + { + for (Enumeration it = node.children(); it.hasMoreElements(); ) + { + Object wiw = it.nextElement(); + if (wiw instanceof WidgetItemNode) + { + WidgetItemNode inner = (WidgetItemNode) wiw; + if (inner.getWidgetItem().getIndex() == selectedItem) + { + node = inner; + break; + } + } + } + } + + final DefaultMutableTreeNode fnode = node; + SwingUtilities.invokeLater(() -> + { + widgetTree.getSelectionModel().clearSelection(); + widgetTree.getSelectionModel().addSelectionPath(new TreePath(fnode.getPath())); + }); + }); } static WidgetInfo getWidgetInfo(int packedId) @@ -297,12 +405,177 @@ class WidgetInspector extends JFrame setVisible(true); toFront(); repaint(); + overlayManager.add(this.overlay.get()); + clientThread.invokeLater(this::addPickerWidget); } public void close() { - overlay.setWidget(null); - overlay.setItemIndex(-1); + overlayManager.remove(this.overlay.get()); + clientThread.invokeLater(this::removePickerWidget); + setSelectedWidget(null, -1, false); setVisible(false); } + + private void removePickerWidget() + { + if (picker == null) + { + return; + } + + Widget parent = picker.getParent(); + if (parent == null) + { + return; + } + + Widget[] children = parent.getChildren(); + if (children == null || children.length <= picker.getIndex() || children[picker.getIndex()] != picker) + { + return; + } + + children[picker.getIndex()] = null; + } + + private void addPickerWidget() + { + removePickerWidget(); + + int x = 10, y = 2; + Widget parent = client.getWidget(WidgetInfo.MINIMAP_ORBS); + if (parent == null) + { + Widget[] roots = client.getWidgetRoots(); + + parent = Stream.of(roots) + .filter(w -> w.getType() == WidgetType.LAYER && w.getContentType() == 0 && !w.isSelfHidden()) + .sorted(Comparator.comparing((Widget w) -> w.getRelativeX() + w.getRelativeY()) + .reversed() + .thenComparing(Widget::getId) + .reversed()) + .findFirst().get(); + x = 4; + y = 4; + } + + picker = parent.createChild(-1, WidgetType.GRAPHIC); + + log.info("Picker is {}.{} [{}]", WidgetInfo.TO_GROUP(picker.getId()), WidgetInfo.TO_CHILD(picker.getId()), picker.getIndex()); + + picker.setSpriteId(SpriteID.MOBILE_FINGER_ON_INTERFACE); + picker.setOriginalWidth(15); + picker.setOriginalHeight(17); + picker.setOriginalX(x); + picker.setOriginalY(y); + picker.revalidate(); + picker.setTargetVerb("Select"); + picker.setName("Pick"); + picker.setClickMask(WidgetConfig.USE_WIDGET | WidgetConfig.USE_ITEM); + picker.setNoClickThrough(true); + picker.setOnTargetEnterListener((JavaScriptCallback) ev -> + { + pickerSelected = true; + picker.setOpacity(30); + client.setAllWidgetsAreOpTargetable(true); + }); + picker.setOnTargetLeaveListener((JavaScriptCallback) ev -> onPickerDeselect()); + } + + private void onPickerDeselect() + { + client.setAllWidgetsAreOpTargetable(false); + picker.setOpacity(0); + pickerSelected = false; + } + + @Subscribe + private void onMenuOptionClicked(MenuOptionClicked ev) + { + if (!pickerSelected) + { + return; + } + + onPickerDeselect(); + client.setSpellSelected(false); + ev.consume(); + + Object target = getWidgetOrWidgetItemForMenuOption(ev.getMenuAction().getId(), ev.getActionParam(), ev.getWidgetId()); + if (target == null) + { + return; + } + if (target instanceof WidgetItem) + { + WidgetItem iw = (WidgetItem) target; + setSelectedWidget(iw.getWidget(), iw.getIndex(), true); + } + else + { + setSelectedWidget((Widget) target, -1, true); + } + } + + @Subscribe + private void onMenuEntryAdded(MenuEntryAdded event) + { + if (!pickerSelected) + { + return; + } + + MenuEntry[] menuEntries = client.getMenuEntries(); + + for (int i = 0; i < menuEntries.length; i++) + { + MenuEntry entry = menuEntries[i]; + if (entry.getType() != MenuAction.ITEM_USE_ON_WIDGET.getId() + && entry.getType() != MenuAction.SPELL_CAST_ON_WIDGET.getId()) + { + continue; + } + String name = WidgetInfo.TO_GROUP(entry.getParam1()) + "." + WidgetInfo.TO_CHILD(entry.getParam1()); + + if (entry.getParam0() != -1) + { + name += " [" + entry.getParam0() + "]"; + } + + Color color = colorForWidget(i, menuEntries.length); + + entry.setTarget(ColorUtil.wrapWithColorTag(name, color)); + } + + client.setMenuEntries(menuEntries); + } + + Color colorForWidget(int index, int length) + { + float h = SELECTED_WIDGET_HUE + .1f + (.8f / length) * index; + + return Color.getHSBColor(h, 1, 1); + } + + Object getWidgetOrWidgetItemForMenuOption(int type, int param0, int param1) + { + if (type == MenuAction.SPELL_CAST_ON_WIDGET.getId()) + { + Widget w = client.getWidget(WidgetInfo.TO_GROUP(param1), WidgetInfo.TO_CHILD(param1)); + if (param0 != -1) + { + w = w.getChild(param0); + } + + return w; + } + else if (type == MenuAction.ITEM_USE_ON_WIDGET.getId()) + { + Widget w = client.getWidget(WidgetInfo.TO_GROUP(param1), WidgetInfo.TO_CHILD(param1)); + return w.getWidgetItem(param0); + } + + return null; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspectorOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspectorOverlay.java new file mode 100644 index 0000000000..c0ceab94a8 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspectorOverlay.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018 Abex + * Copyright (c) 2017, Kronos + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.devtools; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FontMetrics; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.geom.Rectangle2D; +import javax.inject.Inject; +import javax.inject.Singleton; +import net.runelite.api.Client; +import net.runelite.api.MenuEntry; +import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetItem; +import net.runelite.client.ui.overlay.Overlay; +import net.runelite.client.ui.overlay.OverlayLayer; +import net.runelite.client.ui.overlay.OverlayPosition; +import net.runelite.client.ui.overlay.OverlayPriority; + +@Singleton +public class WidgetInspectorOverlay extends Overlay +{ + private final Client client; + private final WidgetInspector inspector; + + @Inject + public WidgetInspectorOverlay( + Client client, + WidgetInspector inspector + ) + { + this.client = client; + this.inspector = inspector; + + setPosition(OverlayPosition.DYNAMIC); + setLayer(OverlayLayer.ABOVE_WIDGETS); + setPriority(OverlayPriority.HIGHEST); + } + + @Override + public Dimension render(Graphics2D g) + { + Widget w = inspector.getSelectedWidget(); + if (w != null) + { + Object wiw = w; + if (inspector.getSelectedItem() != -1) + { + wiw = w.getWidgetItem(inspector.getSelectedItem()); + } + + renderWiw(g, wiw, WidgetInspector.SELECTED_WIDGET_COLOR); + } + + if (inspector.isPickerSelected()) + { + boolean menuOpen = client.isMenuOpen(); + + MenuEntry[] entries = client.getMenuEntries(); + for (int i = menuOpen ? 0 : entries.length - 1; i < entries.length; i++) + { + MenuEntry e = entries[i]; + + Object wiw = inspector.getWidgetOrWidgetItemForMenuOption(e.getType(), e.getParam0(), e.getParam1()); + if (wiw == null) + { + continue; + } + + Color color = inspector.colorForWidget(i, entries.length); + renderWiw(g, wiw, color); + } + } + + return null; + } + + private void renderWiw(Graphics2D g, Object wiw, Color color) + { + g.setColor(color); + + if (wiw instanceof WidgetItem) + { + WidgetItem wi = (WidgetItem) wiw; + Rectangle bounds = wi.getCanvasBounds(); + g.draw(bounds); + + String text = wi.getId() + ""; + FontMetrics fm = g.getFontMetrics(); + Rectangle2D textBounds = fm.getStringBounds(text, g); + + int textX = (int) (bounds.getX() + (bounds.getWidth() / 2) - (textBounds.getWidth() / 2)); + int textY = (int) (bounds.getY() + (bounds.getHeight() / 2) + (textBounds.getHeight() / 2)); + + g.setColor(Color.BLACK); + g.drawString(text, textX + 1, textY + 1); + g.setColor(Color.ORANGE); + g.drawString(text, textX, textY); + } + else + { + Widget w = (Widget) wiw; + g.draw(w.getBounds()); + } + } +} From b78bd73e9199bb36c5a6ba1e15f0004cf68b3d0c Mon Sep 17 00:00:00 2001 From: beaumitch Date: Wed, 18 Sep 2019 11:02:05 -0400 Subject: [PATCH 04/19] agility plugin: add laps to goal to overlay Add configuration option for laps til level --- .../client/plugins/agility/AgilityConfig.java | 38 +++++++++++++++---- .../plugins/agility/AgilitySession.java | 5 +++ .../plugins/agility/LapCounterOverlay.java | 10 ++++- 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java index 655d0245a8..85608f9dbf 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java @@ -54,11 +54,33 @@ public interface AgilityConfig extends Config return 5; } + @ConfigItem( + keyName = "lapsToLevel", + name = "Show Laps Until Level", + description = "Show number of laps remaining until next level is reached.", + position = 3 + ) + default boolean lapsToLevel() + { + return true; + } + + @ConfigItem( + keyName = "lapsToGoal", + name = "Show Laps Until Goal", + description = "Show number of laps remaining until experience tracker goal is reached", + position = 4 + ) + default boolean lapsToGoal() + { + return false; + } + @ConfigItem( keyName = "overlayColor", name = "Overlay Color", description = "Color of Agility overlay", - position = 3 + position = 5 ) default Color getOverlayColor() { @@ -69,7 +91,7 @@ public interface AgilityConfig extends Config keyName = "highlightMarks", name = "Highlight Marks of Grace", description = "Enable/disable the highlighting of retrievable Marks of Grace", - position = 4 + position = 6 ) default boolean highlightMarks() { @@ -80,7 +102,7 @@ public interface AgilityConfig extends Config keyName = "markHighlight", name = "Mark Highlight Color", description = "Color of highlighted Marks of Grace", - position = 5 + position = 7 ) default Color getMarkColor() { @@ -91,7 +113,7 @@ public interface AgilityConfig extends Config keyName = "highlightShortcuts", name = "Highlight Agility Shortcuts", description = "Enable/disable the highlighting of Agility shortcuts", - position = 6 + position = 8 ) default boolean highlightShortcuts() { @@ -102,7 +124,7 @@ public interface AgilityConfig extends Config keyName = "trapOverlay", name = "Show Trap Overlay", description = "Enable/disable the highlighting of traps on Agility courses", - position = 7 + position = 9 ) default boolean showTrapOverlay() { @@ -113,7 +135,7 @@ public interface AgilityConfig extends Config keyName = "trapHighlight", name = "Trap Overlay Color", description = "Color of Agility trap overlay", - position = 8 + position = 10 ) default Color getTrapColor() { @@ -124,7 +146,7 @@ public interface AgilityConfig extends Config keyName = "agilityArenaNotifier", name = "Agility Arena notifier", description = "Notify on ticket location change in Agility Arena", - position = 9 + position = 11 ) default boolean notifyAgilityArena() { @@ -135,7 +157,7 @@ public interface AgilityConfig extends Config keyName = "agilityArenaTimer", name = "Agility Arena timer", description = "Configures whether Agility Arena timer is displayed", - position = 10 + position = 12 ) default boolean showAgilityArenaTimer() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilitySession.java b/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilitySession.java index a8ba2937ca..72e9a0dd07 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilitySession.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilitySession.java @@ -30,6 +30,7 @@ import lombok.Setter; import net.runelite.api.Client; import net.runelite.api.Experience; import net.runelite.api.Skill; +import net.runelite.api.VarPlayer; @Getter @Setter @@ -39,6 +40,7 @@ class AgilitySession private Instant lastLapCompleted; private int totalLaps; private int lapsTillLevel; + private int lapsTillGoal; AgilitySession(Courses course) { @@ -61,11 +63,14 @@ class AgilitySession } while (remainingXp < 0); lapsTillLevel = remainingXp > 0 ? (int) Math.ceil(remainingXp / course.getTotalXp()) : 0; + int goalRemainingXp = client.getVar(VarPlayer.AGILITY_GOAL_END) - currentExp; + lapsTillGoal = goalRemainingXp > 0 ? (int) Math.ceil(goalRemainingXp / course.getTotalXp()) : 0; } void resetLapCount() { totalLaps = 0; lapsTillLevel = 0; + lapsTillGoal = 0; } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/agility/LapCounterOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/agility/LapCounterOverlay.java index b6da44d76a..a53f6bac4e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/agility/LapCounterOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/agility/LapCounterOverlay.java @@ -85,7 +85,7 @@ class LapCounterOverlay extends Overlay .right(Integer.toString(session.getTotalLaps())) .build()); - if (session.getLapsTillLevel() > 0) + if (config.lapsToLevel() && session.getLapsTillLevel() > 0) { panelComponent.getChildren().add(LineComponent.builder() .left("Laps until level:") @@ -93,6 +93,14 @@ class LapCounterOverlay extends Overlay .build()); } + if (config.lapsToGoal() && session.getLapsTillGoal() > 0) + { + panelComponent.getChildren().add(LineComponent.builder() + .left("Laps until goal:") + .right(Integer.toString(session.getLapsTillGoal())) + .build()); + } + return panelComponent.render(graphics); } } From 10b55604fced843782489cfb2d5b2b7e35657d1f Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 17 Sep 2019 15:02:10 -0400 Subject: [PATCH 05/19] opponent info: add show opponents in menu --- .../opponentinfo/OpponentInfoConfig.java | 11 +++++++ .../opponentinfo/OpponentInfoPlugin.java | 29 +++++++++++++++++++ 2 files changed, 40 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 07a84629c8..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 @@ -63,4 +63,15 @@ public interface OpponentInfoConfig extends Config { return true; } + + @ConfigItem( + keyName = "showOpponentsInMenu", + name = "Show opponents in menu", + description = "Marks opponents names in the menu which you are attacking or are attacking you (NPC only)", + position = 3 + ) + default boolean showOpponentsInMenu() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoPlugin.java index 6e36665a8b..e038e81ab2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/opponentinfo/OpponentInfoPlugin.java @@ -35,10 +35,14 @@ import lombok.Getter; import net.runelite.api.Actor; import net.runelite.api.Client; import net.runelite.api.GameState; +import net.runelite.api.MenuAction; +import net.runelite.api.MenuEntry; +import net.runelite.api.NPC; import net.runelite.api.WorldType; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.InteractingChanged; +import net.runelite.api.events.MenuEntryAdded; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.plugins.Plugin; @@ -159,4 +163,29 @@ public class OpponentInfoPlugin extends Plugin } } } + + @Subscribe + public void onMenuEntryAdded(MenuEntryAdded menuEntryAdded) + { + if (menuEntryAdded.getType() != MenuAction.NPC_SECOND_OPTION.getId() + || !menuEntryAdded.getOption().equals("Attack") + || !config.showOpponentsInMenu()) + { + return; + } + + int npcIndex = menuEntryAdded.getIdentifier(); + NPC npc = client.getCachedNPCs()[npcIndex]; + if (npc == null) + { + return; + } + + if (npc.getInteracting() == client.getLocalPlayer() || lastOpponent == npc) + { + MenuEntry[] menuEntries = client.getMenuEntries(); + menuEntries[menuEntries.length - 1].setTarget("*" + menuEntryAdded.getTarget()); + client.setMenuEntries(menuEntries); + } + } } From e842c5c90e9ee35e6a5c4a49e2815f5ef2b50a24 Mon Sep 17 00:00:00 2001 From: Hudson Shykowski Date: Thu, 19 Sep 2019 21:49:42 -0600 Subject: [PATCH 06/19] Add Forthos Dungeon monsters to the NPC health list --- runelite-client/src/main/resources/npc_health.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/resources/npc_health.json b/runelite-client/src/main/resources/npc_health.json index 4944167e6f..6f39e21f79 100644 --- a/runelite-client/src/main/resources/npc_health.json +++ b/runelite-client/src/main/resources/npc_health.json @@ -1157,5 +1157,8 @@ "Wyrm_99": 130, "Drake_192": 250, "Hydra_194": 300, - "Alchemical Hydra_426": 1100 + "Alchemical Hydra_426": 1100, + "Undead Druid_105": 140, + "Temple Spider_75": 70, + "Sarachnis_318": 400 } From e0af554c698ea2029f8aa5aa6bff64ed55328890 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 18 Sep 2019 08:30:17 -0400 Subject: [PATCH 07/19] hooks: ignore npc update immediately after login The npc update after login isn't a game tick and happens prior to most state syncing --- .../java/net/runelite/client/RuneLite.java | 5 +++ .../net/runelite/client/callback/Hooks.java | 35 ++++++++++++++++--- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLite.java b/runelite-client/src/main/java/net/runelite/client/RuneLite.java index 0decdb3c48..61e155b3e6 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -46,6 +46,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.client.account.SessionManager; +import net.runelite.client.callback.Hooks; import net.runelite.client.chat.ChatMessageManager; import net.runelite.client.chat.CommandManager; import net.runelite.client.config.ConfigManager; @@ -151,6 +152,9 @@ public class RuneLite @Inject private Provider chatboxPanelManager; + @Inject + private Provider hooks; + @Inject @Nullable private Client client; @@ -322,6 +326,7 @@ public class RuneLite eventBus.register(commandManager.get()); eventBus.register(lootManager.get()); eventBus.register(chatboxPanelManager.get()); + eventBus.register(hooks.get()); // Add core overlays WidgetOverlay.createOverlays(client).forEach(overlayManager::add); diff --git a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java index 4365d045f6..ca2053e446 100644 --- a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java +++ b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java @@ -50,6 +50,7 @@ import net.runelite.api.Renderable; import net.runelite.api.WorldMapManager; import net.runelite.api.events.BeforeMenuRender; import net.runelite.api.events.BeforeRender; +import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.hooks.Callbacks; import net.runelite.api.hooks.DrawCallbacks; @@ -60,6 +61,7 @@ import net.runelite.client.Notifier; import net.runelite.client.RuneLite; import net.runelite.client.chat.ChatMessageManager; import net.runelite.client.eventbus.EventBus; +import net.runelite.client.eventbus.Subscribe; import net.runelite.client.input.KeyManager; import net.runelite.client.input.MouseManager; import net.runelite.client.task.Scheduler; @@ -128,6 +130,7 @@ public class Hooks implements Callbacks private Graphics2D stretchedGraphics; private long lastCheck; + private boolean ignoreNextNpcUpdate; private boolean shouldProcessGameTick; private static MainBufferProvider lastMainBufferProvider; @@ -463,15 +466,37 @@ public class Hooks implements Callbacks overlayManager.getItemWidgets().clear(); } + @Subscribe + public void onGameStateChanged(GameStateChanged gameStateChanged) + { + switch (gameStateChanged.getGameState()) + { + case LOGGING_IN: + case HOPPING: + ignoreNextNpcUpdate = true; + } + } + @Override public void updateNpcs() { - // The NPC update event seem to run every server tick, - // but having the game tick event after all packets - // have been processed is typically more useful. - shouldProcessGameTick = true; + if (ignoreNextNpcUpdate) + { + // After logging in an NPC update happens outside of the normal game tick, which + // is sent prior to skills and vars being bursted, so ignore it. + ignoreNextNpcUpdate = false; + log.debug("Skipping login updateNpc"); + } + else + { + // The NPC update event seem to run every server tick, + // but having the game tick event after all packets + // have been processed is typically more useful. + shouldProcessGameTick = true; + } + // Replay deferred events, otherwise if two npc - // update packets get processed in one frame, a + // update packets get processed in one client tick, a // despawn event could be published prior to the // spawn event, which is deferred deferredEventBus.replay(); From 1705fa642c0bd859927f92f8af78c984a538e226 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 21 Sep 2019 12:40:20 -0400 Subject: [PATCH 08/19] api: add sound volume accessors and vars --- .../main/java/net/runelite/api/Client.java | 36 +++++++++++++++++++ .../main/java/net/runelite/api/VarPlayer.java | 6 +++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Client.java b/runelite-api/src/main/java/net/runelite/api/Client.java index 56e2995e32..cef172aa96 100644 --- a/runelite-api/src/main/java/net/runelite/api/Client.java +++ b/runelite-api/src/main/java/net/runelite/api/Client.java @@ -944,6 +944,42 @@ public interface Client extends GameEngine */ List getGraphicsObjects(); + /** + * Gets the music volume + * @return volume 0-255 inclusive + */ + int getMusicVolume(); + + /** + * Sets the music volume + * @param volume 0-255 inclusive + */ + void setMusicVolume(int volume); + + /** + * Gets the sound effect volume + * @return volume 0-127 inclusive + */ + int getSoundEffectVolume(); + + /** + * Sets the sound effect volume + * @param volume 0-127 inclusive + */ + void setSoundEffectVolume(int volume); + + /** + * Gets the area sound effect volume + * @return volume 0-127 inclusive + */ + int getAreaSoundEffectVolume(); + + /** + * Sets the area sound effect volume + * @param volume 0-127 inclusive + */ + void setAreaSoundEffectVolume(int volume); + /** * Play a sound effect at the player's current location. This is how UI, * and player-generated (e.g. mining, woodcutting) sound effects are diff --git a/runelite-api/src/main/java/net/runelite/api/VarPlayer.java b/runelite-api/src/main/java/net/runelite/api/VarPlayer.java index 62489df3f0..9ae457c29e 100644 --- a/runelite-api/src/main/java/net/runelite/api/VarPlayer.java +++ b/runelite-api/src/main/java/net/runelite/api/VarPlayer.java @@ -162,7 +162,11 @@ public enum VarPlayer MUSIC_TRACKS_UNLOCKED_16(1009), MUSIC_TRACKS_UNLOCKED_17(1338), MUSIC_TRACKS_UNLOCKED_18(1681), - MUSIC_TRACKS_UNLOCKED_19(2065); + MUSIC_TRACKS_UNLOCKED_19(2065), + + MUSIC_VOLUME(168), + SOUND_EFFECT_VOLUME(169), + AREA_EFFECT_VOLUME(872); private final int id; } From 276a278461edc13296f632b4bb9df51e31f41c0a Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 23 Sep 2019 10:54:26 -0400 Subject: [PATCH 09/19] api: add volume changed event --- .../runelite/api/events/VolumeChanged.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 runelite-api/src/main/java/net/runelite/api/events/VolumeChanged.java diff --git a/runelite-api/src/main/java/net/runelite/api/events/VolumeChanged.java b/runelite-api/src/main/java/net/runelite/api/events/VolumeChanged.java new file mode 100644 index 0000000000..8af4ee481b --- /dev/null +++ b/runelite-api/src/main/java/net/runelite/api/events/VolumeChanged.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2019, Adam + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.api.events; + +import lombok.Value; + +@Value +public class VolumeChanged +{ + public enum Type + { + MUSIC, + EFFECTS, + AREA + } + + private final Type type; +} From 6fc270dfc2c2cdeb024242541391c1652d2f3064 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 21 Sep 2019 11:25:23 -0400 Subject: [PATCH 10/19] music list plugin: rename to music plugin --- .../MusicListPlugin.java => music/MusicPlugin.java} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename runelite-client/src/main/java/net/runelite/client/plugins/{musiclist/MusicListPlugin.java => music/MusicPlugin.java} (98%) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/musiclist/MusicListPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java similarity index 98% rename from runelite-client/src/main/java/net/runelite/client/plugins/musiclist/MusicListPlugin.java rename to runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java index ab38b515f9..17284fe85f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/musiclist/MusicListPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.client.plugins.musiclist; +package net.runelite.client.plugins.music; import java.util.Arrays; import java.util.Collection; @@ -54,10 +54,10 @@ import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; @PluginDescriptor( - name = "Music List", + name = "Music", description = "Adds search and filter for the music list" ) -public class MusicListPlugin extends Plugin +public class MusicPlugin extends Plugin { @Inject private Client client; From 0145582b4134bf16f36455ead0d440d971f4ac80 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 21 Sep 2019 12:57:56 -0400 Subject: [PATCH 11/19] music plugin: add sound volume overrides --- .../client/plugins/music/MusicConfig.java | 79 +++++++++++++++++++ .../client/plugins/music/MusicPlugin.java | 63 ++++++++++++++- 2 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java new file mode 100644 index 0000000000..20b50545d0 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicConfig.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2019, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.music; + +import net.runelite.client.config.Config; +import net.runelite.client.config.ConfigGroup; +import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.Range; + +@ConfigGroup("music") +public interface MusicConfig extends Config +{ + @ConfigItem( + keyName = "musicVolume", + name = "Music Volume", + description = "Overrides music volume in game with more granular control", + position = 1 + ) + @Range( + min = 0, + max = 255 + ) + default int getMusicVolume() + { + return 0; + } + + @ConfigItem( + keyName = "soundEffectVolume", + name = "Sound Effect Volume", + description = "Overrides the sound effect volume in game with more granular control", + position = 2 + ) + @Range( + min = 0, + max = 127 + ) + default int getSoundEffectVolume() + { + return 0; + } + + @ConfigItem( + keyName = "areaSoundEffectVolume", + name = "Area Sound Effect Volume", + description = "Overrides the area sound effect volume in game with more granular control", + position = 3 + ) + @Range( + min = 0, + max = 127 + ) + default int getAreaSoundEffectVolume() + { + return 0; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java index 17284fe85f..80ef0c22e3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2019, Anthony Chen + * Copyright (c) 2019, Adam * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,6 +25,7 @@ */ package net.runelite.client.plugins.music; +import com.google.inject.Provides; import java.util.Arrays; import java.util.Collection; import java.util.Comparator; @@ -37,8 +39,10 @@ import net.runelite.api.ScriptID; import net.runelite.api.SoundEffectID; import net.runelite.api.SpriteID; import net.runelite.api.VarClientInt; +import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.VarClientIntChanged; +import net.runelite.api.events.VolumeChanged; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.widgets.JavaScriptCallback; import net.runelite.api.widgets.Widget; @@ -47,6 +51,7 @@ import net.runelite.api.widgets.WidgetInfo; import net.runelite.api.widgets.WidgetPositionMode; import net.runelite.api.widgets.WidgetType; import net.runelite.client.callback.ClientThread; +import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.game.chatbox.ChatboxPanelManager; import net.runelite.client.game.chatbox.ChatboxTextInput; @@ -55,7 +60,7 @@ import net.runelite.client.plugins.PluginDescriptor; @PluginDescriptor( name = "Music", - description = "Adds search and filter for the music list" + description = "Adds search and filter for the music list, and additional volume control" ) public class MusicPlugin extends Plugin { @@ -65,6 +70,9 @@ public class MusicPlugin extends Plugin @Inject private ClientThread clientThread; + @Inject + private MusicConfig musicConfig; + @Inject private ChatboxPanelManager chatboxPanelManager; @@ -77,10 +85,17 @@ public class MusicPlugin extends Plugin private MusicState currentMusicFilter = MusicState.ALL; + private int lastMusicVolume; + private int lastEffectVolume; + private int lastAreaEffectVolume; + @Override protected void startUp() { + lastMusicVolume = lastEffectVolume = lastAreaEffectVolume = -1; + clientThread.invoke(this::addMusicButtons); + clientThread.invoke(this::applyMusicVolumeConfig); } @Override @@ -95,6 +110,12 @@ public class MusicPlugin extends Plugin tracks = null; } + @Provides + MusicConfig getConfig(ConfigManager configManager) + { + return configManager.getConfig(MusicConfig.class); + } + @Subscribe public void onGameStateChanged(GameStateChanged gameStateChanged) { @@ -167,6 +188,46 @@ public class MusicPlugin extends Plugin } } + @Subscribe + public void onVolumeChanged(VolumeChanged volumeChanged) + { + applyMusicVolumeConfig(); + } + + @Subscribe + public void onConfigChanged(ConfigChanged configChanged) + { + if (configChanged.getGroup().equals("music")) + { + clientThread.invokeLater(this::applyMusicVolumeConfig); + } + } + + private void applyMusicVolumeConfig() + { + int musicVolume = musicConfig.getMusicVolume(); + // Set the volume if it is >0, or if it was >0 and is now going back to 0 + if (musicVolume > 0 || lastMusicVolume > 0) + { + client.setMusicVolume(musicVolume); + lastMusicVolume = musicVolume; + } + + int soundEffectVolume = musicConfig.getSoundEffectVolume(); + if (soundEffectVolume > 0 || lastEffectVolume > 0) + { + client.setSoundEffectVolume(soundEffectVolume); + lastEffectVolume = soundEffectVolume; + } + + int areaSoundEffectVolume = musicConfig.getAreaSoundEffectVolume(); + if (areaSoundEffectVolume > 0 || lastAreaEffectVolume > 0) + { + client.setAreaSoundEffectVolume(areaSoundEffectVolume); + lastAreaEffectVolume = areaSoundEffectVolume; + } + } + private boolean isOnMusicTab() { return client.getVar(VarClientInt.INVENTORY_TAB) == 13; From 28472435255cc18c78c662206e108c296dfba364 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Thu, 26 Sep 2019 10:36:03 +0000 Subject: [PATCH 12/19] Update 184 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ac957076d..00f448daab 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ true true - 183 + 184 From c1d48488301eb1b4c38c5f8324391c2a744e623c Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Thu, 26 Sep 2019 10:58:35 +0000 Subject: [PATCH 13/19] [maven-release-plugin] prepare release runelite-parent-1.5.34 --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- protocol-api/pom.xml | 2 +- protocol/pom.xml | 2 +- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index 0975d9574e..c641f65788 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index ac9f061f94..0856abb59c 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 51686ecba3..09a306eb41 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 cache diff --git a/http-api/pom.xml b/http-api/pom.xml index fe6dbf04b5..7a29dc623b 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index 394944917a..3051f96392 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 Web Service diff --git a/pom.xml b/pom.xml index 00f448daab..b3cc9716f3 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 pom RuneLite @@ -59,7 +59,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - HEAD + runelite-parent-1.5.34 diff --git a/protocol-api/pom.xml b/protocol-api/pom.xml index 753d6cd5a5..fc07db823b 100644 --- a/protocol-api/pom.xml +++ b/protocol-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 protocol-api diff --git a/protocol/pom.xml b/protocol/pom.xml index d3e17b01d9..bedba8efee 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 protocol diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index f09c046a63..7034d56275 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 11fa7d6638..7ba2afc3dc 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 9193373951..26a8058b44 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34-SNAPSHOT + 1.5.34 script-assembler-plugin From 6547478c07ae5d0574b8f3fa6017611cf02bf666 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Thu, 26 Sep 2019 10:58:41 +0000 Subject: [PATCH 14/19] [maven-release-plugin] prepare for next development iteration --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- protocol-api/pom.xml | 2 +- protocol/pom.xml | 2 +- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index c641f65788..88d32c2985 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index 0856abb59c..7d42489f5b 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 09a306eb41..77756e056c 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 7a29dc623b..00ce6f4808 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index 3051f96392..3d129ddac7 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT Web Service diff --git a/pom.xml b/pom.xml index b3cc9716f3..b41e6948c1 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT pom RuneLite @@ -59,7 +59,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - runelite-parent-1.5.34 + HEAD diff --git a/protocol-api/pom.xml b/protocol-api/pom.xml index fc07db823b..f54c525380 100644 --- a/protocol-api/pom.xml +++ b/protocol-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT protocol-api diff --git a/protocol/pom.xml b/protocol/pom.xml index bedba8efee..84c404c3f5 100644 --- a/protocol/pom.xml +++ b/protocol/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT protocol diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 7034d56275..bc24d72ca6 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 7ba2afc3dc..70adbefb09 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 26a8058b44..6a73a3a31b 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.5.34 + 1.5.35-SNAPSHOT script-assembler-plugin From 721bc9421667cb0dff4108186d89ebf72f15a609 Mon Sep 17 00:00:00 2001 From: Derek Johns Date: Fri, 27 Sep 2019 07:19:59 -0500 Subject: [PATCH 15/19] clues: add "may require 20gp" to Gu'Tanoth coord clue help text --- .../client/plugins/cluescrolls/clues/CoordinateClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 55735a3767..4aa3888d13 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 @@ -94,7 +94,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati .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.") + .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.") From 35a68354810bb89853eaf74917f8f7ac82b828e7 Mon Sep 17 00:00:00 2001 From: Daniel Bolink Date: Fri, 27 Sep 2019 09:44:42 -0700 Subject: [PATCH 16/19] clues: add crystal pickaxe to soul altar emote clue --- .../runelite/client/plugins/cluescrolls/clues/EmoteClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7231020f74..cb27e08052 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 @@ -152,7 +152,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Slap your head in the centre of the Kourend catacombs. Beware of double agents! Equip the arclight and the amulet of the damned.", "Kourend catacombs", CENTRE_OF_THE_CATACOMBS_OF_KOUREND, new WorldPoint(1663, 10045, 0), SLAP_HEAD, item(ARCLIGHT), any("Amulet of the damned", item(AMULET_OF_THE_DAMNED), item(AMULET_OF_THE_DAMNED_FULL))), new EmoteClue("Spin at the crossroads north of Rimmington. Equip a green gnome hat, cream gnome top and leather chaps.", "Rimmington", ROAD_JUNCTION_NORTH_OF_RIMMINGTON, new WorldPoint(2981, 3276, 0), SPIN, item(GREEN_HAT), item(CREAM_ROBE_TOP), item(LEATHER_CHAPS)), new EmoteClue("Spin in Draynor Manor by the fountain. Equip an iron platebody, studded leather chaps and a bronze full helmet.", "Draynor Manor", DRAYNOR_MANOR_BY_THE_FOUNTAIN, new WorldPoint(3088, 3336, 0), SPIN, item(IRON_PLATEBODY), item(STUDDED_CHAPS), item(BRONZE_FULL_HELM)), - new EmoteClue("Spin in front of the Soul altar. Beware of double agents! Equip a dragon pickaxe, helm of neitiznot and a pair of rune boots.", "Soul altar", SOUL_ALTAR, new WorldPoint(1815, 3856, 0), SPIN, any("Dragon pickaxe", item(DRAGON_PICKAXE), item(DRAGON_PICKAXE_12797), item(INFERNAL_PICKAXE), item(INFERNAL_PICKAXE_UNCHARGED), item(DRAGON_PICKAXEOR)), item(HELM_OF_NEITIZNOT), item(RUNE_BOOTS)), + new EmoteClue("Spin in front of the Soul altar. Beware of double agents! Equip a dragon pickaxe, helm of neitiznot and a pair of rune boots.", "Soul altar", SOUL_ALTAR, new WorldPoint(1815, 3856, 0), SPIN, any("Dragon or Crystal pickaxe", item(DRAGON_PICKAXE), item(DRAGON_PICKAXE_12797), item(INFERNAL_PICKAXE), item(INFERNAL_PICKAXE_UNCHARGED), item(DRAGON_PICKAXEOR), item(CRYSTAL_PICKAXE), item(CRYSTAL_PICKAXE_INACTIVE)), item(HELM_OF_NEITIZNOT), item(RUNE_BOOTS)), new EmoteClue("Spin in the Varrock Castle courtyard. Equip a black axe, a coif and a ruby ring.", "Varrock Castle", OUTSIDE_VARROCK_PALACE_COURTYARD, new WorldPoint(3213, 3463, 0), SPIN, item(BLACK_AXE), item(COIF), item(RUBY_RING)), new EmoteClue("Spin in West Ardougne Church. Equip a dragon spear and red dragonhide chaps.", "Ardougne", CHAPEL_IN_WEST_ARDOUGNE, new WorldPoint(2530, 3290, 0), SPIN, item(DRAGON_SPEAR), item(RED_DHIDE_CHAPS)), new EmoteClue("Spin on the bridge by the Barbarian Village. Salute before you talk to me. Equip purple gloves, a steel kiteshield and a mithril full helmet.", "Barbarian Village", EAST_OF_THE_BARBARIAN_VILLAGE_BRIDGE, new WorldPoint(3105, 3420, 0), SPIN, SALUTE, item(PURPLE_GLOVES), item(STEEL_KITESHIELD), item(MITHRIL_FULL_HELM)), From 5d4f7d2fcee3cdcddc19130d0d5a2866ff96d7c7 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 27 Sep 2019 10:10:19 -0700 Subject: [PATCH 17/19] clues: fix swordfish skill challenge --- .../client/plugins/cluescrolls/clues/SkillChallengeClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java index df10aa06cc..2c75d1a49e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java @@ -140,7 +140,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll new SkillChallengeClue("Chop a yew tree.", ANY_AXE), new SkillChallengeClue("Fix a magical lamp in Dorgesh-Kaan.", item(ItemID.LIGHT_ORB)), new SkillChallengeClue("Burn a yew log.", item(ItemID.YEW_LOGS), item(ItemID.TINDERBOX)), - new SkillChallengeClue("Catch and cook a swordfish.", "cook a swordfish.", ANY_HARPOON), + new SkillChallengeClue("Cook a swordfish", "cook a swordfish", item(ItemID.RAW_SWORDFISH)), new SkillChallengeClue("Craft multiple cosmic runes from a single essence.", item(ItemID.PURE_ESSENCE)), new SkillChallengeClue("Plant a watermelon seed.", item(ItemID.RAKE), item(ItemID.SEED_DIBBER), xOfItem(ItemID.WATERMELON_SEED, 3)), new SkillChallengeClue("Activate the Chivalry prayer."), From 05243c6c95dde345abb9788bcb9c6ee940f72c14 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 27 Sep 2019 10:27:54 -0700 Subject: [PATCH 18/19] clues: fix Warriors' Guild master clue text --- .../runelite/client/plugins/cluescrolls/clues/EmoteClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cb27e08052..b66c17e0da 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 @@ -138,7 +138,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Panic by the big egg where no one dare goes and the ground is burnt. Beware of double agents! Equip a dragon med helm, a TokTz-Ket-Xil, a brine sabre, rune platebody and an uncharged amulet of glory.", "Lava dragon isle", SOUTHEAST_CORNER_OF_LAVA_DRAGON_ISLE, new WorldPoint(3227, 3831, 0), PANIC, item(DRAGON_MED_HELM), item(TOKTZKETXIL), item(BRINE_SABRE), item(RUNE_PLATEBODY), item(AMULET_OF_GLORY)), new EmoteClue("Panic at the area flowers meet snow. Equip Blue D'hide vambs, a dragon spear and a rune plateskirt.", "Trollweiss mountain", HALFWAY_DOWN_TROLLWEISS_MOUNTAIN, new WorldPoint(2776, 3781, 0), PANIC, item(BLUE_DHIDE_VAMB), item(DRAGON_SPEAR), item(RUNE_PLATESKIRT), item(SLED_4084)), new EmoteClue("Do a push up at the bank of the Warrior's guild. Beware of double agents! Equip a dragon battleaxe, a dragon defender and a slayer helm of any kind.", "Warriors' guild", WARRIORS_GUILD_BANK_29047, new WorldPoint(2843, 3543, 0), PUSH_UP, item(DRAGON_BATTLEAXE), item(DRAGON_DEFENDER), any("Any slayer helmet", item(SLAYER_HELMET), item(BLACK_SLAYER_HELMET), item(GREEN_SLAYER_HELMET), item(PURPLE_SLAYER_HELMET), item(RED_SLAYER_HELMET), item(TURQUOISE_SLAYER_HELMET), item(SLAYER_HELMET_I), item(BLACK_SLAYER_HELMET_I), item(GREEN_SLAYER_HELMET_I), item(PURPLE_SLAYER_HELMET_I), item(RED_SLAYER_HELMET_I), item(TURQUOISE_SLAYER_HELMET_I), item(HYDRA_SLAYER_HELMET), item(HYDRA_SLAYER_HELMET_I))), - new EmoteClue("Blow a raspberry at the bank of the Warrior's guild. Beware of double agents! Equip a dragon battleaxe, a slayer helm of any kind and a dragon defender or avernic defender.", "Warriors' guild", WARRIORS_GUILD_BANK_29047, new WorldPoint(2843, 3543, 0), RASPBERRY, item(DRAGON_BATTLEAXE), any("Dragon defender or Avernic defender", item(DRAGON_DEFENDER), item(AVERNIC_DEFENDER)), any("Any slayer helmet", item(SLAYER_HELMET), item(BLACK_SLAYER_HELMET), item(GREEN_SLAYER_HELMET), item(PURPLE_SLAYER_HELMET), item(RED_SLAYER_HELMET), item(TURQUOISE_SLAYER_HELMET), item(SLAYER_HELMET_I), item(BLACK_SLAYER_HELMET_I), item(GREEN_SLAYER_HELMET_I), item(PURPLE_SLAYER_HELMET_I), item(RED_SLAYER_HELMET_I), item(TURQUOISE_SLAYER_HELMET_I), item(HYDRA_SLAYER_HELMET), item(HYDRA_SLAYER_HELMET_I))), + new EmoteClue("Blow a raspberry in the bank of the Warriors' Guild. Beware of double agents! Equip a dragon battleaxe, a slayer helm of any kind and a dragon defender or avernic defender.", "Warriors' guild", WARRIORS_GUILD_BANK_29047, new WorldPoint(2843, 3543, 0), RASPBERRY, item(DRAGON_BATTLEAXE), any("Dragon defender or Avernic defender", item(DRAGON_DEFENDER), item(AVERNIC_DEFENDER)), any("Any slayer helmet", item(SLAYER_HELMET), item(BLACK_SLAYER_HELMET), item(GREEN_SLAYER_HELMET), item(PURPLE_SLAYER_HELMET), item(RED_SLAYER_HELMET), item(TURQUOISE_SLAYER_HELMET), item(SLAYER_HELMET_I), item(BLACK_SLAYER_HELMET_I), item(GREEN_SLAYER_HELMET_I), item(PURPLE_SLAYER_HELMET_I), item(RED_SLAYER_HELMET_I), item(TURQUOISE_SLAYER_HELMET_I), item(HYDRA_SLAYER_HELMET), item(HYDRA_SLAYER_HELMET_I))), new EmoteClue("Blow a raspberry at the monkey cage in Ardougne Zoo. Equip a studded leather body, bronze platelegs and a normal staff with no orb.", "Ardougne Zoo", NEAR_THE_PARROTS_IN_ARDOUGNE_ZOO, new WorldPoint(2607, 3282, 0), RASPBERRY, item(STUDDED_BODY), item(BRONZE_PLATELEGS), item(STAFF)), new EmoteClue("Blow raspberries outside the entrance to Keep Le Faye. Equip a coif, an iron platebody and leather gloves.", "Keep Le Faye", OUTSIDE_KEEP_LE_FAYE, new WorldPoint(2757, 3401, 0), RASPBERRY, item(COIF), item(IRON_PLATEBODY), item(LEATHER_GLOVES)), new EmoteClue("Blow a raspberry in the Fishing Guild bank. Beware of double agents! Equip an elemental shield, blue dragonhide chaps and a rune warhammer.", "Fishing Guild", FISHING_GUILD_BANK, new WorldPoint(2588, 3419, 0), RASPBERRY, item(ELEMENTAL_SHIELD), item(BLUE_DHIDE_CHAPS), item(RUNE_WARHAMMER)), From b5de66636861dd4dcd9e9234ee7188092d92cca4 Mon Sep 17 00:00:00 2001 From: maddie <34499002+post-async@users.noreply.github.com> Date: Fri, 27 Sep 2019 10:35:02 -0700 Subject: [PATCH 19/19] clues: clarify bandit camp location in coordinate hint --- .../client/plugins/cluescrolls/clues/CoordinateClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4aa3888d13..039e70770c 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 @@ -100,7 +100,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati .put(new WorldPoint(2339, 3311, 0), "East of Prifddinas on Arandar mountain pass.") .put(new WorldPoint(3440, 3341, 0), "Nature Spirit's grotto.") .put(new WorldPoint(2763, 2974, 0), "Cairn Isle, west of Shilo Village.") - .put(new WorldPoint(3138, 2969, 0), "West of Bandit Camp.") + .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.") .put(new WorldPoint(3441, 3419, 0), "Mort Myre Swamp.")