From e3138db499273f0565a6f763be0d74f59129b868 Mon Sep 17 00:00:00 2001 From: Ron Young Date: Wed, 17 Apr 2019 09:08:33 -0500 Subject: [PATCH 1/8] skybox: calculate brightness increase in HSB format --- .../java/net/runelite/client/plugins/skybox/Skybox.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/skybox/Skybox.java b/runelite-client/src/main/java/net/runelite/client/plugins/skybox/Skybox.java index e513166143..aa770f37f8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/skybox/Skybox.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/skybox/Skybox.java @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.skybox; +import java.awt.Color; import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.IOException; @@ -447,7 +448,7 @@ class Skybox } // Convert back to int range values, and bounds check while we are at it - byte ay = (byte) Math.min(Math.max(Math.round(Math.pow(ty / t, brightness) * 255.d), 0), 255); + byte ay = (byte) Math.min(Math.max(Math.round(ty / t * 255.d), 0), 255); byte aco = (byte) Math.min(Math.max(Math.round(tco * 128.d / t), -128), 127); byte acg = (byte) Math.min(Math.max(Math.round(tcg * 128.d / t), -128), 127); @@ -457,7 +458,11 @@ class Skybox int r = (tmp - (aco >> 1)) & 0xFF; int b = (r + aco) & 0xFF; - return r << 16 | g << 8 | b; + // increase brightness with HSB + float[] hsb = Color.RGBtoHSB(r, g, b, null); + hsb[2] = (float) Math.pow(hsb[2], brightness); + + return 0xFFFFFF & Color.HSBtoRGB(hsb[0], hsb[1], hsb[2]); } /** From d7e0e11e73f090fa5d8fd837d6ea3244f60c88ef Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Fri, 19 Apr 2019 13:51:40 +0100 Subject: [PATCH 2/8] mixins: renderWidgetLayer: skip hidden widgets --- .../src/main/java/net/runelite/mixins/RSClientMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java index 56b9190ead..11ae361a9b 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java @@ -1335,7 +1335,7 @@ public abstract class RSClientMixin implements RSClient for (Widget rlWidget : widgets) { RSWidget widget = (RSWidget) rlWidget; - if (widget == null || widget.getRSParentId() != parentId) + if (widget == null || widget.getRSParentId() != parentId || widget.isSelfHidden()) { continue; } From a45ab3c88744a9ff28067f3a32d871af5cd5cade Mon Sep 17 00:00:00 2001 From: xDemoN Date: Fri, 19 Apr 2019 12:19:36 -0400 Subject: [PATCH 3/8] World Map: Identify Both Shield of Arrav Quest Start Points (#8442) Closes #8437 --- .../runelite/client/plugins/worldmap/QuestStartLocation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java index c1d9e9fb88..77157bb490 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java @@ -46,7 +46,8 @@ enum QuestStartLocation THE_RESTLESS_GHOST("The Restless Ghost", new WorldPoint(3240, 3210, 0)), RUNE_MYSTERIES("Rune Mysteries", new WorldPoint(3210, 3220, 0)), SHEEP_SHEARER("Sheep Shearer", new WorldPoint(3190, 3272, 0)), - SHIELD_OF_ARRAV("Shield of Arrav", new WorldPoint(3208, 3495, 0)), + SHIELD_OF_ARRAV_PHOENIX_GANG("Shield of Arrav (Phoenix Gang)", new WorldPoint(3208, 3495, 0)), + SHIELD_OF_ARRAV_BLACK_ARM_GANG("Shield of Arrav (Black Arm Gang)", new WorldPoint(3208, 3392, 0)), VAMPIRE_SLAYER("Vampire Slayer", new WorldPoint(3096, 3266, 0)), WITCHS_POTION("Witch's Potion", new WorldPoint(2967, 3203, 0)), X_MARKS_THE_SPOT("X Marks the Spot", new WorldPoint(3227, 3242, 0)), From 8bfc0f2b211191f9c0ca812369fd76df34fee424 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 19 Apr 2019 14:27:49 -0400 Subject: [PATCH 4/8] widgetitem: associate Widget with WidgetItem --- .../net/runelite/api/widgets/WidgetItem.java | 48 ++++++------------- .../net/runelite/mixins/RSClientMixin.java | 2 +- .../net/runelite/mixins/RSWidgetMixin.java | 2 +- 3 files changed, 16 insertions(+), 36 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 51f63ad40f..c39e961f81 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 @@ -26,6 +26,7 @@ package net.runelite.api.widgets; import java.awt.Rectangle; import lombok.AllArgsConstructor; +import lombok.Getter; import lombok.ToString; import net.runelite.api.Point; @@ -34,55 +35,34 @@ import net.runelite.api.Point; */ @AllArgsConstructor @ToString +@Getter public class WidgetItem { - private final int id; - private final int quantity; - private final int index; - private final Rectangle canvasBounds; - /** - * Gets the ID of the item represented. + * The ID of the item represented. * - * @return the items ID * @see net.runelite.api.ItemID */ - public int getId() - { - return id; - } - + private final int id; /** - * Gets the quantity of the represented item. - * - * @return the items quantity + * The quantity of the represented item. */ - public int getQuantity() - { - return quantity; - } - + private final int quantity; /** - * Gets the index position of this WidgetItem inside its parents + * The index position of this WidgetItem inside its parents * WidgetItem array. * - * @return the index in the parent widget * @see Widget#getWidgetItems() */ - public int getIndex() - { - return index; - } - + private final int index; /** - * Gets the area where the widget is drawn on the canvas. - * - * @return the occupied area of the widget + * The area where the widget is drawn on the canvas. */ - public Rectangle getCanvasBounds() - { - return canvasBounds; - } + private final Rectangle canvasBounds; + /** + * The widget which contains this item. + */ + private final Widget widget; /** * Gets the upper-left coordinate of where the widget is being drawn diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java index 11ae361a9b..7c934a265d 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java @@ -1355,7 +1355,7 @@ public abstract class RSClientMixin implements RSClient { if (renderX >= minX && renderX <= maxX && renderY >= minY && renderY <= maxY) { - WidgetItem widgetItem = new WidgetItem(widget.getItemId(), widget.getItemQuantity(), -1, widget.getBounds()); + WidgetItem widgetItem = new WidgetItem(widget.getItemId(), widget.getItemQuantity(), -1, widget.getBounds(), widget); callbacks.drawItem(widget.getItemId(), widgetItem); } } diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSWidgetMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSWidgetMixin.java index 4130ce5930..1b4bda7fc6 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSWidgetMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSWidgetMixin.java @@ -300,7 +300,7 @@ public abstract class RSWidgetMixin implements RSWidget int itemY = widgetCanvasLocation.getY() + ((ITEM_SLOT_SIZE + yPitch) * row); Rectangle bounds = new Rectangle(itemX - 1, itemY - 1, ITEM_SLOT_SIZE, ITEM_SLOT_SIZE); - return new WidgetItem(itemId - 1, itemQuantity, index, bounds); + return new WidgetItem(itemId - 1, itemQuantity, index, bounds, this); } @Inject From 3f13d4c620dd15f577d3a0c970e10566aae5d19d Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 19 Apr 2019 14:28:32 -0400 Subject: [PATCH 5/8] widgetitem overlay: allow configuring which interfaces to overlay Update overlays to behave consistent with how they behaved before removal of query api, with the exception of adding the rune pouch overlay to the bank. --- .../inventorytags/InventoryTagsOverlay.java | 2 + .../itemcharges/ItemChargeOverlay.java | 2 + .../plugins/runepouch/RunepouchOverlay.java | 2 + .../client/plugins/slayer/SlayerOverlay.java | 2 + .../client/ui/overlay/WidgetItemOverlay.java | 58 ++++++++++++++++++- 5 files changed, 64 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsOverlay.java index 99798156ad..14fe723a71 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/inventorytags/InventoryTagsOverlay.java @@ -43,6 +43,8 @@ public class InventoryTagsOverlay extends WidgetItemOverlay { this.itemManager = itemManager; this.plugin = plugin; + showOnEquipment(); + showOnInventory(); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeOverlay.java index a37570aa22..5082ab2ccd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeOverlay.java @@ -51,6 +51,8 @@ class ItemChargeOverlay extends WidgetItemOverlay { this.itemChargePlugin = itemChargePlugin; this.config = config; + showOnInventory(); + showOnEquipment(); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runepouch/RunepouchOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/runepouch/RunepouchOverlay.java index 17486efe0d..a7e2fd86d7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runepouch/RunepouchOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runepouch/RunepouchOverlay.java @@ -69,6 +69,8 @@ public class RunepouchOverlay extends WidgetItemOverlay this.tooltipManager = tooltipManager; this.client = client; this.config = config; + showOnInventory(); + showOnBank(); } @Override 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 e8c49b20a0..97a191d608 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 @@ -87,6 +87,8 @@ class SlayerOverlay extends WidgetItemOverlay { this.plugin = plugin; this.config = config; + showOnInventory(); + showOnEquipment(); } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetItemOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetItemOverlay.java index 0eaae6e50b..9cf6f39217 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetItemOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetItemOverlay.java @@ -26,15 +26,33 @@ package net.runelite.client.ui.overlay; import java.awt.Dimension; import java.awt.Graphics2D; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; +import java.util.Set; import lombok.AccessLevel; import lombok.Setter; +import net.runelite.api.widgets.Widget; +import static net.runelite.api.widgets.WidgetID.BANK_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.BANK_INVENTORY_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.DEPOSIT_BOX_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.EQUIPMENT_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.EQUIPMENT_INVENTORY_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.GRAND_EXCHANGE_INVENTORY_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.GUIDE_PRICES_INVENTORY_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.INVENTORY_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.SHOP_INVENTORY_GROUP_ID; +import static net.runelite.api.widgets.WidgetInfo.TO_GROUP; import net.runelite.api.widgets.WidgetItem; public abstract class WidgetItemOverlay extends Overlay { @Setter(AccessLevel.PACKAGE) private OverlayManager overlayManager; + /** + * Interfaces to draw overlay over. + */ + private final Set interfaceGroups = new HashSet<>(); protected WidgetItemOverlay() { @@ -49,13 +67,49 @@ public abstract class WidgetItemOverlay extends Overlay public Dimension render(Graphics2D graphics) { final List itemWidgets = overlayManager.getItemWidgets(); - for (WidgetItem widget : itemWidgets) + for (WidgetItem widgetItem : itemWidgets) { - renderItemOverlay(graphics, widget.getId(), widget); + Widget widget = widgetItem.getWidget(); + int interfaceGroup = TO_GROUP(widget.getId()); + + // Don't draw if this widget isn't one of the allowed + if (!interfaceGroups.contains(interfaceGroup)) + { + continue; + } + + renderItemOverlay(graphics, widgetItem.getId(), widgetItem); } return null; } + protected void showOnInventory() + { + showOnInterfaces( + DEPOSIT_BOX_GROUP_ID, + BANK_INVENTORY_GROUP_ID, + SHOP_INVENTORY_GROUP_ID, + GRAND_EXCHANGE_INVENTORY_GROUP_ID, + GUIDE_PRICES_INVENTORY_GROUP_ID, + EQUIPMENT_INVENTORY_GROUP_ID, + INVENTORY_GROUP_ID); + } + + protected void showOnBank() + { + showOnInterfaces(BANK_GROUP_ID); + } + + protected void showOnEquipment() + { + showOnInterfaces(EQUIPMENT_GROUP_ID); + } + + protected void showOnInterfaces(int... ids) + { + Arrays.stream(ids).forEach(interfaceGroups::add); + } + // Don't allow setting position, priority, or layer @Override From 5bd8aaa148a3e25923091fa23daa480b648985b0 Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Sat, 20 Apr 2019 12:48:41 +0100 Subject: [PATCH 6/8] Add Ammo plugin (#8113) Shows the current ammo the player has equipped. If the player is using a stackable weapon (chinchompas, darts, etc) those will show, otherwise it'll show the ammo slot (unless the item is a blessing or empty) If the value is over 1,000,000 the number will have an M. If it's over 10,000 the number will have a K. Closes #864 --- .../client/plugins/ammo/AmmoCounter.java | 57 +++++++ .../client/plugins/ammo/AmmoPlugin.java | 142 ++++++++++++++++++ 2 files changed, 199 insertions(+) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/ammo/AmmoCounter.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/ammo/AmmoPlugin.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/ammo/AmmoCounter.java b/runelite-client/src/main/java/net/runelite/client/plugins/ammo/AmmoCounter.java new file mode 100644 index 0000000000..f7f12c497a --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/ammo/AmmoCounter.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2019 Hydrox6 + * 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.ammo; + +import java.awt.image.BufferedImage; +import lombok.Getter; +import net.runelite.client.plugins.Plugin; +import net.runelite.client.ui.overlay.infobox.Counter; +import net.runelite.client.util.StackFormatter; + +class AmmoCounter extends Counter +{ + @Getter + private final int itemID; + private final String name; + + AmmoCounter(Plugin plugin, int itemID, int count, String name, BufferedImage image) + { + super(image, plugin, count); + this.itemID = itemID; + this.name = name; + } + + @Override + public String getText() + { + return StackFormatter.quantityToRSDecimalStack(getCount()); + } + + @Override + public String getTooltip() + { + return name; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/ammo/AmmoPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/ammo/AmmoPlugin.java new file mode 100644 index 0000000000..c42838f07c --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/ammo/AmmoPlugin.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2019 Hydrox6 + * 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.ammo; + +import java.awt.image.BufferedImage; +import javax.inject.Inject; +import net.runelite.api.Client; +import net.runelite.api.EquipmentInventorySlot; +import net.runelite.api.InventoryID; +import net.runelite.api.Item; +import net.runelite.api.ItemComposition; +import net.runelite.api.ItemContainer; +import net.runelite.api.events.ItemContainerChanged; +import net.runelite.client.callback.ClientThread; +import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.game.ItemManager; +import net.runelite.client.plugins.Plugin; +import net.runelite.client.plugins.PluginDescriptor; +import net.runelite.client.ui.overlay.infobox.InfoBoxManager; + +@PluginDescriptor( + name = "Ammo", + description = "Shows the current ammo the player has equipped", + tags = {"bolts", "darts", "chinchompa", "equipment"} +) +public class AmmoPlugin extends Plugin +{ + @Inject + private Client client; + + @Inject + private ClientThread clientThread; + + @Inject + private InfoBoxManager infoBoxManager; + + @Inject + private ItemManager itemManager; + + private AmmoCounter counterBox; + + @Override + protected void startUp() throws Exception + { + clientThread.invokeLater(() -> + { + final ItemContainer container = client.getItemContainer(InventoryID.EQUIPMENT); + + if (container != null) + { + checkInventory(container.getItems()); + } + }); + } + + @Override + protected void shutDown() throws Exception + { + infoBoxManager.removeInfoBox(counterBox); + counterBox = null; + } + + @Subscribe + public void onItemContainerChanged(ItemContainerChanged event) + { + if (event.getItemContainer() != client.getItemContainer(InventoryID.EQUIPMENT)) + { + return; + } + + checkInventory(event.getItemContainer().getItems()); + } + + private void checkInventory(final Item[] items) + { + // Check for weapon slot items. This overrides the ammo slot, + // as the player will use the thrown weapon (eg. chinchompas, knives, darts) + if (items.length >= EquipmentInventorySlot.WEAPON.getSlotIdx() - 1) + { + final Item weapon = items[EquipmentInventorySlot.WEAPON.getSlotIdx()]; + final ItemComposition weaponComp = itemManager.getItemComposition(weapon.getId()); + if (weaponComp.isStackable()) + { + updateInfobox(weapon, weaponComp); + return; + } + } + + if (items.length <= EquipmentInventorySlot.AMMO.getSlotIdx()) + { + return; + } + + final Item ammo = items[EquipmentInventorySlot.AMMO.getSlotIdx()]; + final ItemComposition comp = itemManager.getItemComposition(ammo.getId()); + + if (!comp.isStackable()) + { + infoBoxManager.removeInfoBox(counterBox); + counterBox = null; + return; + } + + updateInfobox(ammo, comp); + } + + private void updateInfobox(final Item item, final ItemComposition comp) + { + if (counterBox != null && counterBox.getItemID() == item.getId()) + { + counterBox.setCount(item.getQuantity()); + return; + } + + infoBoxManager.removeInfoBox(counterBox); + final BufferedImage image = itemManager.getImage(item.getId(), 5, false); + counterBox = new AmmoCounter(this, item.getId(), item.getQuantity(), comp.getName(), image); + infoBoxManager.addInfoBox(counterBox); + } +} From 3d98e215a2b75f8ccc3872937c27d1f9b3be1799 Mon Sep 17 00:00:00 2001 From: Sergz39 <45315230+ksergio39@users.noreply.github.com> Date: Sat, 20 Apr 2019 08:05:08 -0400 Subject: [PATCH 7/8] Fix Pirate's tresure quest start location (#8564) Closes #8560 --- .../runelite/client/plugins/worldmap/QuestStartLocation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java index 77157bb490..b49a56a2a0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java @@ -41,7 +41,7 @@ enum QuestStartLocation IMP_CATCHER("Imp Catcher", new WorldPoint(3108, 3160, 0)), THE_KNIGHTS_SWORD("The Knight's Sword", new WorldPoint(2976, 3342, 0)), MISTHALIN_MYSTERY("Misthalin Mystery", new WorldPoint(3234, 3155, 0)), - PIRATES_TREASURE("Pirate's Treasure", new WorldPoint(3050, 3248, 0)), + PIRATES_TREASURE("Pirate's Treasure", new WorldPoint(3051, 3252, 0)), PRINCE_ALI_RESCUE("Prince Ali Rescue", new WorldPoint(3301, 3163, 0)), THE_RESTLESS_GHOST("The Restless Ghost", new WorldPoint(3240, 3210, 0)), RUNE_MYSTERIES("Rune Mysteries", new WorldPoint(3210, 3220, 0)), From e7cdf50cfb0184510bd0e9f65eec1b67aeb1c85e Mon Sep 17 00:00:00 2001 From: Jamy C Date: Thu, 18 Apr 2019 22:09:38 +0200 Subject: [PATCH 8/8] Add missing Neitiznot bridges agility shortcuts --- .../main/java/net/runelite/client/game/AgilityShortcut.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java b/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java index 6c62b3e081..33cbdb1510 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java +++ b/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java @@ -108,6 +108,10 @@ public enum AgilityShortcut AL_KHARID_MINING_PITCLIFF_SCRAMBLE(38, "Rocks", new WorldPoint(3305, 3315, 0), ROCKS_16549, ROCKS_16550), YANILLE_WALL_GRAPPLE(39, "Grapple Wall", new WorldPoint(2552, 3072, 0), WALL_17047), NEITIZNOT_BRIDGE_REPAIR(40, "Bridge Repair - Quest", new WorldPoint(2315, 3828, 0), ROPE_BRIDGE_21306, ROPE_BRIDGE_21307), + NEITIZNOT_BRIDGE_SOUTHEAST(40, "Rope Bridge", null, ROPE_BRIDGE_21308, ROPE_BRIDGE_21309), + NEITIZNOT_BRIDGE_NORTHWEST(40, "Rope Bridge", null, ROPE_BRIDGE_21310, ROPE_BRIDGE_21311), + NEITIZNOT_BRIDGE_NORTH(40, "Rope Bridge", null, ROPE_BRIDGE_21312, ROPE_BRIDGE_21313), + NEITIZNOT_BRIDGE_NORTHEAST(40, "Broken Rope bridge", null, ROPE_BRIDGE_21314, ROPE_BRIDGE_21315), KOUREND_LAKE_JUMP_EAST(40, "Stepping Stones", new WorldPoint(1612, 3570, 0), STEPPING_STONE_29729, STEPPING_STONE_29730), KOUREND_LAKE_JUMP_WEST(40, "Stepping Stones", new WorldPoint(1604, 3572, 0), STEPPING_STONE_29729, STEPPING_STONE_29730), YANILLE_DUNGEON_BALANCE(40, "Balancing Ledge", null, BALANCING_LEDGE_23548),