From 74976f5db2d53c325d38f617de2907636d7952dd Mon Sep 17 00:00:00 2001 From: Daniel Bolink Date: Tue, 11 Feb 2020 23:00:03 -0800 Subject: [PATCH 01/20] itemcharges: Track Amulet of Chemistry charges Closes runelite/runelite#9246 --- .../plugins/itemcharges/ItemChargeConfig.java | 43 +++++++++++-- .../itemcharges/ItemChargeOverlay.java | 26 ++++---- .../plugins/itemcharges/ItemChargePlugin.java | 64 +++++++++++++++++++ .../plugins/itemcharges/ItemChargeType.java | 1 + .../plugins/itemcharges/ItemWithSlot.java | 1 + 5 files changed, 117 insertions(+), 18 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java index 2b29cbac07..98c7cec887 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java @@ -216,11 +216,40 @@ public interface ItemChargeConfig extends Config return true; } + @ConfigItem( + keyName = "showAmuletOfChemistryCharges", + name = "Show Amulet of Chemistry Charges", + description = "Configures if amulet of chemistry item charge is shown", + position = 16 + ) + default boolean showAmuletOfChemistryCharges() + { + return true; + } + + @ConfigItem( + keyName = "amuletOfChemistry", + name = "", + description = "", + hidden = true + ) + default int amuletOfChemistry() + { + return -1; + } + + @ConfigItem( + keyName = "amuletOfChemistry", + name = "", + description = "" + ) + void amuletOfChemistry(int amuletOfChemistry); + @ConfigItem( keyName = "recoilNotification", name = "Ring of Recoil Notification", description = "Configures if the ring of recoil breaking notification is shown", - position = 16 + position = 17 ) default boolean recoilNotification() { @@ -231,7 +260,7 @@ public interface ItemChargeConfig extends Config keyName = "showBindingNecklaceCharges", name = "Show Binding Necklace Charges", description = "Configures if binding necklace item charge is shown", - position = 17 + position = 18 ) default boolean showBindingNecklaceCharges() { @@ -260,7 +289,7 @@ public interface ItemChargeConfig extends Config keyName = "bindingNotification", name = "Binding Necklace Notification", description = "Configures if the binding necklace breaking notification is shown", - position = 18 + position = 19 ) default boolean bindingNotification() { @@ -271,7 +300,7 @@ public interface ItemChargeConfig extends Config keyName = "showExplorerRingCharges", name = "Show Explorer's Ring Alch Charges", description = "Configures if explorer's ring alchemy charges are shown", - position = 19 + position = 20 ) default boolean showExplorerRingCharges() { @@ -300,7 +329,7 @@ public interface ItemChargeConfig extends Config keyName = "showRingOfForgingCount", name = "Show Ring of Forging Charges", description = "Configures if the Ring of Forging charge count is shown", - position = 20 + position = 21 ) default boolean showRingOfForgingCount() { @@ -329,7 +358,7 @@ public interface ItemChargeConfig extends Config keyName = "ringOfForgingNotification", name = "Ring of Forging Notification", description = "Configures if the Ring of Forging breaking notification is enabled", - position = 21 + position = 22 ) default boolean ringOfForgingNotification() { @@ -340,7 +369,7 @@ public interface ItemChargeConfig extends Config keyName = "showInfoboxes", name = "Show Infoboxes", description = "Configures whether to show an infobox equipped charge items", - position = 22 + position = 23 ) default boolean showInfoboxes() { 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 4155410692..c0ad1518b6 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 @@ -31,15 +31,7 @@ import java.awt.Rectangle; import javax.inject.Inject; import net.runelite.api.ItemID; import net.runelite.api.widgets.WidgetItem; -import static net.runelite.client.plugins.itemcharges.ItemChargeType.ABYSSAL_BRACELET; -import static net.runelite.client.plugins.itemcharges.ItemChargeType.BELLOWS; -import static net.runelite.client.plugins.itemcharges.ItemChargeType.FUNGICIDE_SPRAY; -import static net.runelite.client.plugins.itemcharges.ItemChargeType.IMPBOX; -import static net.runelite.client.plugins.itemcharges.ItemChargeType.TELEPORT; -import static net.runelite.client.plugins.itemcharges.ItemChargeType.WATERCAN; -import static net.runelite.client.plugins.itemcharges.ItemChargeType.WATERSKIN; -import static net.runelite.client.plugins.itemcharges.ItemChargeType.FRUIT_BASKET; -import static net.runelite.client.plugins.itemcharges.ItemChargeType.SACK; +import static net.runelite.client.plugins.itemcharges.ItemChargeType.*; import net.runelite.client.ui.FontManager; import net.runelite.client.ui.overlay.WidgetItemOverlay; import net.runelite.client.ui.overlay.components.TextComponent; @@ -105,6 +97,15 @@ class ItemChargeOverlay extends WidgetItemOverlay charges = config.ringOfForging(); } + else if (itemId == ItemID.AMULET_OF_CHEMISTRY) + { + if (!config.showAmuletOfChemistryCharges()) + { + return; + } + + charges = config.amuletOfChemistry(); + } else { ItemWithCharge chargeItem = ItemWithCharge.findItem(itemId); @@ -122,7 +123,8 @@ class ItemChargeOverlay extends WidgetItemOverlay || (type == BELLOWS && !config.showBellowCharges()) || (type == FRUIT_BASKET && !config.showBasketCharges()) || (type == SACK && !config.showSackCharges()) - || (type == ABYSSAL_BRACELET && !config.showAbyssalBraceletCharges())) + || (type == ABYSSAL_BRACELET && !config.showAbyssalBraceletCharges()) + || (type == AMULET_OF_CHEMISTRY && !config.showAmuletOfChemistryCharges())) { return; } @@ -143,6 +145,8 @@ class ItemChargeOverlay extends WidgetItemOverlay return config.showTeleportCharges() || config.showDodgyCount() || config.showFungicideCharges() || config.showImpCharges() || config.showWateringCanCharges() || config.showWaterskinCharges() || config.showBellowCharges() || config.showBasketCharges() || config.showSackCharges() - || config.showAbyssalBraceletCharges() || config.showExplorerRingCharges() || config.showRingOfForgingCount(); + || config.showAbyssalBraceletCharges() || config.showExplorerRingCharges() || config.showRingOfForgingCount() + || config.showAmuletOfChemistryCharges(); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java index 95bff3d854..a7070bd863 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java @@ -80,11 +80,19 @@ public class ItemChargePlugin extends Plugin "You can smelt ([0-9+]+|one) more pieces? of iron ore before a ring melts\\."); private static final String RING_OF_FORGING_USED_TEXT = "You retrieve a bar of iron."; private static final String RING_OF_FORGING_BREAK_TEXT = "Your Ring of Forging has melted."; + private static final Pattern AMULET_OF_CHEMISTRY_CHECK_PATTERN = Pattern.compile( + "Your amulet of chemistry has (\\d) charges? left\\." + ); + private static final Pattern AMULET_OF_CHEMISTRY_USED_PATTERN = Pattern.compile( + "Your amulet of chemistry helps you create a 4-dose potion\\. (?:)?It has (\\d|one) charges? left\\." + ); + private static final String AMULET_OF_CHEMISTRY_BREAK_TEXT = "Your amulet of chemistry helps you create a 4-dose potion. It then crumbles to dust."; private static final int MAX_DODGY_CHARGES = 10; private static final int MAX_BINDING_CHARGES = 16; private static final int MAX_EXPLORER_RING_CHARGES = 30; private static final int MAX_RING_OF_FORGING_CHARGES = 140; + private static final int MAX_AMULET_OF_CHEMISTRY_CHARGES = 5; private int lastExplorerRingCharge = -1; @@ -151,6 +159,11 @@ public class ItemChargePlugin extends Plugin removeInfobox(ItemWithSlot.TELEPORT); } + if (!config.showAmuletOfChemistryCharges()) + { + removeInfobox(ItemWithSlot.AMULET_OF_CHEMISTY); + } + if (!config.showAbyssalBraceletCharges()) { removeInfobox(ItemWithSlot.ABYSSAL_BRACELET); @@ -187,6 +200,8 @@ public class ItemChargePlugin extends Plugin Matcher bindingNecklaceCheckMatcher = BINDING_CHECK_PATTERN.matcher(event.getMessage()); Matcher bindingNecklaceUsedMatcher = BINDING_USED_PATTERN.matcher(event.getMessage()); Matcher ringOfForgingCheckMatcher = RING_OF_FORGING_CHECK_PATTERN.matcher(message); + Matcher amuletOfChemistryCheckMatcher = AMULET_OF_CHEMISTRY_CHECK_PATTERN.matcher(message); + Matcher amuletOfChemistryUsedMatcher = AMULET_OF_CHEMISTRY_USED_PATTERN.matcher(message); if (event.getType() == ChatMessageType.GAMEMESSAGE || event.getType() == ChatMessageType.SPAM) { @@ -211,6 +226,26 @@ public class ItemChargePlugin extends Plugin { updateDodgyNecklaceCharges(Integer.parseInt(dodgyProtectMatcher.group(1))); } + else if (amuletOfChemistryCheckMatcher.find()) + { + updateAmuletOfChemistyCharges(Integer.parseInt(amuletOfChemistryCheckMatcher.group(1))); + } + else if (amuletOfChemistryUsedMatcher.find()) + { + final String match = amuletOfChemistryUsedMatcher.group(1); + + int charges = 1; + if (!match.equals("one")) + { + charges = Integer.parseInt(match); + } + + updateAmuletOfChemistyCharges(charges); + } + else if (message.equals(AMULET_OF_CHEMISTRY_BREAK_TEXT)) + { + updateAmuletOfChemistyCharges(MAX_AMULET_OF_CHEMISTRY_CHARGES); + } else if (message.contains(BINDING_BREAK_TEXT)) { if (config.bindingNotification()) @@ -317,6 +352,11 @@ public class ItemChargePlugin extends Plugin { updateJewelleryInfobox(ItemWithSlot.RING_OF_FORGING, items); } + + if (config.showAmuletOfChemistryCharges()) + { + updateJewelleryInfobox(ItemWithSlot.AMULET_OF_CHEMISTY, items); + } } @Subscribe @@ -362,6 +402,23 @@ public class ItemChargePlugin extends Plugin } } + private void updateAmuletOfChemistyCharges(final int value) + { + config.amuletOfChemistry(value); + + if (config.showInfoboxes() && config.showAmuletOfChemistryCharges()) + { + final ItemContainer itemContainer = client.getItemContainer(InventoryID.EQUIPMENT); + + if (itemContainer == null) + { + return; + } + + updateJewelleryInfobox(ItemWithSlot.AMULET_OF_CHEMISTY, itemContainer.getItems()); + } + } + private void updateBindingNecklaceCharges(final int value) { config.bindingNecklace(value); @@ -440,6 +497,9 @@ public class ItemChargePlugin extends Plugin case "Ring of forging": updateRingOfForgingCharges(MAX_RING_OF_FORGING_CHARGES); break; + case "Amulet of chemistry": + updateAmuletOfChemistyCharges(MAX_AMULET_OF_CHEMISTRY_CHARGES); + break; } } @@ -487,6 +547,10 @@ public class ItemChargePlugin extends Plugin { charges = config.ringOfForging(); } + else if (id == ItemID.AMULET_OF_CHEMISTRY && type == ItemWithSlot.AMULET_OF_CHEMISTY) + { + charges = config.amuletOfChemistry(); + } } else if (itemWithCharge.getType() == type.getType()) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeType.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeType.java index 030b5ab22c..77ed3a8a37 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeType.java @@ -27,6 +27,7 @@ package net.runelite.client.plugins.itemcharges; enum ItemChargeType { ABYSSAL_BRACELET, + AMULET_OF_CHEMISTRY, BELLOWS, FUNGICIDE_SPRAY, IMPBOX, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemWithSlot.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemWithSlot.java index cfc2338a33..a2126032ee 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemWithSlot.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemWithSlot.java @@ -34,6 +34,7 @@ import net.runelite.api.EquipmentInventorySlot; enum ItemWithSlot { ABYSSAL_BRACELET(ItemChargeType.ABYSSAL_BRACELET, EquipmentInventorySlot.GLOVES), + AMULET_OF_CHEMISTY(ItemChargeType.AMULET_OF_CHEMISTRY, EquipmentInventorySlot.AMULET), DODGY_NECKLACE(ItemChargeType.DODGY_NECKLACE, EquipmentInventorySlot.AMULET), BINDING_NECKLACE(ItemChargeType.BINDING_NECKLACE, EquipmentInventorySlot.AMULET), EXPLORER_RING(ItemChargeType.EXPLORER_RING, EquipmentInventorySlot.RING), From f74a60840ddcf1af7f357bb49232e13988c9fa03 Mon Sep 17 00:00:00 2001 From: Daniel Bolink Date: Wed, 12 Feb 2020 12:53:08 -0800 Subject: [PATCH 02/20] itemcharges: Track Amulet of Bounty charges Closes runelite/runelite#10781 --- .../plugins/itemcharges/ItemChargeConfig.java | 43 ++++++++++++--- .../itemcharges/ItemChargeOverlay.java | 14 ++++- .../plugins/itemcharges/ItemChargePlugin.java | 53 +++++++++++++++++++ .../plugins/itemcharges/ItemChargeType.java | 1 + .../plugins/itemcharges/ItemWithSlot.java | 1 + 5 files changed, 103 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java index 98c7cec887..66c14ea22d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java @@ -245,11 +245,40 @@ public interface ItemChargeConfig extends Config ) void amuletOfChemistry(int amuletOfChemistry); + @ConfigItem( + keyName = "showAmuletOfBountyCharges", + name = "Show Amulet of Bounty Charges", + description = "Configures if amulet of bounty item charge is shown", + position = 17 + ) + default boolean showAmuletOfBountyCharges() + { + return true; + } + + @ConfigItem( + keyName = "amuletOfBounty", + name = "", + description = "", + hidden = true + ) + default int amuletOfBounty() + { + return -1; + } + + @ConfigItem( + keyName = "amuletOfBounty", + name = "", + description = "" + ) + void amuletOfBounty(int amuletOfBounty); + @ConfigItem( keyName = "recoilNotification", name = "Ring of Recoil Notification", description = "Configures if the ring of recoil breaking notification is shown", - position = 17 + position = 18 ) default boolean recoilNotification() { @@ -260,7 +289,7 @@ public interface ItemChargeConfig extends Config keyName = "showBindingNecklaceCharges", name = "Show Binding Necklace Charges", description = "Configures if binding necklace item charge is shown", - position = 18 + position = 19 ) default boolean showBindingNecklaceCharges() { @@ -289,7 +318,7 @@ public interface ItemChargeConfig extends Config keyName = "bindingNotification", name = "Binding Necklace Notification", description = "Configures if the binding necklace breaking notification is shown", - position = 19 + position = 20 ) default boolean bindingNotification() { @@ -300,7 +329,7 @@ public interface ItemChargeConfig extends Config keyName = "showExplorerRingCharges", name = "Show Explorer's Ring Alch Charges", description = "Configures if explorer's ring alchemy charges are shown", - position = 20 + position = 21 ) default boolean showExplorerRingCharges() { @@ -329,7 +358,7 @@ public interface ItemChargeConfig extends Config keyName = "showRingOfForgingCount", name = "Show Ring of Forging Charges", description = "Configures if the Ring of Forging charge count is shown", - position = 21 + position = 22 ) default boolean showRingOfForgingCount() { @@ -358,7 +387,7 @@ public interface ItemChargeConfig extends Config keyName = "ringOfForgingNotification", name = "Ring of Forging Notification", description = "Configures if the Ring of Forging breaking notification is enabled", - position = 22 + position = 23 ) default boolean ringOfForgingNotification() { @@ -369,7 +398,7 @@ public interface ItemChargeConfig extends Config keyName = "showInfoboxes", name = "Show Infoboxes", description = "Configures whether to show an infobox equipped charge items", - position = 23 + position = 24 ) default boolean showInfoboxes() { 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 c0ad1518b6..d23db92cc7 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 @@ -106,6 +106,15 @@ class ItemChargeOverlay extends WidgetItemOverlay charges = config.amuletOfChemistry(); } + else if (itemId == ItemID.AMULET_OF_BOUNTY) + { + if (!config.showAmuletOfBountyCharges()) + { + return; + } + + charges = config.amuletOfBounty(); + } else { ItemWithCharge chargeItem = ItemWithCharge.findItem(itemId); @@ -124,7 +133,8 @@ class ItemChargeOverlay extends WidgetItemOverlay || (type == FRUIT_BASKET && !config.showBasketCharges()) || (type == SACK && !config.showSackCharges()) || (type == ABYSSAL_BRACELET && !config.showAbyssalBraceletCharges()) - || (type == AMULET_OF_CHEMISTRY && !config.showAmuletOfChemistryCharges())) + || (type == AMULET_OF_CHEMISTRY && !config.showAmuletOfChemistryCharges()) + || (type == AMULET_OF_BOUNTY && !config.showAmuletOfBountyCharges())) { return; } @@ -146,7 +156,7 @@ class ItemChargeOverlay extends WidgetItemOverlay || config.showImpCharges() || config.showWateringCanCharges() || config.showWaterskinCharges() || config.showBellowCharges() || config.showBasketCharges() || config.showSackCharges() || config.showAbyssalBraceletCharges() || config.showExplorerRingCharges() || config.showRingOfForgingCount() - || config.showAmuletOfChemistryCharges(); + || config.showAmuletOfChemistryCharges() || config.showAmuletOfBountyCharges(); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java index a7070bd863..854ce32f82 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java @@ -87,12 +87,20 @@ public class ItemChargePlugin extends Plugin "Your amulet of chemistry helps you create a 4-dose potion\\. (?:)?It has (\\d|one) charges? left\\." ); private static final String AMULET_OF_CHEMISTRY_BREAK_TEXT = "Your amulet of chemistry helps you create a 4-dose potion. It then crumbles to dust."; + private static final Pattern AMULET_OF_BOUNTY_CHECK_PATTERN = Pattern.compile( + "Your amulet of bounty has (\\d+) charges? left\\." + ); + private static final Pattern AMULET_OF_BOUNTY_USED_PATTERN = Pattern.compile( + "Your amulet of bounty saves some seeds for you\\. (?:)?It has (\\d) charges? left\\." + ); + private static final String AMULET_OF_BOUNTY_BREAK_TEXT = "Your amulet of bounty saves some seeds for you. It then crumbles to dust."; private static final int MAX_DODGY_CHARGES = 10; private static final int MAX_BINDING_CHARGES = 16; private static final int MAX_EXPLORER_RING_CHARGES = 30; private static final int MAX_RING_OF_FORGING_CHARGES = 140; private static final int MAX_AMULET_OF_CHEMISTRY_CHARGES = 5; + private static final int MAX_AMULET_OF_BOUNTY_CHARGES = 10; private int lastExplorerRingCharge = -1; @@ -164,6 +172,11 @@ public class ItemChargePlugin extends Plugin removeInfobox(ItemWithSlot.AMULET_OF_CHEMISTY); } + if (!config.showAmuletOfBountyCharges()) + { + removeInfobox(ItemWithSlot.AMULET_OF_BOUNTY); + } + if (!config.showAbyssalBraceletCharges()) { removeInfobox(ItemWithSlot.ABYSSAL_BRACELET); @@ -202,6 +215,8 @@ public class ItemChargePlugin extends Plugin Matcher ringOfForgingCheckMatcher = RING_OF_FORGING_CHECK_PATTERN.matcher(message); Matcher amuletOfChemistryCheckMatcher = AMULET_OF_CHEMISTRY_CHECK_PATTERN.matcher(message); Matcher amuletOfChemistryUsedMatcher = AMULET_OF_CHEMISTRY_USED_PATTERN.matcher(message); + Matcher amuletOfBountyCheckMatcher = AMULET_OF_BOUNTY_CHECK_PATTERN.matcher(message); + Matcher amuletOfBountyUsedMatcher = AMULET_OF_BOUNTY_USED_PATTERN.matcher(message); if (event.getType() == ChatMessageType.GAMEMESSAGE || event.getType() == ChatMessageType.SPAM) { @@ -246,6 +261,18 @@ public class ItemChargePlugin extends Plugin { updateAmuletOfChemistyCharges(MAX_AMULET_OF_CHEMISTRY_CHARGES); } + else if (amuletOfBountyCheckMatcher.find()) + { + updateAmuletOfBountyCharges(Integer.parseInt(amuletOfBountyCheckMatcher.group(1))); + } + else if (amuletOfBountyUsedMatcher.find()) + { + updateAmuletOfBountyCharges(Integer.parseInt(amuletOfBountyUsedMatcher.group(1))); + } + else if (message.equals(AMULET_OF_BOUNTY_BREAK_TEXT)) + { + updateAmuletOfBountyCharges(MAX_AMULET_OF_BOUNTY_CHARGES); + } else if (message.contains(BINDING_BREAK_TEXT)) { if (config.bindingNotification()) @@ -357,6 +384,11 @@ public class ItemChargePlugin extends Plugin { updateJewelleryInfobox(ItemWithSlot.AMULET_OF_CHEMISTY, items); } + + if (config.showAmuletOfBountyCharges()) + { + updateJewelleryInfobox(ItemWithSlot.AMULET_OF_BOUNTY, items); + } } @Subscribe @@ -419,6 +451,23 @@ public class ItemChargePlugin extends Plugin } } + private void updateAmuletOfBountyCharges(final int value) + { + config.amuletOfBounty(value); + + if (config.showInfoboxes() && config.showAmuletOfBountyCharges()) + { + final ItemContainer itemContainer = client.getItemContainer(InventoryID.EQUIPMENT); + + if (itemContainer == null) + { + return; + } + + updateJewelleryInfobox(ItemWithSlot.AMULET_OF_BOUNTY, itemContainer.getItems()); + } + } + private void updateBindingNecklaceCharges(final int value) { config.bindingNecklace(value); @@ -551,6 +600,10 @@ public class ItemChargePlugin extends Plugin { charges = config.amuletOfChemistry(); } + else if (id == ItemID.AMULET_OF_BOUNTY && type == ItemWithSlot.AMULET_OF_BOUNTY) + { + charges = config.amuletOfBounty(); + } } else if (itemWithCharge.getType() == type.getType()) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeType.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeType.java index 77ed3a8a37..475a6d03b9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeType.java @@ -28,6 +28,7 @@ enum ItemChargeType { ABYSSAL_BRACELET, AMULET_OF_CHEMISTRY, + AMULET_OF_BOUNTY, BELLOWS, FUNGICIDE_SPRAY, IMPBOX, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemWithSlot.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemWithSlot.java index a2126032ee..9af0327a04 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemWithSlot.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemWithSlot.java @@ -35,6 +35,7 @@ enum ItemWithSlot { ABYSSAL_BRACELET(ItemChargeType.ABYSSAL_BRACELET, EquipmentInventorySlot.GLOVES), AMULET_OF_CHEMISTY(ItemChargeType.AMULET_OF_CHEMISTRY, EquipmentInventorySlot.AMULET), + AMULET_OF_BOUNTY(ItemChargeType.AMULET_OF_BOUNTY, EquipmentInventorySlot.AMULET), DODGY_NECKLACE(ItemChargeType.DODGY_NECKLACE, EquipmentInventorySlot.AMULET), BINDING_NECKLACE(ItemChargeType.BINDING_NECKLACE, EquipmentInventorySlot.AMULET), EXPLORER_RING(ItemChargeType.EXPLORER_RING, EquipmentInventorySlot.RING), From 0cae82b7ef0953d1a469ac883809023d47373ad2 Mon Sep 17 00:00:00 2001 From: Deon Zhao Date: Sat, 29 Feb 2020 12:55:13 -0800 Subject: [PATCH 03/20] HotColdLocation: Center South-east Dark Warriors' Fortress location --- .../plugins/cluescrolls/clues/hotcold/HotColdLocation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java index ca341697c8..012bb71e76 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java @@ -147,7 +147,7 @@ public enum HotColdLocation WESTERN_PROVINCE_TYRAS(new WorldPoint(2206, 3158, 0), WESTERN_PROVINCE, "Near Tyras Camp."), WESTERN_PROVINCE_ZULANDRA(new WorldPoint(2196, 3057, 0), WESTERN_PROVINCE, "The northern house at Zul-Andra."), WILDERNESS_5(new WorldPoint(3173, 3556, 0), WILDERNESS, "North of the Grand Exchange, level 5 Wilderness."), - WILDERNESS_12(new WorldPoint(3038, 3612, 0), WILDERNESS, "South-east of the Dark Warriors' Fortress, level 12 Wilderness."), + WILDERNESS_12(new WorldPoint(3036, 3612, 0), WILDERNESS, "South-east of the Dark Warriors' Fortress, level 12 Wilderness."), WILDERNESS_20(new WorldPoint(3225, 3676, 0), WILDERNESS, "East of the Corporeal Beast's lair, level 20 Wilderness."), WILDERNESS_27(new WorldPoint(3174, 3736, 0), WILDERNESS, "Inside the Ruins north of the Graveyard of Shadows, level 27 Wilderness."), WILDERNESS_28(new WorldPoint(3377, 3737, 0), WILDERNESS, "East of Venenatis' nest, level 28 Wilderness."), From 892985f6e7031fed084b70f741f1baec73e56a2a Mon Sep 17 00:00:00 2001 From: Skyler Olds Date: Sun, 1 Mar 2020 16:23:41 -0700 Subject: [PATCH 04/20] Add AM/PM description to Timestamp Plugin Config (#10920) --- .../net/runelite/client/plugins/timestamp/TimestampConfig.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampConfig.java index fda97b0941..b2229c9280 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampConfig.java @@ -59,7 +59,8 @@ public interface TimestampConfig extends Config "'HH' : hour in 24 hour format
" + "'hh' : hour in 12 hour format
" + "'mm' : minute
" + - "'ss' : second" + "'ss' : second
" + + "'a' : AM/PM" ) default String timestampFormat() { From 3a683c40344db5e15a80c843fc7b78f600e8a6d4 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 2 Mar 2020 19:44:30 +0000 Subject: [PATCH 05/20] emote clue: Add missing ornament items --- .../plugins/cluescrolls/clues/EmoteClue.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 89de1e4cbe..807dbbeb20 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 @@ -76,7 +76,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Cheer at the games room. Have nothing equipped at all when you do.", "Games room", null, new WorldPoint(2207, 4952, 0), CHEER, emptySlot("Nothing at all", HEAD, CAPE, AMULET, WEAPON, BODY, SHIELD, LEGS, GLOVES, BOOTS, RING, AMMO)), new EmoteClue("Panic on the pier where you catch the Fishing trawler. Have nothing equipped at all when you do.", "Fishing trawler", null, new WorldPoint(2676, 3169, 0), PANIC, emptySlot("Nothing at all", HEAD, CAPE, AMULET, WEAPON, BODY, SHIELD, LEGS, GLOVES, BOOTS, RING, AMMO)), new EmoteClue("Panic in the heart of the Haunted Woods. Beware of double agents! Have no items equipped when you do.", "Haunted Woods", null, new WorldPoint(3611, 3492, 0), PANIC, emptySlot("Nothing at all", HEAD, CAPE, AMULET, WEAPON, BODY, SHIELD, LEGS, GLOVES, BOOTS, RING, AMMO)), - new EmoteClue("Show your anger towards the Statue of Saradomin in Ellamaria's garden. Beware of double agents! Equip a zamorak godsword.", "Varrock Castle", BY_THE_BEAR_CAGE_IN_VARROCK_PALACE_GARDENS, new WorldPoint(3230, 3478, 0), ANGRY, item(ZAMORAK_GODSWORD)), + new EmoteClue("Show your anger towards the Statue of Saradomin in Ellamaria's garden. Beware of double agents! Equip a zamorak godsword.", "Varrock Castle", BY_THE_BEAR_CAGE_IN_VARROCK_PALACE_GARDENS, new WorldPoint(3230, 3478, 0), ANGRY, any("Zamorak godsword", item(ZAMORAK_GODSWORD), item(ZAMORAK_GODSWORD_OR))), new EmoteClue("Show your anger at the Wise old man. Beware of double agents! Equip an abyssal whip, a legend's cape and some spined chaps.", "Draynor Village", BEHIND_MISS_SCHISM_IN_DRAYNOR_VILLAGE, new WorldPoint(3088, 3254, 0), ANGRY, any("Abyssal whip", item(ABYSSAL_WHIP), item(VOLCANIC_ABYSSAL_WHIP), item(FROZEN_ABYSSAL_WHIP)), item(CAPE_OF_LEGENDS), item(SPINED_CHAPS)), new EmoteClue("Beckon by a collection of crystalline maple trees. Beware of double agents! Equip Bryophyta's staff and a nature tiara.", "North of Prifddinas", CRYSTALLINE_MAPLE_TREES, new WorldPoint(2211, 3427, 0), BECKON, range("Bryophyta's staff", BRYOPHYTAS_STAFF_UNCHARGED, BRYOPHYTAS_STAFF), item(NATURE_TIARA)), new EmoteClue("Beckon in the Digsite, near the eastern winch. Bow before you talk to me. Equip a green gnome hat, snakeskin boots and an iron pickaxe.", "Digsite", DIGSITE, new WorldPoint(3370, 3425, 0), BECKON, BOW, item(GREEN_HAT), item(SNAKESKIN_BOOTS), item(IRON_PICKAXE)), @@ -115,7 +115,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Dance in the centre of Canifis. Bow before you talk to me. Equip a green gnome robe top, mithril plate legs and an iron two-handed sword.", "Canifis", CENTRE_OF_CANIFIS, new WorldPoint(3492, 3488, 0), DANCE, BOW, item(GREEN_ROBE_TOP), item(MITHRIL_PLATELEGS), item(IRON_2H_SWORD)), new EmoteClue("Dance in the King Black Dragon's lair. Beware of double agents! Equip a black dragonhide body, black dragonhide vambs and a black dragon mask.", "King black dragon's lair", KING_BLACK_DRAGONS_LAIR, new WorldPoint(2271, 4680, 0), DANCE, item(BLACK_DHIDE_BODY), item(BLACK_DHIDE_VAMB), item(BLACK_DRAGON_MASK)), new EmoteClue("Dance at the entrance to the Grand Exchange. Equip a pink skirt, pink robe top and a body tiara.", "Grand Exchange", SOUTH_OF_THE_GRAND_EXCHANGE, new WorldPoint(3165, 3467, 0), DANCE, item(PINK_SKIRT), item(PINK_ROBE_TOP), item(BODY_TIARA)), - new EmoteClue("Goblin Salute in the Goblin Village. Beware of double agents! Equip a bandos godsword, a bandos cloak and a bandos platebody.", "Goblin Village", OUTSIDE_MUDKNUCKLES_HUT, new WorldPoint(2956, 3505, 0), GOBLIN_SALUTE, item(BANDOS_PLATEBODY), item(BANDOS_CLOAK), item(BANDOS_GODSWORD)), + new EmoteClue("Goblin Salute in the Goblin Village. Beware of double agents! Equip a bandos godsword, a bandos cloak and a bandos platebody.", "Goblin Village", OUTSIDE_MUDKNUCKLES_HUT, new WorldPoint(2956, 3505, 0), GOBLIN_SALUTE, item(BANDOS_PLATEBODY), item(BANDOS_CLOAK), any("Bandos godsword", item(BANDOS_GODSWORD), item(BANDOS_GODSWORD_OR))), new EmoteClue("Headbang in the mine north of Al Kharid. Equip a desert shirt, leather gloves and leather boots.", "Al Kharid mine", AL_KHARID_SCORPION_MINE, new WorldPoint(3299, 3289, 0), HEADBANG, item(DESERT_SHIRT), item(LEATHER_GLOVES), item(LEATHER_BOOTS)), new EmoteClue("Headbang at the exam center. Beware of double agents! Equip a mystic fire staff, a diamond bracelet and rune boots.", "Digsite", INSIDE_THE_DIGSITE_EXAM_CENTRE, new WorldPoint(3362, 3340, 0), HEADBANG, item(MYSTIC_FIRE_STAFF), item(DIAMOND_BRACELET), item(RUNE_BOOTS)), new EmoteClue("Headbang at the top of Slayer Tower. Equip a seercull, a combat bracelet and helm of Neitiznot.", "Slayer Tower", OUTSIDE_THE_SLAYER_TOWER_GARGOYLE_ROOM, new WorldPoint(3421, 3537, 2), HEADBANG, item(SEERCULL), range("Combat bracelet", COMBAT_BRACELET4, COMBAT_BRACELET), item(HELM_OF_NEITIZNOT)), @@ -128,7 +128,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Jump for joy in the Ancient Cavern. Equip a granite shield, splitbark body and any rune heraldic helm.", "Ancient cavern", ENTRANCE_OF_THE_CAVERN_UNDER_THE_WHIRLPOOL, new WorldPoint(1768, 5366, 1), JUMP_FOR_JOY, item(GRANITE_SHIELD), item(SPLITBARK_BODY), range("Any rune heraldic helm", RUNE_HELM_H1, RUNE_HELM_H5)), new EmoteClue("Jump for joy at the Neitiznot rune rock. Equip Rune boots, a proselyte hauberk and a dragonstone ring.", "Fremennik Isles", NEAR_A_RUNITE_ROCK_IN_THE_FREMENNIK_ISLES, new WorldPoint(2375, 3850, 0), JUMP_FOR_JOY, item(RUNE_BOOTS), item(PROSELYTE_HAUBERK), item(DRAGONSTONE_RING)), new EmoteClue("Jump for joy in the centre of Zul-Andra. Beware of double agents! Equip a dragon 2h sword, bandos boots and an obsidian cape.", "Zul-Andra", NEAR_THE_PIER_IN_ZULANDRA, new WorldPoint(2199, 3056, 0), JUMP_FOR_JOY, item(DRAGON_2H_SWORD), item(BANDOS_BOOTS), item(OBSIDIAN_CAPE)), - new EmoteClue("Laugh by the fountain of heroes. Equip splitbark legs, dragon boots and a Rune longsword.", "Fountain of heroes", FOUNTAIN_OF_HEROES, new WorldPoint(2920, 9893, 0), LAUGH, item(SPLITBARK_LEGS), item(DRAGON_BOOTS), item(RUNE_LONGSWORD)), + new EmoteClue("Laugh by the fountain of heroes. Equip splitbark legs, dragon boots and a Rune longsword.", "Fountain of heroes", FOUNTAIN_OF_HEROES, new WorldPoint(2920, 9893, 0), LAUGH, item(SPLITBARK_LEGS), any("Dragon boots", item(DRAGON_BOOTS), item(DRAGON_BOOTS_G)), item(RUNE_LONGSWORD)), new EmoteClue("Laugh in Jokul's tent in the Mountain Camp. Beware of double agents! Equip a rune full helmet, blue dragonhide chaps and a fire battlestaff.", "Mountain Camp", MOUNTAIN_CAMP_GOAT_ENCLOSURE, new WorldPoint(2812, 3681, 0), LAUGH, item(RUNE_FULL_HELM), item(BLUE_DHIDE_CHAPS), item(FIRE_BATTLESTAFF)), new EmoteClue("Laugh at the crossroads south of the Sinclair Mansion. Equip a cowl, a blue wizard robe top and an iron scimitar.", "Sinclair Mansion", ROAD_JUNCTION_SOUTH_OF_SINCLAIR_MANSION, new WorldPoint(2741, 3536, 0), LAUGH, item(LEATHER_COWL), item(BLUE_WIZARD_ROBE), item(IRON_SCIMITAR)), new EmoteClue("Laugh in front of the gem store in Ardougne market. Equip a Castlewars bracelet, a dragonstone amulet and a ring of forging.", "Ardougne", NEAR_THE_GEM_STALL_IN_ARDOUGNE_MARKET, new WorldPoint(2666, 3304, 0), LAUGH, any("Castle wars bracelet", range(CASTLE_WARS_BRACELET3, CASTLE_WARS_BRACELET1)), item(DRAGONSTONE_AMULET), item(RING_OF_FORGING)), @@ -138,8 +138,8 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Panic by the pilot on White Wolf Mountain. Beware of double agents! Equip mithril platelegs, a ring of life and a rune axe.", "White Wolf Mountain", GNOME_GLIDER_ON_WHITE_WOLF_MOUNTAIN, new WorldPoint(2847, 3499, 0), PANIC, item(MITHRIL_PLATELEGS), item(RING_OF_LIFE), item(RUNE_AXE)), 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 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("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), any("Dragon defender", item(DRAGON_DEFENDER), item(DRAGON_DEFENDER_T)), 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(DRAGON_DEFENDER_T), 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)), @@ -163,7 +163,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Wave along the south fence of the Lumber Yard. Equip a hard leather body, leather chaps and a bronze axe.", "Lumber Yard", NEAR_THE_SAWMILL_OPERATORS_BOOTH, new WorldPoint(3307, 3491, 0), WAVE, item(HARDLEATHER_BODY), item(LEATHER_CHAPS), item(BRONZE_AXE)), new EmoteClue("Wave in the Falador gem store. Equip a Mithril pickaxe, Black platebody and an Iron Kiteshield.", "Falador", NEAR_HERQUINS_SHOP_IN_FALADOR, new WorldPoint(2945, 3335, 0), WAVE, item(MITHRIL_PICKAXE), item(BLACK_PLATEBODY), item(IRON_KITESHIELD)), new EmoteClue("Wave on Mudskipper Point. Equip a black cape, leather chaps and a steel mace.", "Mudskipper Point", MUDSKIPPER_POINT, new WorldPoint(2989, 3110, 0), WAVE, item(BLACK_CAPE), item(LEATHER_CHAPS), item(STEEL_MACE)), - new EmoteClue("Wave on the northern wall of Castle Drakan. Beware of double agents! Wear a dragon sq shield, splitbark body and any boater.", "Castle Drakan", NORTHERN_WALL_OF_CASTLE_DRAKAN, new WorldPoint(3560, 3385, 0), WAVE, item(DRAGON_SQ_SHIELD), item(SPLITBARK_BODY), any("Any boater", item(RED_BOATER), item(ORANGE_BOATER), item(GREEN_BOATER), item(BLUE_BOATER), item(BLACK_BOATER), item(PINK_BOATER), item(PURPLE_BOATER), item(WHITE_BOATER))), + new EmoteClue("Wave on the northern wall of Castle Drakan. Beware of double agents! Wear a dragon sq shield, splitbark body and any boater.", "Castle Drakan", NORTHERN_WALL_OF_CASTLE_DRAKAN, new WorldPoint(3560, 3385, 0), WAVE, any("Dragon sq shield", item(DRAGON_SQ_SHIELD), item(DRAGON_SQ_SHIELD_G)), item(SPLITBARK_BODY), any("Any boater", item(RED_BOATER), item(ORANGE_BOATER), item(GREEN_BOATER), item(BLUE_BOATER), item(BLACK_BOATER), item(PINK_BOATER), item(PURPLE_BOATER), item(WHITE_BOATER))), new EmoteClue("Yawn in the 7th room of Pyramid Plunder. Beware of double agents! Equip a pharaoh sceptre and a full set of menaphite robes.", "Pyramid Plunder", _7TH_CHAMBER_OF_JALSAVRAH, new WorldPoint(1944, 4427, 0), YAWN, any("Pharaoh's sceptre", item(PHARAOHS_SCEPTRE), item(PHARAOHS_SCEPTRE_1), item(PHARAOHS_SCEPTRE_2), item(PHARAOHS_SCEPTRE_3), item(PHARAOHS_SCEPTRE_4), item(PHARAOHS_SCEPTRE_5), item(PHARAOHS_SCEPTRE_6), item(PHARAOHS_SCEPTRE_7), item(PHARAOHS_SCEPTRE_8)), any("Full set of menaphite robes", all(item(MENAPHITE_PURPLE_HAT), item(MENAPHITE_PURPLE_TOP), range(MENAPHITE_PURPLE_ROBE, MENAPHITE_PURPLE_KILT)), all(item(MENAPHITE_RED_HAT), item(MENAPHITE_RED_TOP), range(MENAPHITE_RED_ROBE, MENAPHITE_RED_KILT)))), new EmoteClue("Yawn in the Varrock library. Equip a green gnome robe top, HAM robe bottom and an iron warhammer.", "Varrock Castle", VARROCK_PALACE_LIBRARY, new WorldPoint(3209, 3492, 0), YAWN, item(GREEN_ROBE_TOP), item(HAM_ROBE), item(IRON_WARHAMMER)), new EmoteClue("Yawn in Draynor Marketplace. Equip studded leather chaps, an iron kiteshield and a steel longsword.", "Draynor", DRAYNOR_VILLAGE_MARKET, new WorldPoint(3083, 3253, 0), YAWN, item(STUDDED_CHAPS), item(IRON_KITESHIELD), item(STEEL_LONGSWORD)), @@ -171,7 +171,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Yawn in the rogues' general store. Beware of double agents! Equip an adamant square shield, blue dragon vambraces and a rune pickaxe.", "Rogues general store", NOTERAZZOS_SHOP_IN_THE_WILDERNESS, new WorldPoint(3026, 3701, 0), YAWN, item(ADAMANT_SQ_SHIELD), item(BLUE_DHIDE_VAMB), item(RUNE_PICKAXE)), new EmoteClue("Yawn at the top of Trollheim. Equip a lava battlestaff, black dragonhide vambraces and a mind shield.", "Trollheim Mountain", ON_TOP_OF_TROLLHEIM_MOUNTAIN, new WorldPoint(2887, 3676, 0), YAWN, any("Lava battlestaff", item(LAVA_BATTLESTAFF), item(LAVA_BATTLESTAFF_21198)), item(BLACK_DHIDE_VAMB), item(MIND_SHIELD)), new EmoteClue("Yawn in the centre of Arceuus library. Nod your head before you talk to me. Equip blue dragonhide vambraces, adamant boots and an adamant dagger.", "Arceuus library", ENTRANCE_OF_THE_ARCEUUS_LIBRARY, new WorldPoint(1632, 3807, 0), YAWN, YES, item(BLUE_DHIDE_VAMB), item(ADAMANT_BOOTS), item(ADAMANT_DAGGER)), - new EmoteClue("Swing a bullroarer at the top of the watchtower. Beware of double agents! Equip a dragon plateskirt, climbing boots and a dragon chainbody.", "Yanille watchtower", TOP_FLOOR_OF_THE_YANILLE_WATCHTOWER, new WorldPoint(2932, 4712, 0), BULL_ROARER, item(DRAGON_PLATESKIRT), item(CLIMBING_BOOTS), item(DRAGON_CHAINBODY_3140), item(ItemID.BULL_ROARER)), + new EmoteClue("Swing a bullroarer at the top of the watchtower. Beware of double agents! Equip a dragon plateskirt, climbing boots and a dragon chainbody.", "Yanille watchtower", TOP_FLOOR_OF_THE_YANILLE_WATCHTOWER, new WorldPoint(2932, 4712, 0), BULL_ROARER, any("Dragon plateskirt", item(DRAGON_PLATESKIRT), item(DRAGON_PLATESKIRT_G)), item(CLIMBING_BOOTS), any("Dragon chainbody", item(DRAGON_CHAINBODY_3140), item(DRAGON_CHAINBODY_G)), item(ItemID.BULL_ROARER)), new EmoteClue("Blow a raspberry at Gypsy Aris in her tent. Equip a gold ring and a gold necklace.", "Varrock", GYPSY_TENT_ENTRANCE, new WorldPoint(3203, 3424, 0), RASPBERRY, item(GOLD_RING), item(GOLD_NECKLACE)), new EmoteClue("Bow to Brugsen Bursen at the Grand Exchange.", "Grand Exchange", null, new WorldPoint(3164, 3477, 0), BOW), new EmoteClue("Cheer at Iffie Nitter. Equip a chef hat and a red cape.", "Varrock", FINE_CLOTHES_ENTRANCE, new WorldPoint(3205, 3416, 0), CHEER, item(CHEFS_HAT), item(RED_CAPE)), From ab42442269ecd66df261cd896a30c1ce44d52301 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 2 Mar 2020 18:27:26 -0500 Subject: [PATCH 06/20] point: lombokize --- .../src/main/java/net/runelite/api/Point.java | 71 +------------------ 1 file changed, 3 insertions(+), 68 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Point.java b/runelite-api/src/main/java/net/runelite/api/Point.java index 1c97a43666..f84ad39707 100644 --- a/runelite-api/src/main/java/net/runelite/api/Point.java +++ b/runelite-api/src/main/java/net/runelite/api/Point.java @@ -24,46 +24,17 @@ */ package net.runelite.api; +import lombok.Value; + /** * A two-dimensional coordinate on the canvas. */ +@Value public class Point { private final int x; private final int y; - public Point(int x, int y) - { - this.x = x; - this.y = y; - } - - @Override - public String toString() - { - return "Point{" + "x=" + x + ", y=" + y + '}'; - } - - /** - * Gets the x-axis coordinate of the point. - * - * @return the x-axis coordinate - */ - public int getX() - { - return x; - } - - /** - * Gets the y-axis coordinate of the point. - * - * @return the y-axis coordinate - */ - public int getY() - { - return y; - } - /** * Gets the distance between this point and another. * @@ -74,40 +45,4 @@ public class Point { return (int) Math.hypot(getX() - other.getX(), getY() - other.getY()); } - - @Override - public int hashCode() - { - int hash = 3; - hash = 23 * hash + this.x; - hash = 23 * hash + this.y; - return hash; - } - - @Override - public boolean equals(Object obj) - { - if (this == obj) - { - return true; - } - if (obj == null) - { - return false; - } - if (getClass() != obj.getClass()) - { - return false; - } - final Point other = (Point) obj; - if (this.x != other.x) - { - return false; - } - if (this.y != other.y) - { - return false; - } - return true; - } } From 080f3133c5c94db601159477741bdc6fe8502d80 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 2 Mar 2020 14:57:59 -0500 Subject: [PATCH 07/20] tooltips overlay: fix multiple above-cursor tooltips Previously this would only render one tooltip above the cursor with the rest below. This also rewrites the existing logic to be cleaner --- .../ui/overlay/tooltip/TooltipOverlay.java | 41 ++++--------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/TooltipOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/TooltipOverlay.java index f269a797b5..314adffee0 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/TooltipOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/TooltipOverlay.java @@ -44,7 +44,6 @@ import net.runelite.client.ui.overlay.components.TooltipComponent; public class TooltipOverlay extends Overlay { private static final int UNDER_OFFSET = 24; - private static final int ABOVE_OFFSET = -20; private static final int PADDING = 2; private final TooltipManager tooltipManager; private final Client client; @@ -84,50 +83,28 @@ public class TooltipOverlay extends Overlay private Dimension renderTooltips(Graphics2D graphics, List tooltips) { - final Rectangle clientCanvasBounds = new Rectangle(client.getRealDimensions()); + final int canvasWidth = client.getCanvasWidth(); + final int canvasHeight = client.getCanvasHeight(); final net.runelite.api.Point mouseCanvasPosition = client.getMouseCanvasPosition(); - final int offset = runeLiteConfig.tooltipPosition() == TooltipPositionType.UNDER_CURSOR ? UNDER_OFFSET : ABOVE_OFFSET; - final Point mousePosition = new Point(mouseCanvasPosition.getX(), mouseCanvasPosition.getY() + offset); - final Rectangle bounds = new Rectangle(getBounds()); - bounds.setLocation(mousePosition); + final Rectangle prevBounds = getBounds(); - if (!clientCanvasBounds.contains(bounds)) - { - final int clientX = (int) clientCanvasBounds.getMaxX(); - final int clientY = (int) clientCanvasBounds.getMaxY(); - final int boundsX = (int) bounds.getMaxX(); - final int boundsY = (int) bounds.getMaxY(); + final int tooltipX = Math.min(canvasWidth - prevBounds.width, mouseCanvasPosition.getX()); + final int tooltipY = runeLiteConfig.tooltipPosition() == TooltipPositionType.ABOVE_CURSOR + ? Math.max(0, mouseCanvasPosition.getY() - prevBounds.height) + : Math.min(canvasHeight - prevBounds.height, mouseCanvasPosition.getY() + UNDER_OFFSET); - if (boundsY > clientY) - { - graphics.translate(0, -bounds.height - offset); - } - - if (boundsX > clientX) - { - graphics.translate(-bounds.width + clientCanvasBounds.width - bounds.x, 0); - } - } - - final Rectangle newBounds = new Rectangle(-1, -1, 0, 0); + final Rectangle newBounds = new Rectangle(tooltipX, tooltipY, 0, 0); for (Tooltip tooltip : tooltips) { final TooltipComponent tooltipComponent = new TooltipComponent(); tooltipComponent.setModIcons(client.getModIcons()); tooltipComponent.setText(tooltip.getText()); + tooltipComponent.setPosition(new Point(tooltipX, tooltipY + newBounds.height)); - if (newBounds.contains(mousePosition)) - { - mousePosition.move(mouseCanvasPosition.getX(), mouseCanvasPosition.getY() + offset + newBounds.height); - } - - tooltipComponent.setPosition(mousePosition); final Dimension dimension = tooltipComponent.render(graphics); // Create incremental tooltip newBounds - newBounds.x = newBounds.x != -1 ? Math.min(newBounds.x, mousePosition.x) : mousePosition.x; - newBounds.y = newBounds.y != -1 ? Math.min(newBounds.y, mousePosition.y) : mousePosition.y; newBounds.height += dimension.height + PADDING; newBounds.width = Math.max(newBounds.width, dimension.width); } From 7ca4a929fe491b8401b04a070b8a655c9f11871b Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Mon, 2 Mar 2020 19:07:36 -0800 Subject: [PATCH 08/20] item stats: Fix tooltip stab bonus comparison This fixes the bug introduced in commit af00494a which incorrectly compared the attack speed field and labeled it "Stab" in the item stats tooltip. Fixes runelite/runelite#10926 --- .../net/runelite/client/plugins/itemstats/ItemStatOverlay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java index d7fd9dae08..0fe410c563 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java @@ -281,7 +281,7 @@ public class ItemStatOverlay extends Overlay b.append(buildStatRow("Magic Dmg", currentEquipment.getMdmg(), e.getMdmg(), false, true)); final StringBuilder abb = new StringBuilder(); - abb.append(buildStatRow("Stab", currentEquipment.getAspeed(), e.getAspeed(), false, false)); + abb.append(buildStatRow("Stab", currentEquipment.getAstab(), e.getAstab(), false, false)); abb.append(buildStatRow("Slash", currentEquipment.getAslash(), e.getAslash(), false, false)); abb.append(buildStatRow("Crush", currentEquipment.getAcrush(), e.getAcrush(), false, false)); abb.append(buildStatRow("Magic", currentEquipment.getAmagic(), e.getAmagic(), false, false)); From f5a80b6c910a0a651e6ce4776bd8dff4add19a0b Mon Sep 17 00:00:00 2001 From: JZomerlei Date: Tue, 3 Mar 2020 02:09:49 -0500 Subject: [PATCH 09/20] Change to use github link instead of email (#10934) --- .../client/plugins/woodcutting/WoodcuttingPluginTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java index ed9c6a599a..82111a8cbc 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/woodcutting/WoodcuttingPluginTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Jordan Zomerlei + * Copyright (c) 2020, Jordan Zomerlei * Copyright (c) 2019, Adam * All rights reserved. * From c2de595bc31d869a9e467664764987fe4a36ddd3 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 4 Mar 2020 11:35:17 -0500 Subject: [PATCH 10/20] itemcharges: move matchers after message type check --- .../plugins/itemcharges/ItemChargePlugin.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java index 854ce32f82..d99e6fdaa2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java @@ -206,20 +206,20 @@ public class ItemChargePlugin extends Plugin @Subscribe public void onChatMessage(ChatMessage event) { - String message = event.getMessage(); - Matcher dodgyCheckMatcher = DODGY_CHECK_PATTERN.matcher(message); - Matcher dodgyProtectMatcher = DODGY_PROTECT_PATTERN.matcher(message); - Matcher dodgyBreakMatcher = DODGY_BREAK_PATTERN.matcher(message); - Matcher bindingNecklaceCheckMatcher = BINDING_CHECK_PATTERN.matcher(event.getMessage()); - Matcher bindingNecklaceUsedMatcher = BINDING_USED_PATTERN.matcher(event.getMessage()); - Matcher ringOfForgingCheckMatcher = RING_OF_FORGING_CHECK_PATTERN.matcher(message); - Matcher amuletOfChemistryCheckMatcher = AMULET_OF_CHEMISTRY_CHECK_PATTERN.matcher(message); - Matcher amuletOfChemistryUsedMatcher = AMULET_OF_CHEMISTRY_USED_PATTERN.matcher(message); - Matcher amuletOfBountyCheckMatcher = AMULET_OF_BOUNTY_CHECK_PATTERN.matcher(message); - Matcher amuletOfBountyUsedMatcher = AMULET_OF_BOUNTY_USED_PATTERN.matcher(message); - if (event.getType() == ChatMessageType.GAMEMESSAGE || event.getType() == ChatMessageType.SPAM) { + String message = event.getMessage(); + Matcher dodgyCheckMatcher = DODGY_CHECK_PATTERN.matcher(message); + Matcher dodgyProtectMatcher = DODGY_PROTECT_PATTERN.matcher(message); + Matcher dodgyBreakMatcher = DODGY_BREAK_PATTERN.matcher(message); + Matcher bindingNecklaceCheckMatcher = BINDING_CHECK_PATTERN.matcher(message); + Matcher bindingNecklaceUsedMatcher = BINDING_USED_PATTERN.matcher(message); + Matcher ringOfForgingCheckMatcher = RING_OF_FORGING_CHECK_PATTERN.matcher(message); + Matcher amuletOfChemistryCheckMatcher = AMULET_OF_CHEMISTRY_CHECK_PATTERN.matcher(message); + Matcher amuletOfChemistryUsedMatcher = AMULET_OF_CHEMISTRY_USED_PATTERN.matcher(message); + Matcher amuletOfBountyCheckMatcher = AMULET_OF_BOUNTY_CHECK_PATTERN.matcher(message); + Matcher amuletOfBountyUsedMatcher = AMULET_OF_BOUNTY_USED_PATTERN.matcher(message); + if (config.recoilNotification() && message.contains(RING_OF_RECOIL_BREAK_MESSAGE)) { notifier.notify("Your Ring of Recoil has shattered"); From 04519445228dba7b7cde6edf67a060a9776cbf66 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Wed, 4 Mar 2020 13:55:03 -0800 Subject: [PATCH 11/20] itemstats: Fix unarmed attack speed Since the writing of this plugin, the wiki has changed the format for weapon attack speeds[1] and now displays weapon attack speeds in length of game ticks. Hence, since unarmed attacks are at the rate of once every 4 game ticks, this commit updates our definition of the unarmed attack accordingly. [1] https://oldschool.runescape.wiki/w/Unarmed?diff=8467472&oldid=7810087 --- .../plugins/itemstats/ItemStatOverlay.java | 8 +- .../itemstats/ItemStatOverlayTest.java | 81 +++++++++++++++++++ 2 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 runelite-client/src/test/java/net/runelite/client/plugins/itemstats/ItemStatOverlayTest.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java index 0fe410c563..3b49d1c6c3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.itemstats; +import com.google.common.annotations.VisibleForTesting; import com.google.inject.Inject; import java.awt.Color; import java.awt.Dimension; @@ -48,10 +49,11 @@ import net.runelite.http.api.item.ItemStats; public class ItemStatOverlay extends Overlay { - // Unarmed attack speed is 6 - private static final ItemStats UNARMED = new ItemStats(false, true, 0, 0, + // Unarmed attack speed is 4 + @VisibleForTesting + static final ItemStats UNARMED = new ItemStats(false, true, 0, 0, ItemEquipmentStats.builder() - .aspeed(6) + .aspeed(4) .build()); @Inject diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/itemstats/ItemStatOverlayTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/itemstats/ItemStatOverlayTest.java new file mode 100644 index 0000000000..e4ea426dab --- /dev/null +++ b/runelite-client/src/test/java/net/runelite/client/plugins/itemstats/ItemStatOverlayTest.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2020 Jordan + * 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.itemstats; + +import net.runelite.api.EquipmentInventorySlot; +import net.runelite.http.api.item.ItemEquipmentStats; +import net.runelite.http.api.item.ItemStats; +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class ItemStatOverlayTest +{ + // Weapon definitions + private static final ItemStats ABYSSAL_DAGGER = new ItemStats(false, true, 0.453, 8, + ItemEquipmentStats.builder() + .slot(EquipmentInventorySlot.WEAPON.getSlotIdx()) + .astab(75) + .aslash(40) + .acrush(-4) + .amagic(1) + .dmagic(1) + .str(75) + .aspeed(4) + .build()); + private static final ItemStats KATANA = new ItemStats(false, true, 0, 8, + ItemEquipmentStats.builder() + .slot(EquipmentInventorySlot.WEAPON.getSlotIdx()) + .astab(7) + .aslash(45) + .dstab(3) + .dslash(7) + .dcrush(7) + .drange(-3) + .str(40) + .aspeed(4) + .build()); + private static final ItemStats BLOWPIPE = new ItemStats(false, true, 0, 0, + ItemEquipmentStats.builder() + .slot(EquipmentInventorySlot.WEAPON.getSlotIdx()) + .arange(60) + .rstr(40) + .aspeed(3) + .build()); + private static final ItemStats HEAVY_BALLISTA = new ItemStats(false, true, 4, 8, + ItemEquipmentStats.builder() + .slot(EquipmentInventorySlot.WEAPON.getSlotIdx()) + .arange(110) + .aspeed(7) + .build()); + + @Test + public void testUnarmedAttackSpeed() + { + assertEquals(ItemStatOverlay.UNARMED.getEquipment().getAspeed(), ABYSSAL_DAGGER.getEquipment().getAspeed()); + assertEquals(ItemStatOverlay.UNARMED.getEquipment().getAspeed(), KATANA.getEquipment().getAspeed()); + assertEquals(-1, BLOWPIPE.getEquipment().getAspeed() - ItemStatOverlay.UNARMED.getEquipment().getAspeed()); + assertEquals(3, HEAVY_BALLISTA.getEquipment().getAspeed() - ItemStatOverlay.UNARMED.getEquipment().getAspeed()); + } +} From bb0e693aea5b7be8dc69d0d0812d6ce868aee6cc Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Wed, 4 Mar 2020 15:41:12 -0800 Subject: [PATCH 12/20] itemstats: Add tooltip string method tests This commit adds tests to ensure proper formatting of the tooltip string so as to prevent bugs like the one fixed by 7ca4a929. --- .../plugins/itemstats/ItemStatOverlay.java | 3 +- .../itemstats/ItemStatOverlayTest.java | 90 +++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java index 3b49d1c6c3..38b8a11c17 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatOverlay.java @@ -236,7 +236,8 @@ public class ItemStatOverlay extends Overlay return b.toString(); } - private String buildStatBonusString(ItemStats s) + @VisibleForTesting + String buildStatBonusString(ItemStats s) { ItemStats other = null; final ItemEquipmentStats currentEquipment = s.getEquipment(); diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/itemstats/ItemStatOverlayTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/itemstats/ItemStatOverlayTest.java index e4ea426dab..b3826df992 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/itemstats/ItemStatOverlayTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/itemstats/ItemStatOverlayTest.java @@ -24,12 +24,33 @@ */ package net.runelite.client.plugins.itemstats; +import com.google.inject.Guice; +import com.google.inject.Inject; +import com.google.inject.testing.fieldbinder.Bind; +import com.google.inject.testing.fieldbinder.BoundFieldModule; +import java.awt.Color; +import net.runelite.api.Client; import net.runelite.api.EquipmentInventorySlot; +import net.runelite.api.InventoryID; +import net.runelite.api.Item; +import net.runelite.api.ItemContainer; +import net.runelite.client.game.ItemManager; +import net.runelite.client.util.Text; import net.runelite.http.api.item.ItemEquipmentStats; import net.runelite.http.api.item.ItemStats; +import org.apache.commons.lang3.StringUtils; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import org.mockito.junit.MockitoJUnitRunner; +@RunWith(MockitoJUnitRunner.class) public class ItemStatOverlayTest { // Weapon definitions @@ -70,6 +91,30 @@ public class ItemStatOverlayTest .aspeed(7) .build()); + @Inject + ItemStatOverlay overlay; + + @Mock + @Bind + Client client; + + @Mock + @Bind + ItemStatConfig config; + + @Mock + @Bind + ItemManager itemManager; + + @Before + public void before() + { + Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); + + when(config.colorBetterUncapped()).thenReturn(new Color(0)); + when(config.colorWorse()).thenReturn(new Color(0)); + } + @Test public void testUnarmedAttackSpeed() { @@ -78,4 +123,49 @@ public class ItemStatOverlayTest assertEquals(-1, BLOWPIPE.getEquipment().getAspeed() - ItemStatOverlay.UNARMED.getEquipment().getAspeed()); assertEquals(3, HEAVY_BALLISTA.getEquipment().getAspeed() - ItemStatOverlay.UNARMED.getEquipment().getAspeed()); } + + @Test + public void testBuildStatBonusString() + { + // Empty equipment (fully unarmed) + final ItemContainer equipment = mock(ItemContainer.class); + when(equipment.getItems()).thenReturn(new Item[0]); + when(client.getItemContainer(InventoryID.EQUIPMENT)).thenReturn(equipment); + + String tooltip; + String sanitizedTooltip; + + tooltip = overlay.buildStatBonusString(ABYSSAL_DAGGER); + sanitizedTooltip = Text.sanitizeMultilineText(tooltip); + assertTrue(sanitizedTooltip.contains("Stab: +75")); + assertTrue(sanitizedTooltip.contains("Slash: +40")); + assertTrue(sanitizedTooltip.contains("Crush: -4")); + assertEquals(2, StringUtils.countMatches(sanitizedTooltip, "Magic: +1")); // Attack and defense + assertTrue(sanitizedTooltip.contains("Melee Str: +75")); + assertFalse(sanitizedTooltip.contains("Speed:")); + + tooltip = overlay.buildStatBonusString(KATANA); + sanitizedTooltip = Text.sanitizeMultilineText(tooltip); + assertTrue(sanitizedTooltip.contains("Stab: +7")); + assertTrue(sanitizedTooltip.contains("Slash: +45")); + assertTrue(sanitizedTooltip.contains("Stab: +3")); // Defense + assertTrue(sanitizedTooltip.contains("Slash: +7")); // Defense + assertTrue(sanitizedTooltip.contains("Crush: +7")); // Defense + assertTrue(sanitizedTooltip.contains("Range: -3")); // Defense + assertTrue(sanitizedTooltip.contains("Melee Str: +40")); + assertFalse(sanitizedTooltip.contains("Speed:")); + + tooltip = overlay.buildStatBonusString(BLOWPIPE); + sanitizedTooltip = Text.sanitizeMultilineText(tooltip); + assertTrue(sanitizedTooltip.contains("Range: +60")); + assertTrue(sanitizedTooltip.contains("Range Str: +40")); + assertTrue(sanitizedTooltip.contains("Speed: -1")); + assertFalse(sanitizedTooltip.contains("Stab:")); + + tooltip = overlay.buildStatBonusString(HEAVY_BALLISTA); + sanitizedTooltip = Text.sanitizeMultilineText(tooltip); + assertTrue(sanitizedTooltip.contains("Range: +110")); + assertTrue(sanitizedTooltip.contains("Speed: +3")); + assertFalse(sanitizedTooltip.contains("Stab:")); + } } From 9c90c0931c65abd6fc63a0a09c38b77a9e7c54dc Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Wed, 4 Mar 2020 19:01:52 -0700 Subject: [PATCH 13/20] ItemVariations: Add opened variants --- .../src/main/resources/item_variations.json | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/resources/item_variations.json b/runelite-client/src/main/resources/item_variations.json index 0e69c66c6b..f69b9ec513 100644 --- a/runelite-client/src/main/resources/item_variations.json +++ b/runelite-client/src/main/resources/item_variations.json @@ -1401,11 +1401,13 @@ ], "coal bag": [ 764, - 12019 + 12019, + 24480 ], "gem bag": [ 766, - 12020 + 12020, + 24481 ], "phoenix crossbow": [ 767, @@ -7609,6 +7611,10 @@ 11736, 11737 ], + "herb box": [ + 11738, + 11739 + ], "armadyl crossbow": [ 11785, 23611 @@ -8271,6 +8277,10 @@ 13222, 13224 ], + "herb sack": [ + 13226, + 24478 + ], "eternal boots": [ 13235, 23644 @@ -8539,6 +8549,10 @@ 13576, 20785 ], + "seed box": [ + 13639, + 24482 + ], "farmers boro trousers": [ 13640, 13641 From d856a2d5e6d3e2d415f953682d5502e200085abd Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 5 Mar 2020 11:33:08 +0000 Subject: [PATCH 14/20] Update Item IDs to 2020-03-05-rev182 --- .../src/main/java/net/runelite/api/ItemID.java | 13 ++++++------- .../src/main/java/net/runelite/api/NullItemID.java | 5 ++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/ItemID.java b/runelite-api/src/main/java/net/runelite/api/ItemID.java index 94258a8f68..d21bb9ddaa 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/ItemID.java @@ -7347,7 +7347,7 @@ public final class ItemID public static final int ABSORPTION_2 = 11736; public static final int ABSORPTION_1 = 11737; public static final int HERB_BOX = 11738; - public static final int OPENED_HERB_BOX = 11739; + public static final int OPEN_HERB_BOX = 11739; public static final int SCROLL_OF_REDIRECTION = 11740; public static final int RIMMINGTON_TELEPORT = 11741; public static final int TAVERLEY_TELEPORT = 11742; @@ -7481,6 +7481,7 @@ public final class ItemID public static final int BOX_OF_CHOCOLATE_STRAWBERRIES = 11912; public static final int BOX_OF_CHOCOLATE_STRAWBERRIES_11914 = 11914; public static final int SLICE_OF_BIRTHDAY_CAKE = 11916; + public static final int SLICE_OF_BIRTHDAY_CAKE_11917 = 11917; public static final int BIRTHDAY_PRESENT = 11918; public static final int COW_MASK = 11919; public static final int DRAGON_PICKAXE = 11920; @@ -11389,8 +11390,8 @@ public final class ItemID public static final int TWISTED_RELICHUNTER_T3_ARMOUR_SET = 24475; public static final int OPEN_HERB_SACK = 24478; public static final int SPICE_RACK = 24479; - public static final int OPENED_COAL_BAG = 24480; - public static final int OPENED_GEM_BAG = 24481; + public static final int OPEN_COAL_BAG = 24480; + public static final int OPEN_GEM_BAG = 24481; public static final int OPEN_SEED_BOX = 24482; public static final int PHOENIX_24483 = 24483; public static final int PHOENIX_24484 = 24484; @@ -11405,11 +11406,9 @@ public final class ItemID public static final int VOLATILE_ORB = 24514; public static final int ELDRITCH_ORB = 24517; public static final int VICTORS_CAPE_1000 = 24520; - public static final int CAT_EARS = 24522; - public static final int LOOSE_CAT_HAIR = 24523; - public static final int GERTRUDES_COMB = 24524; - public static final int CAT_EARS_24525 = 24525; + public static final int CAT_EARS = 24525; public static final int HELL_CAT_EARS = 24527; public static final int LAMP_OF_THE_GATHERER = 24528; + public static final int HARMONY = 24529; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/NullItemID.java b/runelite-api/src/main/java/net/runelite/api/NullItemID.java index aea876c5af..bf0dfd5bce 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullItemID.java @@ -4321,7 +4321,6 @@ public final class NullItemID public static final int NULL_11911 = 11911; public static final int NULL_11913 = 11913; public static final int NULL_11915 = 11915; - public static final int NULL_11917 = 11917; public static final int NULL_11921 = 11921; public static final int NULL_11925 = 11925; public static final int NULL_11927 = 11927; @@ -12906,6 +12905,10 @@ public final class NullItemID public static final int NULL_24518 = 24518; public static final int NULL_24519 = 24519; public static final int NULL_24521 = 24521; + public static final int NULL_24522 = 24522; + public static final int NULL_24523 = 24523; + public static final int NULL_24524 = 24524; public static final int NULL_24526 = 24526; + public static final int NULL_24530 = 24530; /* This file is automatically generated. Do not edit. */ } From e1af1e06b133921e6d891968e940ec519cb2cde2 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 5 Mar 2020 11:33:08 +0000 Subject: [PATCH 15/20] Update Item variations to 2020-03-05-rev182 --- runelite-client/src/main/resources/item_variations.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/resources/item_variations.json b/runelite-client/src/main/resources/item_variations.json index f69b9ec513..b16e46af61 100644 --- a/runelite-client/src/main/resources/item_variations.json +++ b/runelite-client/src/main/resources/item_variations.json @@ -7821,6 +7821,10 @@ 11912, 11914 ], + "slice of birthday cake": [ + 11916, + 11917 + ], "dragon pickaxe": [ 11920, 12797, @@ -9706,9 +9710,5 @@ 24469, 24472, 24475 - ], - "cat ears": [ - 24522, - 24525 ] } \ No newline at end of file From 704f09d9edbd209a670d49885da18a92a34fcc6a Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 5 Mar 2020 11:33:09 +0000 Subject: [PATCH 16/20] Update Object IDs to 2020-03-05-rev182 --- .../java/net/runelite/api/NullObjectID.java | 33 ++----------------- .../main/java/net/runelite/api/ObjectID.java | 14 ++------ 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java b/runelite-api/src/main/java/net/runelite/api/NullObjectID.java index 07a5345876..a8e0db8e3a 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullObjectID.java @@ -13894,7 +13894,8 @@ public final class NullObjectID public static final int NULL_29702 = 29702; public static final int NULL_29703 = 29703; public static final int NULL_29704 = 29704; - public static final int NULL_29706 = 29706; + public static final int NULL_29709 = 29709; + public static final int NULL_29710 = 29710; public static final int NULL_29713 = 29713; public static final int NULL_29714 = 29714; public static final int NULL_29715 = 29715; @@ -18160,7 +18161,6 @@ public final class NullObjectID public static final int NULL_37722 = 37722; public static final int NULL_37723 = 37723; public static final int NULL_37724 = 37724; - public static final int NULL_37725 = 37725; public static final int NULL_37732 = 37732; public static final int NULL_37733 = 37733; public static final int NULL_37734 = 37734; @@ -18329,34 +18329,5 @@ public final class NullObjectID public static final int NULL_37934 = 37934; public static final int NULL_37935 = 37935; public static final int NULL_37950 = 37950; - public static final int NULL_37952 = 37952; - public static final int NULL_37953 = 37953; - public static final int NULL_37954 = 37954; - public static final int NULL_37962 = 37962; - public static final int NULL_37963 = 37963; - public static final int NULL_37964 = 37964; - public static final int NULL_37965 = 37965; - public static final int NULL_37966 = 37966; - public static final int NULL_37967 = 37967; - public static final int NULL_37971 = 37971; - public static final int NULL_37972 = 37972; - public static final int NULL_37973 = 37973; - public static final int NULL_37975 = 37975; - public static final int NULL_37977 = 37977; - public static final int NULL_37978 = 37978; - public static final int NULL_37979 = 37979; - public static final int NULL_37980 = 37980; - public static final int NULL_37981 = 37981; - public static final int NULL_37982 = 37982; - public static final int NULL_37984 = 37984; - public static final int NULL_37985 = 37985; - public static final int NULL_37986 = 37986; - public static final int NULL_37987 = 37987; - public static final int NULL_37988 = 37988; - public static final int NULL_37989 = 37989; - public static final int NULL_37990 = 37990; - public static final int NULL_37991 = 37991; - public static final int NULL_37992 = 37992; - public static final int NULL_37994 = 37994; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/ObjectID.java b/runelite-api/src/main/java/net/runelite/api/ObjectID.java index df53c61a1d..7e2270e14b 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/ObjectID.java @@ -15800,6 +15800,9 @@ public final class ObjectID public static final int CARVED_REDWOOD_29681 = 29681; public static final int CARVED_REDWOOD_29682 = 29682; public static final int CRACK_29705 = 29705; + public static final int POOL_OF_NIGHTMARES = 29706; + public static final int POOL_OF_NIGHTMARES_29707 = 29707; + public static final int SCOREBOARD_29708 = 29708; public static final int NOTICEBOARD_29718 = 29718; public static final int BALLISTA_29719 = 29719; public static final int STAIRCASE_29720 = 29720; @@ -19580,16 +19583,5 @@ public final class ObjectID public static final int DOOR_37938 = 37938; public static final int SCOREBOARD_37949 = 37949; public static final int COFFIN_37951 = 37951; - public static final int LIGHT_37955 = 37955; - public static final int LIGHT_37956 = 37956; - public static final int LIGHT_37957 = 37957; - public static final int LIGHT_37958 = 37958; - public static final int LIGHT_37959 = 37959; - public static final int LIGHT_37960 = 37960; - public static final int BANQUET_TABLE_37968 = 37968; - public static final int PRESENT_TABLE = 37969; - public static final int BIRTHDAY_HAT_TABLE = 37970; - public static final int PARTY_BALLOONS = 37974; - public static final int TABLE_37976 = 37976; /* This file is automatically generated. Do not edit. */ } From 1b46f9b47ab9b51091fab8ac53d88501e03c08fa Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 5 Mar 2020 11:33:10 +0000 Subject: [PATCH 17/20] Update NPC IDs to 2020-03-05-rev182 --- .../src/main/java/net/runelite/api/NpcID.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/NpcID.java b/runelite-api/src/main/java/net/runelite/api/NpcID.java index bdf2409edf..6326854857 100644 --- a/runelite-api/src/main/java/net/runelite/api/NpcID.java +++ b/runelite-api/src/main/java/net/runelite/api/NpcID.java @@ -8429,6 +8429,15 @@ public final class NpcID public static final int SHURA = 9413; public static final int SHURA_9414 = 9414; public static final int ACORN = 9415; + public static final int PHOSANIS_NIGHTMARE = 9416; + public static final int PHOSANIS_NIGHTMARE_9417 = 9417; + public static final int PHOSANIS_NIGHTMARE_9418 = 9418; + public static final int PHOSANIS_NIGHTMARE_9419 = 9419; + public static final int PHOSANIS_NIGHTMARE_9420 = 9420; + public static final int PHOSANIS_NIGHTMARE_9421 = 9421; + public static final int PHOSANIS_NIGHTMARE_9422 = 9422; + public static final int PHOSANIS_NIGHTMARE_9423 = 9423; + public static final int PHOSANIS_NIGHTMARE_9424 = 9424; public static final int THE_NIGHTMARE = 9425; public static final int THE_NIGHTMARE_9426 = 9426; public static final int THE_NIGHTMARE_9427 = 9427; @@ -8466,12 +8475,12 @@ public final class NpcID public static final int THE_NIGHTMARE_9463 = 9463; public static final int THE_NIGHTMARE_9464 = 9464; public static final int INFERNAL_PYRELORD = 9465; - public static final int DRAUL_LEPTOC_9467 = 9467; - public static final int HORACIO_9468 = 9468; - public static final int WISE_OLD_MAN_9469 = 9469; - public static final int HANS_9470 = 9470; - public static final int KING_ROALD_9471 = 9471; - public static final int ELLAMARIA_9472 = 9472; - public static final int GNOME_CHILD_9473 = 9473; + public static final int HUSK_9466 = 9466; + public static final int HUSK_9467 = 9467; + public static final int PARASITE_9468 = 9468; + public static final int PARASITE_9469 = 9469; + public static final int SLEEPWALKER_9470 = 9470; + public static final int SISTER_SENGA = 9471; + public static final int SISTER_SENGA_9472 = 9472; /* This file is automatically generated. Do not edit. */ } From 0fe5642a428f572d37ef3bcb6957745c75d6ca0e Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 5 Mar 2020 11:33:14 +0000 Subject: [PATCH 18/20] Update Widget IDs to 2020-03-05-rev182 --- .../src/main/java/net/runelite/api/widgets/WidgetID.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index 4d1af587bf..97beb54785 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -851,9 +851,9 @@ public class WidgetID static class Options { - static final int MUSIC_SLIDER = 38; - static final int SOUND_EFFECT_SLIDER = 44; - static final int AREA_SOUND_SLIDER = 50; + static final int MUSIC_SLIDER = 37; + static final int SOUND_EFFECT_SLIDER = 43; + static final int AREA_SOUND_SLIDER = 49; } static class AchievementDiary From b60d5428cfaf4838aecd91fb28dbfcfbd2f61a4d Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 5 Mar 2020 11:33:14 +0000 Subject: [PATCH 19/20] Update Scripts to 2020-03-05-rev182 --- .../scripts/ChatboxInputWidgetBuilder.hash | 2 +- .../scripts/ChatboxInputWidgetBuilder.rs2asm | 30 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash b/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash index 696943e422..bc5bde9840 100644 --- a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash +++ b/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash @@ -1 +1 @@ -15660E39A740C416BFD71621A448A96FA6B5C5E8AD212179F3D6785AE35CAA38 \ No newline at end of file +A9BA4723E7D91AD151C1AB3ABEAF84971BFFD71AA8C23E763ECCC8981A8A1429 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm b/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm index c244330a59..3b063e35df 100644 --- a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm +++ b/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm @@ -47,7 +47,7 @@ LABEL23: get_varbit 8119 iconst 1 if_icmpeq LABEL42 - jump LABEL144 + jump LABEL146 LABEL42: iconst 105 iconst 115 @@ -96,11 +96,13 @@ LABEL77: iload 4 iconst 1 if_icmpeq LABEL86 - jump LABEL101 + jump LABEL103 LABEL86: + iconst 60 iconst 5 iload 3 add + invoke 1045 iconst 30 iconst 0 iconst 0 @@ -112,8 +114,8 @@ LABEL86: iconst 2 iconst 10616871 if_setposition - jump LABEL113 -LABEL101: + jump LABEL115 +LABEL103: iconst 0 iconst 30 iconst 0 @@ -126,26 +128,26 @@ LABEL101: iconst 2 iconst 10616871 if_setposition -LABEL113: +LABEL115: iload 3 iconst 10616889 if_getwidth - if_icmpgt LABEL118 - jump LABEL124 -LABEL118: + if_icmpgt LABEL120 + jump LABEL126 +LABEL120: iconst 2 iconst 2 iconst 0 iconst 10616889 if_settextalign - jump LABEL129 -LABEL124: + jump LABEL131 +LABEL126: iconst 0 iconst 2 iconst 0 iconst 10616889 if_settextalign -LABEL129: +LABEL131: iconst 10616889 if_clearops iconst -1 @@ -160,8 +162,8 @@ LABEL129: sconst "" iconst 10616889 if_setonop - jump LABEL185 -LABEL144: + jump LABEL187 +LABEL146: iconst 105 iconst 115 iconst 1894 @@ -203,7 +205,7 @@ LABEL144: sconst "ii" iconst 10616889 if_setonop -LABEL185: +LABEL187: sload 2 iconst 10616889 if_settext From 7c3ff105fb3dca86cdf5e81be0634e5ec9954c88 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 5 Mar 2020 07:11:25 -0500 Subject: [PATCH 20/20] api: update for tinted block and damage hitsplats --- .../main/java/net/runelite/api/Hitsplat.java | 22 ++++++++++++++----- .../idlenotifier/IdleNotifierPlugin.java | 4 ++-- .../idlenotifier/IdleNotifierPluginTest.java | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Hitsplat.java b/runelite-api/src/main/java/net/runelite/api/Hitsplat.java index cb8290d56f..c44bf2dd1b 100644 --- a/runelite-api/src/main/java/net/runelite/api/Hitsplat.java +++ b/runelite-api/src/main/java/net/runelite/api/Hitsplat.java @@ -37,13 +37,21 @@ public class Hitsplat public enum HitsplatType { /** - * Blocking damage (blue). + * Blocking damage by me (blue). */ - BLOCK, + BLOCK_ME, /** - * Taking damage (red). + * Blocking damage by others (blue). */ - DAMAGE, + BLOCK_OTHER, + /** + * Taking damage by me (red). + */ + DAMAGE_ME, + /** + * Taking damage by others (red). + */ + DAMAGE_OTHER, /** * Damage from poison (green). */ @@ -72,8 +80,10 @@ public class Hitsplat { switch (type) { - case 0: return BLOCK; - case 1: return DAMAGE; + case 12: return BLOCK_ME; + case 13: return BLOCK_OTHER; + case 16: return DAMAGE_ME; + case 17: return DAMAGE_OTHER; case 2: return POISON; case 4: return DISEASE; case 5: return VENOM; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java index 637c9e442a..1e26314f00 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java @@ -361,8 +361,8 @@ public class IdleNotifierPlugin extends Plugin final Hitsplat hitsplat = event.getHitsplat(); - if (hitsplat.getHitsplatType() == Hitsplat.HitsplatType.DAMAGE - || hitsplat.getHitsplatType() == Hitsplat.HitsplatType.BLOCK) + if (hitsplat.getHitsplatType() == Hitsplat.HitsplatType.DAMAGE_ME + || hitsplat.getHitsplatType() == Hitsplat.HitsplatType.BLOCK_ME) { lastCombatCountdown = HIGHEST_MONSTER_ATTACK_SPEED; } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPluginTest.java index a722f6a447..59c84d3086 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPluginTest.java @@ -250,7 +250,7 @@ public class IdleNotifierPluginTest // But player is being damaged (is in combat) final HitsplatApplied hitsplatApplied = new HitsplatApplied(); hitsplatApplied.setActor(player); - hitsplatApplied.setHitsplat(new Hitsplat(Hitsplat.HitsplatType.DAMAGE, 0, 0)); + hitsplatApplied.setHitsplat(new Hitsplat(Hitsplat.HitsplatType.DAMAGE_ME, 0, 0)); plugin.onHitsplatApplied(hitsplatApplied); plugin.onGameTick(new GameTick()); verify(notifier, times(0)).notify(any());