From 23997a814f0f7c35f62ad36d9b249f56f3ed7595 Mon Sep 17 00:00:00 2001 From: Trevor Date: Sat, 13 Jun 2020 10:18:28 -0400 Subject: [PATCH 01/45] cache: add healthbar dumper --- .../java/net/runelite/cache/ConfigType.java | 1 + .../definitions/HealthBarDefinition.java | 43 ++++++++ .../definitions/loaders/HealthBarLoader.java | 99 +++++++++++++++++++ .../net/runelite/cache/HealthBarDumper.java | 91 +++++++++++++++++ 4 files changed, 234 insertions(+) create mode 100644 cache/src/main/java/net/runelite/cache/definitions/HealthBarDefinition.java create mode 100644 cache/src/main/java/net/runelite/cache/definitions/loaders/HealthBarLoader.java create mode 100644 cache/src/test/java/net/runelite/cache/HealthBarDumper.java diff --git a/cache/src/main/java/net/runelite/cache/ConfigType.java b/cache/src/main/java/net/runelite/cache/ConfigType.java index 4ca51a0b33..971c9154d6 100644 --- a/cache/src/main/java/net/runelite/cache/ConfigType.java +++ b/cache/src/main/java/net/runelite/cache/ConfigType.java @@ -44,6 +44,7 @@ public enum ConfigType VARCLIENTSTRING(15), VARPLAYER(16), HITSPLAT(32), + HEALTHBAR(33), STRUCT(34), AREA(35); diff --git a/cache/src/main/java/net/runelite/cache/definitions/HealthBarDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/HealthBarDefinition.java new file mode 100644 index 0000000000..970d9e8745 --- /dev/null +++ b/cache/src/main/java/net/runelite/cache/definitions/HealthBarDefinition.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020, Trevor + * 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.cache.definitions; + +import lombok.Data; + +@Data +public class HealthBarDefinition +{ + public int id; + public int field3276; + public int field3277; + public int field3278; + public int field3283; + public int field3272; + public int field3275; + public int healthBarFrontSpriteId; + public int healthBarBackSpriteId; + public int healthScale; + public int healthBarPadding; +} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/HealthBarLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/HealthBarLoader.java new file mode 100644 index 0000000000..c6e49ea88f --- /dev/null +++ b/cache/src/main/java/net/runelite/cache/definitions/loaders/HealthBarLoader.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2020, Trevor + * 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.cache.definitions.loaders; + +import net.runelite.cache.definitions.HealthBarDefinition; +import net.runelite.cache.io.InputStream; + +public class HealthBarLoader +{ + public HealthBarDefinition load(int id, byte[] b) + { + HealthBarDefinition def = new HealthBarDefinition(); + InputStream is = new InputStream(b); + def.id = id; + + while (true) + { + int opcode = is.readUnsignedByte(); + if (opcode == 0) + { + break; + } + + this.decodeValues(opcode, def, is); + } + + return def; + } + + private void decodeValues(int opcode, HealthBarDefinition def, InputStream stream) + { + if (opcode == 1) + { + stream.readUnsignedShort(); + } + else if (opcode == 2) + { + def.field3277 = stream.readUnsignedByte(); + } + else if (opcode == 3) + { + def.field3278 = stream.readUnsignedByte(); + } + else if (opcode == 4) + { + def.field3283 = 0; + } + else if (opcode == 5) + { + def.field3275 = stream.readUnsignedShort(); + } + else if (opcode == 6) + { + stream.readUnsignedByte(); + } + else if (opcode == 7) + { + def.healthBarFrontSpriteId = stream.readBigSmart2(); + } + else if (opcode == 8) + { + def.healthBarBackSpriteId = stream.readBigSmart2(); + } + else if (opcode == 11) + { + def.field3283 = stream.readUnsignedShort(); + } + else if (opcode == 14) + { + def.healthScale = stream.readUnsignedByte(); + } + else if (opcode == 15) + { + def.healthBarPadding = stream.readUnsignedByte(); + } + } +} diff --git a/cache/src/test/java/net/runelite/cache/HealthBarDumper.java b/cache/src/test/java/net/runelite/cache/HealthBarDumper.java new file mode 100644 index 0000000000..3b27fc193e --- /dev/null +++ b/cache/src/test/java/net/runelite/cache/HealthBarDumper.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2020, Trevor + * 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.cache; + +import com.google.common.io.Files; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import lombok.extern.slf4j.Slf4j; +import net.runelite.cache.definitions.HealthBarDefinition; +import net.runelite.cache.definitions.loaders.HealthBarLoader; +import net.runelite.cache.fs.Archive; +import net.runelite.cache.fs.ArchiveFiles; +import net.runelite.cache.fs.FSFile; +import net.runelite.cache.fs.Index; +import net.runelite.cache.fs.Storage; +import net.runelite.cache.fs.Store; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +@Slf4j +public class HealthBarDumper +{ + private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); + + @Rule + public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); + + @Test + @Ignore + public void test() throws IOException + { + File dumpDir = folder.newFolder("healthbars"); + int count = 0; + + try (Store store = new Store(StoreLocation.LOCATION)) + { + store.load(); + + Storage storage = store.getStorage(); + Index index = store.getIndex(IndexType.CONFIGS); + Archive archive = index.getArchive(ConfigType.HEALTHBAR.getId()); + + byte[] archiveData = storage.loadArchive(archive); + ArchiveFiles files = archive.getFiles(archiveData); + + HealthBarLoader loader = new HealthBarLoader(); + + for (FSFile file : files.getFiles()) + { + byte[] b = file.getContents(); + + HealthBarDefinition def = loader.load(file.getFileId(), b); + + if (def != null) + { + Files.asCharSink(new File(dumpDir, file.getFileId() + ".json"), Charset.defaultCharset()).write(gson.toJson(def)); + ++count; + } + } + } + + log.info("Dumped {} healthbars to {}", count, dumpDir); + } +} From 49d4aa08aaebd133c70d5dd50dd9b7424df56ded Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Thu, 18 Jun 2020 04:11:00 -0400 Subject: [PATCH 02/45] FriendsChatConfig: Fix config grammar --- .../client/plugins/friendschat/FriendsChatConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatConfig.java index 5ea7df3635..0859a6c35a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatConfig.java @@ -36,7 +36,7 @@ public interface FriendsChatConfig extends Config @ConfigItem( keyName = "clanChatIcons", name = "Chat Icons", - description = "Show friends chat chat icons next to members.", + description = "Show rank icons next to friends chat members.", position = 1 ) default boolean chatIcons() @@ -131,7 +131,7 @@ public interface FriendsChatConfig extends Config @ConfigItem( keyName = "clanTabChat", name = "Tab Chat", - description = "Allows friends chat chat without prepending '/' to messages when on the friends chat tab", + description = "Message friends chat without appending '/' when the friends chat tab is selected.", position = 8 ) default boolean friendsChatTabChat() @@ -153,7 +153,7 @@ public interface FriendsChatConfig extends Config @ConfigItem( keyName = "showIgnores", name = "Recolor ignored players", - description = "Recolors players that are on your ignore list", + description = "Recolor members who are on your ignore list", position = 10 ) default boolean showIgnores() From ae5125398f9d145aa439a9889aaa6c7e96c719a7 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 18 Jun 2020 15:44:32 -0400 Subject: [PATCH 03/45] client: correct spelling of taverley --- .../client/plugins/cluescrolls/clues/CrypticClue.java | 2 +- .../net/runelite/client/plugins/worldmap/DungeonLocation.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java index 7c3a5b22c0..47f02029b4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java @@ -219,7 +219,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc new CrypticClue("Strength potions with red spiders' eggs? He is quite a herbalist.", "Apothecary", new WorldPoint(3194, 3403, 0), "Talk to Apothecary in the South-western Varrock. (the) apothecary is just north-west of the Varrock Swordshop."), new CrypticClue("Robin wishes to see your finest ranged equipment.", "Robin", new WorldPoint(3673, 3492, 0), "Robin at the inn in Port Phasmatys. Speak to him with +182 in ranged attack bonus. Bonus granted by the toxic blowpipe is ignored."), new CrypticClue("You will need to under-cook to solve this one.", CRATE_357, new WorldPoint(3219, 9617, 0), "Search the crate in the Lumbridge basement."), - new CrypticClue("Search through some drawers found in Taverley's houses.", DRAWERS_350, new WorldPoint(2894, 3418, 0), "The south-eastern most house in Taverly, south of Jatix's Herblore Shop."), + new CrypticClue("Search through some drawers found in Taverley's houses.", DRAWERS_350, new WorldPoint(2894, 3418, 0), "The south-eastern most house in Taverley, south of Jatix's Herblore Shop."), new CrypticClue("Anger Abbot Langley.", "Abbot Langley", new WorldPoint(3058, 3487, 0), "Speak to Abbot Langley in the Edgeville Monastery while you have a negative prayer bonus (currently only possible with an Ancient staff)."), new CrypticClue("Dig where only the skilled, the wealthy, or the brave can choose not to visit again.", new WorldPoint(3221, 3219, 0), "Dig at Lumbridge spawn"), new CrypticClue("Scattered coins and gems fill the floor. The chest you seek is in the north east.", "King Black Dragon", CLOSED_CHEST_375, new WorldPoint(2288, 4702, 0), "Kill the King Black Dragon for a key (elite), and then open the closed chest in the NE corner of the lair."), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonLocation.java index 8505cf70b1..52f4b2b06b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/DungeonLocation.java @@ -165,8 +165,8 @@ enum DungeonLocation SOPHANEM("Sophanem Dungeon", new WorldPoint(3314, 2797, 0)), STRONGHOLD_OF_SECURITY("Stronghold of Security", new WorldPoint(3080, 3420, 0)), STRONGHOLD_SLAYER("Stronghold Slayer Dungeon", new WorldPoint(2427, 3424, 0)), - TAVERLY("Taverly Dungeon", new WorldPoint(2883, 3397, 0)), - TAVERLY_ISLAND("Taverly Dungeon", new WorldPoint(2841, 3424, 0)), + TAVERLEY("Taverley Dungeon", new WorldPoint(2883, 3397, 0)), + TAVERLEY_ISLAND("Taverley Dungeon", new WorldPoint(2841, 3424, 0)), TEMPLE_OF_IKOV("Temple of Ikov", new WorldPoint(2676, 3404, 0)), THEATRE_OF_BLOOD("Theatre of Blood", new WorldPoint(3676, 3219, 0)), TOLNAS_RIFT("Tolna's rift", new WorldPoint(3308, 3450, 0)), From 1975e2c6907172c042fbf3795f856e8a99a78444 Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Thu, 18 Jun 2020 22:09:06 +0100 Subject: [PATCH 04/45] clues: add mention that nechryael has to be in the slayer tower --- .../client/plugins/cluescrolls/clues/SkillChallengeClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java index 768b50c8c1..02a8a15de9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java @@ -155,7 +155,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam new SkillChallengeClue("Smith a runite med helm.", item(ItemID.HAMMER), item(ItemID.RUNITE_BAR)), new SkillChallengeClue("Teleport to a spirit tree you planted yourself."), new SkillChallengeClue("Create a Barrows teleport tablet.", item(ItemID.DARK_ESSENCE_BLOCK), xOfItem(ItemID.BLOOD_RUNE, 1), xOfItem(ItemID.LAW_RUNE, 2), xOfItem(ItemID.SOUL_RUNE, 2)), - new SkillChallengeClue("Kill a Nechryael.", "slay a nechryael in the slayer tower."), + new SkillChallengeClue("Kill a Nechryael in the Slayer Tower.", "slay a nechryael in the slayer tower."), new SkillChallengeClue("Kill a Spiritual Mage while wearing something from their god.", "kill the spiritual, magic and godly whilst representing their own god."), new SkillChallengeClue("Create an unstrung dragonstone amulet at a furnace.", item(ItemID.GOLD_BAR), item(ItemID.DRAGONSTONE), item(ItemID.AMULET_MOULD)), new SkillChallengeClue("Burn a magic log.", item(ItemID.MAGIC_LOGS), item(ItemID.TINDERBOX)), From 0de98f57e88ee5333a6baa4e0b059d6714463ead Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 19 Jun 2020 10:28:37 -0400 Subject: [PATCH 05/45] client: fetch jav_config over https --- .../main/resources/net/runelite/client/runelite.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/resources/net/runelite/client/runelite.properties b/runelite-client/src/main/resources/net/runelite/client/runelite.properties index 801f0cc406..1b94eee370 100644 --- a/runelite-client/src/main/resources/net/runelite/client/runelite.properties +++ b/runelite-client/src/main/resources/net/runelite/client/runelite.properties @@ -9,8 +9,8 @@ runelite.patreon.link=https://www.patreon.com/runelite runelite.wiki.troubleshooting.link=https://github.com/runelite/runelite/wiki/Troubleshooting-problems-with-the-client runelite.wiki.building.link=https://github.com/runelite/runelite/wiki/Building-with-IntelliJ-IDEA#client-failing-to-start runelite.dnschange.link=https://1.1.1.1/dns/ -runelite.jav_config=http://oldschool.runescape.com/jav_config.ws -runelite.jav_config_backup=http://static.runelite.net/jav_config.ws +runelite.jav_config=https://oldschool.runescape.com/jav_config.ws +runelite.jav_config_backup=https://static.runelite.net/jav_config.ws runelite.pluginhub.url=https://repo.runelite.net/plugins runelite.pluginhub.version=${project.version} runelite.imgur.client.id=30d71e5f6860809 \ No newline at end of file From 8b3285144288c6c4e217ed5c951c7780c99de208 Mon Sep 17 00:00:00 2001 From: Oliver Payne Date: Sun, 21 Jun 2020 04:38:28 +0200 Subject: [PATCH 06/45] CoordinateClue: Improve Ice Mountain clue location description (#11907) This change will encourage players to use the monastery teleport instead of teleporting to Edgeville. --- .../client/plugins/cluescrolls/clues/CoordinateClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java index cdf5b1a300..8d9a462118 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CoordinateClue.java @@ -103,7 +103,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati .put(new WorldPoint(2387, 3435, 0), new CoordinateClueInfo("West of Tree Gnome Stronghold, near the pen containing terrorbirds.")) .put(new WorldPoint(2512, 3467, 0), new CoordinateClueInfo("Baxtorian Falls (Bring rope).")) .put(new WorldPoint(2381, 3468, 0), new CoordinateClueInfo("West of Tree Gnome Stronghold, north of the pen with terrorbirds.")) - .put(new WorldPoint(3005, 3475, 0), new CoordinateClueInfo("Ice Mountain, west of Edgeville.")) + .put(new WorldPoint(3005, 3475, 0), new CoordinateClueInfo("Ice Mountain, west of Edgeville Monastery.")) .put(new WorldPoint(2585, 3505, 0), new CoordinateClueInfo("By the shore line north of the Coal Trucks.")) .put(new WorldPoint(3443, 3515, 0), new CoordinateClueInfo("South of Slayer Tower (CKS).")) .put(new WorldPoint(2416, 3516, 0), new CoordinateClueInfo("Tree Gnome Stronghold, west of Grand Tree, near swamp.")) From 3183ceebc99ef8a4d63e359f2cd922043e48c23b Mon Sep 17 00:00:00 2001 From: Joseph Zeffiro <32608602+zeffirojoe@users.noreply.github.com> Date: Sun, 21 Jun 2020 01:15:50 -0400 Subject: [PATCH 07/45] mousehighlight: Add toggle to hide spellbook tooltips (#11924) This prevents mouse tooltips from covering the vanilla client spell tooltips. --- .../plugins/mousehighlight/MouseHighlightConfig.java | 11 +++++++++++ .../plugins/mousehighlight/MouseHighlightOverlay.java | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlightConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlightConfig.java index 1c23e334cd..dd1ab5fb20 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlightConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlightConfig.java @@ -52,4 +52,15 @@ public interface MouseHighlightConfig extends Config { return true; } + + @ConfigItem( + position = 2, + keyName = "disableSpellbooktooltip", + name = "Disable Spellbook Tooltips", + description = "Disable Spellbook Tooltips so they don't cover descriptions" + ) + default boolean disableSpellbooktooltip() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlightOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlightOverlay.java index 22f9691bd3..4a8e1026e6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlightOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mousehighlight/MouseHighlightOverlay.java @@ -33,6 +33,7 @@ import net.runelite.api.MenuAction; import net.runelite.api.MenuEntry; import net.runelite.api.VarClientInt; import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.OverlayPosition; @@ -116,6 +117,11 @@ class MouseHighlightOverlay extends Overlay return null; } + if (config.disableSpellbooktooltip() && groupId == WidgetID.SPELLBOOK_GROUP_ID) + { + return null; + } + if (widget != null) { // If this varc is set, some CS is showing tooltip From 2ad0ea80dcd77f109238667e8d0c50ab8867af0b Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sun, 21 Jun 2020 15:57:26 -0700 Subject: [PATCH 08/45] worldmap: Add Drakan's medallion teleport locations --- .../plugins/worldmap/TeleportLocationData.java | 2 ++ .../worldmap/drakans_medallion_teleport_icon.png | Bin 0 -> 6890 bytes 2 files changed, 2 insertions(+) create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/drakans_medallion_teleport_icon.png diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java index 5a28519bc6..87eee1b1bb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java @@ -143,6 +143,8 @@ enum TeleportLocationData CAMULET_TEMPLE(TeleportType.OTHER, "Camulet", "Enakhra's Temple", new WorldPoint(3190, 2923, 0), "camulet_teleport_icon.png"), TELEPORT_CRYSTAL_LLETYA(TeleportType.OTHER, "Teleport crystal", "Lletya", new WorldPoint(2330, 3172, 0), "teleport_crystal_icon.png"), TELEPORT_CRYSTAL_PRIFDDINAS(TeleportType.OTHER, "Teleport crystal", "Prifddinas", new WorldPoint(3264, 6065, 0), "teleport_crystal_icon.png"), + DRAKANS_MEDALLION_VER_SINHAZA(TeleportType.OTHER, "Drakan's medallion", "Ver Sinhaza", new WorldPoint(3649, 3230, 0), "drakans_medallion_teleport_icon.png"), + DRAKANS_MEDALLION_DARKMEYER(TeleportType.OTHER, "Drakan's medallion", "Darkmeyer", new WorldPoint(3592, 3337, 0), "drakans_medallion_teleport_icon.png"), // Wilderness OBELISK_13(TeleportType.OTHER, "Obelisk", "13", new WorldPoint(3156, 3620, 0), "obelisk_icon.png"), diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/drakans_medallion_teleport_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/drakans_medallion_teleport_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0f37fb27bf319fbba3bb733643306964318697f2 GIT binary patch literal 6890 zcmV zaB^>EX>4U6ba`-PAZ2)IW&i+q+O?Z$a$~!ar2k_Ty@Z1qSPn+B-a#$DKL-wVmE-Mt z)h$_y6h&f+2oLu_q*?#P&*PkP^wembM~bsK+r-G5Evepr$HXXYRN(7bKW_pfhfxA!c2 zue-Yz5+{|+yQ$As&NJTFIZA&%miW&6i#*TgyYgMw;=p1PYj(bevDG?Gd)r{AZFbvr z9)}$)F}US2kIoIwU9T0NU3J6D1VP_+yX>o<#usceu$t#(_q7&#=B;PGVGA=)%R8NA zFv}-?`8L0M@jvTY=-#p(8>#<-w z$6VN8d-@%sNBfU&`D16#`{EPKb3?=C`3}GlF?VD!)?G}SkZ6+*;+awzyvBYJ{~F{YSf zi8Z$5Q%EtTl#?*3WuHTiIpv&7uDKOoLWw1nTuP~>RaZR_7Hg{6)KY70jY%6rH$L5X zM{C`6-$Rc*_1sIZy$#%Fgb_y?d6ZE{n{N6^_|G)6nPt}5mR-2g3M;O(@+zyYw(+&? zci3^Kop;%Fw=b)`R{hax_9x5z-D>u=nk*L1`|>|l(`Ls-E{l+Cc13l@uKSpbK2 zve{E?2u_xh&7SHAis-PKjWW)(vKST&%euJjm+k(s++XcxV)$>_&Hc%8MyC6JVL2ny zy_WmcZojeGY$v1mV<1JL&h+scVB-y|G*_B((trGD{-*={-wm`jfU&Gib*9*AF5NAx zzB#(wTd8TpIb7J*b<;|k+m^AOvihidtUjCHeA@44YM_ZXwwM8X8~ADC0$-oVdqQ@7 z?A@Q-x8ZySL(I7f=k~7Pj`8yd{1{-#VoAH%yn`Z!)$@}TrL%{THAD$v56{!!_NsC3 z0xt10o(Y~(cS&ce68CgnPg(qa+B|1;7V?*^d|wEke3v30&|-LWoz<9kIbVwbAm8OE zsok~QCA|y!ww!lCkCtSb``5FH%jxen=de1CoCi?WpGiaEg*C&Ai zIj$$K7&jP@OUNTJeYK;FGu^POa@gJlHnV+h$5$W`@00)Tqo1iS&Z~Go@C5h~yNLtq zx1Q`yrB1g6{CN|>fgBxzFP!INXQ*w>v)9Duc~W!`6?oxnjrJbT>0ciUv!5;Wr}%5? zE;n;p1aCV>AN$e}?a^p~*vFGhoI2^&^SI^>50)9V)$?2FZH?<`a0@?dUDv19T%K*z zsBPprm+{aFzuAyqG1LcKOv(9HZ0s{&gU5~ugyb0Te#>-`plY_|Fl4y$BgNR5h!v0dY_hRFO0>2jH=ZPy|dR@pC>iwvc0T>P;Kfa`7M;(FK|c6@3F#0+*G*u^Cxtd3Ad zJCqz}?I4EAlCS0nu(1-R91=-2=SCdo*&KOq1khsfq!uzV z7P7HCtFhsIy&?pKT5gp;`){0N?|>-E*EnCEOzuA)e_dIQ?D}#X z?2Sb`6^cE6_u)-uPbU=fXf=?;2VQN6#fM{z4Mf;wo`ZFqSQWhw_BcX_qp}$QOTHeZ zt$uklKfI7-4ex=6RjNGYsS^g!N&Q3yd52)Cy(ZWNI6IGP2yuh9=KDx+|VimC+pGYaOn$VKniC zNM7?An9>7VFw?aKfO1^L<=J~}woKFy z*#T&JYChmJ8@s*xAcr`C7UU|Ra*N)UTSE84t5|2q`ONEK0VgyUi!3u;aBJ87s+~)F zf&c9VT4RaWk#LM_M%!&J#d~6bkk3_IOiyD`Qdo6lJ3ZjwQ=cfYyJq9G$$}Y=cs@(IO-8NXKGb?9rldq&nJ4q*r zxQ&(g-G{I%>hgBb*v_AI27~>wCqkRBUHf{}wrG*E6?u^pUn8w5dICZa*sK_cx1rXt z&boVEnk$Y0rNy4X*^^UdcBmuJ=(ycW7Z{FEfLA&(1!fF_H!!+)aR^R#3i|BUQB35P z5S>^x8&Z-XwYFy8nG&VT%E>%&lWFoxVDP6(PGTeMWKGgOC-sQwmxdzNK+DaE6h(65 zpv!swP)iv4Fl-S{F?=r`R*jpcRW5N5`EvDTOqFS4hWg>V*IsEc+(?SO4PAnY7E)6N z;Q}BX>;f4EJf{0lN(^gN%TGz0+^q4F%nsdAmTCv|aU~xQ+;v4iD^%WJ`S1M1=sg-F z_Rk=p-a+OWWcB{wj>^5tDZWhNlvooPS@|%7GnDy(^WgcVD?efm*h`Ov6oWTe#0duJ zXape%)M%u`JF!K}X9;E~ZB49`l_&85=hk&HG)lX~=Go-m8IVLPfjGf$yc27kyk92# z-EQL+_Q)>q=AGLpjlINAL>)KWsvAsP3?K+YZW1b9hZD>MeK_y&UP0Rdtw0O|$C(U2 z$FQV^v+SeK46fnm&QxK-d!q_|lq}*p+qE zLLGk*n!zZioW5$V$Rk2eVBm{!*g3ahA;6Ds~ux3mcaCH}Is?sAn3ZPy* zEbTXZCZDOSL-(%`g$eT7-Q!h|7Ma`|%wPD;nU#Kdqe=<=aJZRkCgC=$qrfCAO}IJq zZsJC!_?^aIRi{z4vN z9GkSdiYj?0k;8jy6fa*eVbW0~S3m`zUn!&LiQOr7OSopRM(X~#Nsx4NS;}pBo z0O}|D9Wstj5w>LG()fEOlln*=wIOAQlFKPQlO>XLPC9WNaL@tXETSXK_VA-9zt>!k z;{+#J=ow1=vfE4Hp$?J8e!;_^t+33wU zV0beyjCq5e7$9Y)vw03-Hy8!11Zo}^W+#dF;5GmpY6`?q3@}Jr15Ow7G!JtUtK(&j zIlj_3PqCKL(}~ygbDZJ``{PZHRG!aav)AiQi3D;6zKmZ32mcvZ^Z|EMMdddYC-Xr9 zLC9ai0arspl{Gg=w`%DFzZoK2Zc%tQT2dg_p6Ksz zePvP|y+8x}j>ya!MbXZ2bt{cK-Gbp@-vMf{2Qp7ZNcV`{z&wMrwLl5)iQ6$vzqPZI zBFLEXaox34Tugf*5Z$X8=W}BZHk}SaE~#o#L-Z)VX?uiyxH$Q0kz)aCDh#D(W|k90 z__^~Q;sxqn64MABBQHLC&CA~;r0JUQO3XAq6Syb<&QKCf3-50u$|8uLHl|IC&4sg@^4lS^Bxonu`doa@w@o* z;2yrg8U0(%(7;!OY3P@?pp*9p#D9G{Ii-QA(22P8YSJ-N&wV@M<)k1$=(#7<6eLCuDDbkTfbHb z%@1Y5Vl7$!Pj!nAlzxEpJB&_%?I#!gc&PkSn!5i&9A?;WHogFQ;M2UTIS9&-^3RWV zzP@=j_41iNt@cfj-yQ3BtYoc~CIKQVSu%|(j9_pt4nA!aBfS{WQnJ6+ClU@ve+eJx zz@ejSI||PpvAo7BmVFy223;0FN61?$jUffe=|!dLP_(Sd^I}z1^in!t74oH)1KE*akDw`B^dk*f|36=qw?nkpv z1Twjw5uCkJv?zCGKS>fO*?8-WqE7xjI~5fIFV+z*`n&Pw!CeV7z74$g*7GI zwh!iX?a*s*45?ZV04GY^yle$i7`F>jC^sv95GB1jX#9 z;^oLZe~gYl5e;2u{2@XvhW|ZAzS9iz6VG^~Z`dk>z6DuBHua~(ebrfLQd#5fz;4xo71P4`5yjuihTgU= z5=eXyW@B5jt218oDogG#FEOQ3*J1sqI*jw!R}(~qdbagW*kEk<)B>@S2AS&GdA>V z7@42q2$bC|XIz2v4k`#v2Pf?w9?)FJ4lEy%sjGUd_2{yZ11rs34}EaLBXw9pJ36OH z=KyPjO7A!rdwB*KGtL;T%)71zoQ_AN6WKMD@gD zx^fxTLY9>{f|f6X*OF3H10X7`>1Oa&oH2B^E}5 zZI61`{bKXrTIk!8Cka}~4vej)wFSAHkVFoQv<8-iQ!Cm@+n2a%{b?elYgt^S<@6w{ zoC=^#0}=S`YT9!c7dnBeX9Sjj&a{(tvgH_1Ck}-R9mp4zV8Bt;={(HU$<2~%k7J@~ zu!ziZ*{h_>oMgMcTFrnT09&gr6*jV@XAfOOjWqMea;_>^{d3nwJb&uJ{Vg{5x@sxw zQ|2D;DHns|X(fL^n?5Ri_lGR#=Xti%$kr)Bl*nA}iH>W3h+L-ONgvw+h+ z&RH(Rr+Hc`{t`@P#alCQlD|#+&sl9*S~$`j7u!#-OdOs;#94A$1=I#{l>c&3H{V(R zc$XH(dr6AL-fL1;jC+}_ds5K;+i>{xy|r=V39AN)x^vShYHaj zrt)IN0*+*AhUpJCX zX_8?|psaVQae)*a)}sq!7(F>l3D>PtbB1m(??^M9h6_&HIm3$AATB^INZ%wdlBkbn z7yktf)VIQhR*A$d)261k94M&74Jg**2xe|&tKh&aGH(}-$E6GY%dI&H{8ucvf%P5H z;a5h?TG)X;+E_V0I!W22nf@<#HRCM|tMJVZ>sy6~opm_g@LT}O4l=HG7>aPvzEeBB~C;2{G4DWdmxtAD(aGQT9`zao$d@d%FnD4jfN zN%8$=OLOmgBO04n@IHGaQX^$`U_063R9-3}CwbPX-+W!qIbCk*ZZY3WsC-&?oUSl~ zuIO0UKq8|5L%lcKBVJ*5K@Vwg)sNvB>J z2+M;i37nE;OK@;_UBI=01eH4z{$UWR4wyOPxJpPCahh9xxBF(`naSXgY)Asq0r#8( zgQA3WOONLa)Q>?g!|Ds1xu9u>`frGF?{F+TbVFl%f!;MX1=Is5O15lz)%^%tg7B=L z^5G2*U4_|0pWtBqL!a_tPx-K?KGlCs`VYD(V_E_ca8g+a2QUznR7NFh>RQv=`bYz? zO$96~yo7oDZ~@h=*d5BbtFr_+x15nmq8SFGOE9N)ShXbgQV>_8EYc}#%JzKnS#)3d z>|7NH_^cX>_9@n#B&-selJMCmY50nESZ%VPAv-JStG8vT(WZjoZ*NOR#U^0nHn*rl zx}qTOEdicVNnY=T%-67`=6@xG^Z$iOVS*{!EOcHdvl|(Afue$ zj$%%JzukzZ&E;GZE6SVs^ttG&fYm^3)OajPDuw=N5VUEY&ts#SF|InQ5O>^N?; z@Xdfa0zgy0W!=+Gb;bMJPUTNK)w$UVy7&2Nr&42C`0A!A>Z~jM1hHBZPfOn0n)tTl zWwmuNHC~jVq+7yUq8E2tC0|=WU&}PL2mL3Oap5e~lIP)b^GyP|FV%J0CG;ztj=X`_ zrlf{WKy0(_l5Y8sW$Q{p1p3@as2ZybOnhy7`e)p|1W#(rQ%x5-71R&Ni3JNVPoo>O zO6o}6260fBq5ju}3bSz3fN|n_t3e<=E|{Lx^TH`~0h1*Vrsr(Win=N(wp2AU5`k)^ zsoxxnm|?8`>Cb$<<6AZ5bZCaJ4!^fU^X>3^J2cO|(m3}WpxCXN%JY&vEkkILm<~TR zAJ6>JF*}Y`ntgYm0sA0zPnctj>h^YsG$>)LXAgLl0fZBB6mAkvgXyU0KWfr8-|pV< zI&!>&~Z40&9+B_(H z+nC*W+n7lir;S-AS^oQyJ`1|bxyevx^l9;am-AW7T}pYi$-9(udGRjhEamvvU5D9U z%MkDX^Fsb~HY}$P=a=!f+$5OK?+xh{6Slh3S#|96hi&0XTLP_lNW|^BmkxMP>7TB9 z%P&a8ewywbz7`}>${x~)zbOmd>(%E!ZPNb#H;|Z3g;4$<{jo!!1&*{j0000yP)t-s z00000009*d5nKiUFd!g5Gyp<9Jw-r3V^9EAP*7V{RcByed2w*DY!#J-0EvKqkcNiE ze=?|?o4>!m&8PXx00001bW%=J06^y0W&i*H0b)x>L;#2d9Y_EG010qNS#tmYE+YT{ zE+YYWr9XB6000McNlirue%pTJoPt!J62kG7h&wb924KEz^ kJPmU5SOx-`zxhA=-Jd-N!kT}e4gdfE07*qoM6N<$f+bBu#Q*>R literal 0 HcmV?d00001 From e4c818d4a5a27bf3ad08cc47bbf749af60be2aad Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sun, 21 Jun 2020 15:58:01 -0700 Subject: [PATCH 09/45] worldmap: Add Daeyalt essence mine tooltip --- .../runelite/client/plugins/worldmap/MiningSiteLocation.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSiteLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSiteLocation.java index ff777d0f4f..e1d0653209 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSiteLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MiningSiteLocation.java @@ -65,6 +65,7 @@ enum MiningSiteLocation CRANDOR_NORTH_WEST(new WorldPoint(2831, 3296, 0), new Rock(7, Ore.COAL), new Rock(1, Ore.MITHRIL)), CRANDOR_SOUTH_EAST(new WorldPoint(2835, 3245, 0), new Rock(3, Ore.COAL), new Rock(3, Ore.ADAMANTITE)), CRANDOR_SOUTH_WEST(new WorldPoint(2819, 3247, 0), new Rock(7, Ore.MITHRIL)), + DAEYALT_ESSENCE_MINE(new WorldPoint(3631, 3340, 0), new Rock(3, Ore.DAEYALT_ESSENCE)), DESERT_MINING_CAMP_SURFACE(new WorldPoint(3299, 3021, 0), true, new Rock(4, Ore.COPPER), new Rock(4, Ore.TIN), new Rock(3, Ore.IRON), new Rock(4, Ore.COAL)), // DESERT_MINING_CAMP_UNDERGROUND -- NOT AVAILABLE ON WORLDMAP DORGESH_KAAN_NORTH(new WorldPoint(3309, 9645, 0), new Rock(1, Ore.IRON), new Rock(9, Ore.SILVER)), @@ -232,6 +233,7 @@ enum MiningSiteLocation COAL("Coal"), SANDSTONE("Sandstone"), DENSE_ESSENCE("Dense essence"), + DAEYALT_ESSENCE("Daeyalt essence"), GOLD("Gold"), GEM_ROCK("Gem rock"), HARD_ROCK("Hard rock"), From da9de0940c9b8d77d9504a1c7b4fc5807c380ffa Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 21 Jun 2020 22:51:12 -0400 Subject: [PATCH 10/45] screenmarkers: cleanup widget marker overlay bounds logic This additionally adds a null check to the getChild() call --- .../ScreenMarkerWidgetHighlightOverlay.java | 51 +++++++++++-------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenmarkers/ScreenMarkerWidgetHighlightOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenmarkers/ScreenMarkerWidgetHighlightOverlay.java index 4dc590aefd..718ea93903 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenmarkers/ScreenMarkerWidgetHighlightOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenmarkers/ScreenMarkerWidgetHighlightOverlay.java @@ -35,6 +35,7 @@ import net.runelite.api.MenuEntry; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; import net.runelite.api.widgets.WidgetItem; +import net.runelite.api.widgets.WidgetType; import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.OverlayLayer; import net.runelite.client.ui.overlay.OverlayPosition; @@ -63,58 +64,66 @@ class ScreenMarkerWidgetHighlightOverlay extends Overlay return null; } - if (client.isMenuOpen()) - { - plugin.setSelectedWidgetBounds(null); - return null; - } - final MenuEntry[] menuEntries = client.getMenuEntries(); - - final int last = menuEntries.length - 1; - if (last < 0) + if (client.isMenuOpen() || menuEntries.length == 0) { plugin.setSelectedWidgetBounds(null); return null; } - final MenuEntry menuEntry = menuEntries[last]; + final MenuEntry menuEntry = menuEntries[menuEntries.length - 1]; + final int childIdx = menuEntry.getParam0(); final int widgetId = menuEntry.getParam1(); final int groupId = WidgetInfo.TO_GROUP(widgetId); - final int childId = WidgetInfo.TO_CHILD(widgetId); + final int componentId = WidgetInfo.TO_CHILD(widgetId); - final Widget widget = client.getWidget(groupId, childId); + final Widget widget = client.getWidget(groupId, componentId); if (widget == null) { plugin.setSelectedWidgetBounds(null); return null; } - final int param0 = menuEntry.getParam0(); - if (param0 > -1) + Rectangle bounds = null; + if (childIdx > -1) { - final WidgetItem widgetItem = widget.getWidgetItem(param0); - if (widgetItem != null) + if (widget.getType() == WidgetType.INVENTORY) { - drawHighlight(widgetItem.getCanvasBounds(), graphics); + final WidgetItem widgetItem = widget.getWidgetItem(childIdx); + if (widgetItem != null) + { + bounds = widgetItem.getCanvasBounds(); + } } else { - drawHighlight(widget.getChild(param0).getBounds(), graphics); + final Widget child = widget.getChild(childIdx); + if (child != null) + { + bounds = child.getBounds(); + } } } else { - drawHighlight(widget.getBounds(), graphics); + bounds = widget.getBounds(); } + if (bounds == null) + { + plugin.setSelectedWidgetBounds(null); + return null; + } + + drawHighlight(graphics, bounds); + plugin.setSelectedWidgetBounds(bounds); + return null; } - private void drawHighlight(Rectangle bounds, Graphics2D graphics) + private static void drawHighlight(Graphics2D graphics, Rectangle bounds) { graphics.setColor(Color.GREEN); graphics.draw(bounds); - plugin.setSelectedWidgetBounds(bounds); } } From cb45966a303b51de56450babcb8e3bcdbd6a1aab Mon Sep 17 00:00:00 2001 From: TheStonedTurtle <29030969+TheStonedTurtle@users.noreply.github.com> Date: Tue, 23 Jun 2020 01:20:19 -0700 Subject: [PATCH 11/45] skillcalc: Add Daeyalt essence bonus (#11839) --- .../skillcalculator/skill_runecraft.json | 48 +++++++++++++------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_runecraft.json b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_runecraft.json index 0c08f5d8da..3e62d892f4 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_runecraft.json +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_runecraft.json @@ -1,76 +1,94 @@ { + "bonuses": [ + { + "name": "Daeyalt essence (+50%)", + "value": 0.5 + } + ], "actions": [ { "level": 1, "icon": 5527, "name": "Air Tiara", - "xp": 25 + "xp": 25, + "ignoreBonus": true }, { "level": 1, "icon": 5529, "name": "Mind Tiara", - "xp": 27.5 + "xp": 27.5, + "ignoreBonus": true }, { "level": 1, "icon": 5531, "name": "Water Tiara", - "xp": 30 + "xp": 30, + "ignoreBonus": true }, { "level": 1, "icon": 5535, "name": "Earth Tiara", - "xp": 32.5 + "xp": 32.5, + "ignoreBonus": true }, { "level": 1, "icon": 5537, "name": "Fire Tiara", - "xp": 35 + "xp": 35, + "ignoreBonus": true }, { "level": 1, "icon": 5533, "name": "Body Tiara", - "xp": 37.5 + "xp": 37.5, + "ignoreBonus": true }, { "level": 1, "icon": 5539, "name": "Cosmic Tiara", - "xp": 40 + "xp": 40, + "ignoreBonus": true }, { "level": 1, "icon": 5543, "name": "Chaos Tiara", - "xp": 42.5 + "xp": 42.5, + "ignoreBonus": true }, { "level": 1, "icon": 5541, "name": "Nature Tiara", - "xp": 45 + "xp": 45, + "ignoreBonus": true }, { "level": 1, "icon": 5545, "name": "Law Tiara", - "xp": 47.5 + "xp": 47.5, + "ignoreBonus": true }, { "level": 1, "icon": 5547, "name": "Death Tiara", - "xp": 50 + "xp": 50, + "ignoreBonus": true }, { "level": 1, "icon": 22121, "name": "Wrath Tiara", - "xp": 52.5 + "xp": 52.5, + "ignoreBonus": true }, { "level": 1, @@ -184,13 +202,15 @@ "level": 77, "icon": 565, "name": "Blood Rune", - "xp": 24.425 + "xp": 24.425, + "ignoreBonus": true }, { "level": 90, "icon": 566, "name": "Soul Rune", - "xp": 30.325 + "xp": 30.325, + "ignoreBonus": true }, { "level": 95, From ac60e7772c89b6d7aaa197466927c370de1824f5 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 22 Jun 2020 12:41:48 -0400 Subject: [PATCH 12/45] textcomponent: add option to outline text --- .../ui/overlay/components/TextComponent.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java index 97e4c9db65..5c7f47bf2a 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java @@ -43,6 +43,7 @@ public class TextComponent implements RenderableEntity private String text; private Point position = new Point(); private Color color = Color.WHITE; + private boolean outline; @Override public Dimension render(Graphics2D graphics) @@ -63,6 +64,13 @@ public class TextComponent implements RenderableEntity graphics.setColor(Color.BLACK); graphics.drawString(textWithoutCol, x + 1, position.y + 1); + if (outline) + { + graphics.drawString(textWithoutCol, x - 1, position.y - 1); + graphics.drawString(textWithoutCol, x - 1, position.y + 1); + graphics.drawString(textWithoutCol, x + 1, position.y - 1); + } + // actual text graphics.setColor(Color.decode("#" + colColor)); graphics.drawString(textWithoutCol, x, position.y); @@ -76,6 +84,13 @@ public class TextComponent implements RenderableEntity graphics.setColor(Color.BLACK); graphics.drawString(text, position.x + 1, position.y + 1); + if (outline) + { + graphics.drawString(text, position.x - 1, position.y - 1); + graphics.drawString(text, position.x - 1, position.y + 1); + graphics.drawString(text, position.x + 1, position.y - 1); + } + // actual text graphics.setColor(color); graphics.drawString(text, position.x, position.y); From 974343aac67363ea4ea22bd898545ea224237a5c Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 22 Jun 2020 12:42:00 -0400 Subject: [PATCH 13/45] grounditems: add option to outline text --- .../client/plugins/grounditems/GroundItemsConfig.java | 11 +++++++++++ .../plugins/grounditems/GroundItemsOverlay.java | 2 ++ 2 files changed, 13 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java index 9a891a9901..61dbfb4447 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsConfig.java @@ -383,4 +383,15 @@ public interface GroundItemsConfig extends Config { return false; } + + @ConfigItem( + keyName = "textOutline", + name = "Text Outline", + description = "Use an outline around text instead of a text shadow", + position = 29 + ) + default boolean textOutline() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java index 044ccb3002..b5149ab2d2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsOverlay.java @@ -177,6 +177,7 @@ public class GroundItemsOverlay extends Overlay final boolean onlyShowLoot = config.onlyShowLoot(); final boolean groundItemTimers = config.groundItemTimers(); + final boolean outline = config.textOutline(); for (GroundItem item : groundItemList) { @@ -354,6 +355,7 @@ public class GroundItemsOverlay extends Overlay textComponent.setText(itemString); textComponent.setColor(color); + textComponent.setOutline(outline); textComponent.setPosition(new java.awt.Point(textX, textY)); textComponent.render(graphics); } From f20d3e7e1e9291d2f6870ce0c3ccde44e5a77a2b Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 22 Jun 2020 16:32:20 -0400 Subject: [PATCH 14/45] menu swapper: clean up swap logic --- .../plugins/menuentryswapper/BuyMode.java | 17 +- .../MenuEntrySwapperPlugin.java | 682 +++++++----------- .../plugins/menuentryswapper/SellMode.java | 17 +- .../client/plugins/menuentryswapper/Swap.java | 39 + .../MenuEntrySwapperPluginTest.java | 13 +- 5 files changed, 325 insertions(+), 443 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/Swap.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/BuyMode.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/BuyMode.java index 2c1ab2a818..b3f79c43d1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/BuyMode.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/BuyMode.java @@ -24,18 +24,11 @@ */ package net.runelite.client.plugins.menuentryswapper; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@Getter -@RequiredArgsConstructor public enum BuyMode { - OFF(null), - BUY_1("buy 1"), - BUY_5("buy 5"), - BUY_10("buy 10"), - BUY_50("buy 50"); - - private final String option; + OFF, + BUY_1, + BUY_5, + BUY_10, + BUY_50; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index 92410be021..b9544d39fc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -26,11 +26,20 @@ */ package net.runelite.client.plugins.menuentryswapper; +import com.google.common.annotations.VisibleForTesting; +import static com.google.common.base.Predicates.alwaysTrue; +import static com.google.common.base.Predicates.equalTo; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ImmutableSet; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Multimap; import com.google.inject.Provides; +import java.util.Collection; +import java.util.Collections; import java.util.List; import java.util.Set; +import java.util.function.Predicate; +import java.util.function.Supplier; import javax.inject.Inject; import lombok.Getter; import lombok.Setter; @@ -143,6 +152,7 @@ public class MenuEntrySwapperPlugin extends Plugin @Setter private boolean shiftModifier = false; + private final Multimap swaps = LinkedHashMultimap.create(); private final ArrayListMultimap optionIndexes = ArrayListMultimap.create(); @Provides @@ -158,12 +168,220 @@ public class MenuEntrySwapperPlugin extends Plugin { enableCustomization(); } + + setupSwaps(); } @Override public void shutDown() { disableCustomization(); + + swaps.clear(); + } + + @VisibleForTesting + void setupSwaps() + { + swap("talk-to", "mage of zamorak", "teleport", config::swapAbyssTeleport); + swap("talk-to", "rionasta", "send-parcel", config::swapHardWoodGroveParcel); + swap("talk-to", "captain khaled", "task", config::swapCaptainKhaled); + swap("talk-to", "bank", config::swapBank); + swap("talk-to", "contract", config::swapContract); + swap("talk-to", "exchange", config::swapExchange); + swap("talk-to", "help", config::swapHelp); + swap("talk-to", "nets", config::swapNets); + swap("talk-to", "repairs", config::swapDarkMage); + // make sure assignment swap is higher priority than trade swap for slayer masters + swap("talk-to", "assignment", config::swapAssignment); + swap("talk-to", "trade", config::swapTrade); + swap("talk-to", "trade-with", config::swapTrade); + swap("talk-to", "shop", config::swapTrade); + swap("talk-to", "robin", "claim-slime", config::swapTrade); + swap("talk-to", "travel", config::swapTravel); + swap("talk-to", "pay-fare", config::swapTravel); + swap("talk-to", "charter", config::swapTravel); + swap("talk-to", "take-boat", config::swapTravel); + swap("talk-to", "fly", config::swapTravel); + swap("talk-to", "jatizso", config::swapTravel); + swap("talk-to", "neitiznot", config::swapTravel); + swap("talk-to", "rellekka", config::swapTravel); + swap("talk-to", "follow", config::swapTravel); + swap("talk-to", "transport", config::swapTravel); + swap("talk-to", "pay", config::swapPay); + swapContains("talk-to", alwaysTrue(), "pay (", config::swapPay); + swap("talk-to", "decant", config::swapDecant); + swap("talk-to", "quick-travel", config::swapQuick); + swap("talk-to", "enchant", config::swapEnchant); + swap("talk-to", "start-minigame", config::swapStartMinigame); + swap("talk-to", ESSENCE_MINE_NPCS::contains, "teleport", config::swapEssenceMineTeleport); + + swap("leave tomb", "quick-leave", config::swapQuickLeave); + swap("tomb door", "quick-leave", config::swapQuickLeave); + + swap("pass", "energy barrier", "pay-toll(2-ecto)", config::swapTravel); + swap("open", "gate", "pay-toll(10gp)", config::swapTravel); + + swap("open", "hardwood grove doors", "quick-pay(100)", config::swapHardWoodGrove); + + swap("inspect", "trapdoor", "travel", config::swapTravel); + swap("board", "travel cart", "pay-fare", config::swapTravel); + + swap("cage", "harpoon", config::swapHarpoon); + swap("big net", "harpoon", config::swapHarpoon); + swap("net", "harpoon", config::swapHarpoon); + + swap("enter", "portal", "home", () -> config.swapHomePortal() == HouseMode.HOME); + swap("enter", "portal", "build mode", () -> config.swapHomePortal() == HouseMode.BUILD_MODE); + swap("enter", "portal", "friend's house", () -> config.swapHomePortal() == HouseMode.FRIENDS_HOUSE); + + swap("view", "add-house", () -> config.swapHouseAdvertisement() == HouseAdvertisementMode.ADD_HOUSE); + swap("view", "visit-last", () -> config.swapHouseAdvertisement() == HouseAdvertisementMode.VISIT_LAST); + + for (String option : new String[]{"zanaris", "configure", "tree"}) + { + swapContains(option, alwaysTrue(), "last-destination", () -> config.swapFairyRing() == FairyRingMode.LAST_DESTINATION); + swapContains(option, alwaysTrue(), "configure", () -> config.swapFairyRing() == FairyRingMode.CONFIGURE); + } + + swapContains("tree", alwaysTrue(), "zanaris", () -> config.swapFairyRing() == FairyRingMode.ZANARIS); + + swap("check", "reset", config::swapBoxTrap); + swap("dismantle", "reset", config::swapBoxTrap); + swap("take", "lay", config::swapBoxTrap); + + swap("pick-up", "chase", config::swapChase); + + swap("interact", "birdhouse", "empty", config::swapBirdhouseEmpty); + + swap("enter", "the gauntlet", "enter-corrupted", config::swapGauntlet); + + swap("enter", "quick-enter", config::swapQuick); + swap("ring", "quick-start", config::swapQuick); + swap("pass", "quick-pass", config::swapQuick); + swap("pass", "quick pass", config::swapQuick); + swap("open", "quick-open", config::swapQuick); + swap("climb-down", "quick-start", config::swapQuick); + swap("climb-down", "pay", config::swapQuick); + + swap("admire", "teleport", config::swapAdmire); + swap("admire", "spellbook", config::swapAdmire); + swap("admire", "perks", config::swapAdmire); + + swap("teleport menu", "duel arena", config::swapJewelleryBox); + swap("teleport menu", "castle wars", config::swapJewelleryBox); + swap("teleport menu", "clan wars", config::swapJewelleryBox); + swap("teleport menu", "burthorpe", config::swapJewelleryBox); + swap("teleport menu", "barbarian outpost", config::swapJewelleryBox); + swap("teleport menu", "corporeal beast", config::swapJewelleryBox); + swap("teleport menu", "tears of guthix", config::swapJewelleryBox); + swap("teleport menu", "wintertodt camp", config::swapJewelleryBox); + swap("teleport menu", "warriors' guild", config::swapJewelleryBox); + swap("teleport menu", "champions' guild", config::swapJewelleryBox); + swap("teleport menu", "monastery", config::swapJewelleryBox); + swap("teleport menu", "ranging guild", config::swapJewelleryBox); + swap("teleport menu", "fishing guild", config::swapJewelleryBox); + swap("teleport menu", "mining guild", config::swapJewelleryBox); + swap("teleport menu", "crafting guild", config::swapJewelleryBox); + swap("teleport menu", "cooking guild", config::swapJewelleryBox); + swap("teleport menu", "woodcutting guild", config::swapJewelleryBox); + swap("teleport menu", "farming guild", config::swapJewelleryBox); + swap("teleport menu", "miscellania", config::swapJewelleryBox); + swap("teleport menu", "grand exchange", config::swapJewelleryBox); + swap("teleport menu", "falador park", config::swapJewelleryBox); + swap("teleport menu", "dondakan's rock", config::swapJewelleryBox); + swap("teleport menu", "edgeville", config::swapJewelleryBox); + swap("teleport menu", "karamja", config::swapJewelleryBox); + swap("teleport menu", "draynor village", config::swapJewelleryBox); + swap("teleport menu", "al kharid", config::swapJewelleryBox); + + swap("shared", "private", config::swapPrivate); + + swap("pick", "pick-lots", config::swapPick); + + swap("view offer", "abort offer", () -> shiftModifier && config.swapGEAbort()); + + swap("cast", "npc contact", "honest jimmy", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "bert the sandman", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "advisor ghrim", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "dark mage", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "lanthus", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "turael", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "mazchna", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "vannaka", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "chaeldar", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "nieve", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "steve", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "duradel", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "krystilia", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "konar", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "murphy", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "cyrisus", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "smoggy", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "ginea", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "watson", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "barbarian guard", () -> shiftModifier && config.swapNpcContact()); + swap("cast", "npc contact", "random", () -> shiftModifier && config.swapNpcContact()); + + swap("value", "buy 1", () -> shiftModifier && config.shopBuy() == BuyMode.BUY_1); + swap("value", "buy 5", () -> shiftModifier && config.shopBuy() == BuyMode.BUY_5); + swap("value", "buy 10", () -> shiftModifier && config.shopBuy() == BuyMode.BUY_10); + swap("value", "buy 50", () -> shiftModifier && config.shopBuy() == BuyMode.BUY_50); + + swap("value", "sell 1", () -> shiftModifier && config.shopSell() == SellMode.SELL_1); + swap("value", "sell 5", () -> shiftModifier && config.shopSell() == SellMode.SELL_5); + swap("value", "sell 10", () -> shiftModifier && config.shopSell() == SellMode.SELL_10); + swap("value", "sell 50", () -> shiftModifier && config.shopSell() == SellMode.SELL_50); + + swap("wear", "rub", config::swapTeleportItem); + swap("wear", "teleport", config::swapTeleportItem); + swap("wield", "teleport", config::swapTeleportItem); + + swap("bury", "use", config::swapBones); + + swap("collect-note", "collect-item", () -> config.swapGEItemCollect() == GEItemCollectMode.ITEMS); + swap("collect-notes", "collect-items", () -> config.swapGEItemCollect() == GEItemCollectMode.ITEMS); + + swap("collect-item", "collect-note", () -> config.swapGEItemCollect() == GEItemCollectMode.NOTES); + swap("collect-items", "collect-notes", () -> config.swapGEItemCollect() == GEItemCollectMode.NOTES); + + swap("collect to inventory", "collect to bank", () -> config.swapGEItemCollect() == GEItemCollectMode.BANK); + swap("collect", "bank", () -> config.swapGEItemCollect() == GEItemCollectMode.BANK); + swap("collect-note", "bank", () -> config.swapGEItemCollect() == GEItemCollectMode.BANK); + swap("collect-notes", "bank", () -> config.swapGEItemCollect() == GEItemCollectMode.BANK); + swap("collect-item", "bank", () -> config.swapGEItemCollect() == GEItemCollectMode.BANK); + swap("collect-items", "bank", () -> config.swapGEItemCollect() == GEItemCollectMode.BANK); + + swapTeleport("varrock teleport", "grand exchange"); + swapTeleport("camelot teleport", "seers'"); + swapTeleport("watchtower teleport", "yanille"); + swapTeleport("teleport to house", "outside"); + } + + private void swap(String option, String swappedOption, Supplier enabled) + { + swap(option, alwaysTrue(), swappedOption, enabled); + } + + private void swap(String option, String target, String swappedOption, Supplier enabled) + { + swap(option, equalTo(target), swappedOption, enabled); + } + + private void swap(String option, Predicate targetPredicate, String swappedOption, Supplier enabled) + { + swaps.put(option, new Swap(alwaysTrue(), targetPredicate, swappedOption, enabled, true)); + } + + private void swapContains(String option, Predicate targetPredicate, String swappedOption, Supplier enabled) + { + swaps.put(option, new Swap(alwaysTrue(), targetPredicate, swappedOption, enabled, false)); + } + + private void swapTeleport(String option, String swappedOption) + { + swap("cast", option, swappedOption, () -> shiftModifier && config.swapTeleportSpell()); + swap(swappedOption, option, "cast", () -> shiftModifier && config.swapTeleportSpell()); } @Subscribe @@ -394,31 +612,23 @@ public class MenuEntrySwapperPlugin extends Plugin return; } - int index = -1; - boolean valid = false; - if (option.equals("Use")) //because "Use" is not in inventoryActions { - valid = true; + setSwapConfig(itemId, -1); } else { String[] inventoryActions = itemComposition.getInventoryActions(); - for (index = 0; index < inventoryActions.length; index++) + for (int index = 0; index < inventoryActions.length; index++) { if (option.equals(inventoryActions[index])) { - valid = true; + setSwapConfig(itemId, index); break; } } } - - if (valid) - { - setSwapConfig(itemId, index); - } } private void swapMenuEntry(int index, MenuEntry menuEntry) @@ -435,391 +645,31 @@ public class MenuEntrySwapperPlugin extends Plugin return; } - if (option.equals("talk-to")) - { - if (config.swapAbyssTeleport() && target.contains("mage of zamorak")) - { - swap("teleport", option, target, index); - } - - if (config.swapHardWoodGroveParcel() && target.contains("rionasta")) - { - swap("send-parcel", option, target, index); - } - - if (config.swapCaptainKhaled() && target.contains("captain khaled")) - { - swap("task", option, target, index); - } - - if (config.swapBank()) - { - swap("bank", option, target, index); - } - - if (config.swapContract()) - { - swap("contract", option, target, index); - } - - if (config.swapExchange()) - { - swap("exchange", option, target, index); - } - - if (config.swapHelp()) - { - swap("help", option, target, index); - } - - if (config.swapNets()) - { - swap("nets", option, target, index); - } - - if (config.swapDarkMage()) - { - swap("repairs", option, target, index); - } - - // make sure assignment swap is higher priority than trade swap for slayer masters - if (config.swapAssignment()) - { - swap("assignment", option, target, index); - } - - if (config.swapTrade()) - { - swap("trade", option, target, index); - swap("trade-with", option, target, index); - swap("shop", option, target, index); - } - - if (config.claimSlime() && target.equals("robin")) - { - swap("claim-slime", option, target, index); - } - - if (config.swapTravel()) - { - swap("travel", option, target, index); - swap("pay-fare", option, target, index); - swap("charter", option, target, index); - swap("take-boat", option, target, index); - swap("fly", option, target, index); - swap("jatizso", option, target, index); - swap("neitiznot", option, target, index); - swap("rellekka", option, target, index); - swap("follow", option, target, index); - swap("transport", option, target, index); - } - - if (config.swapPay()) - { - swap("pay", option, target, index); - swapContains("pay (", option, target, index); - } - - if (config.swapDecant()) - { - swap("decant", option, target, index); - } - - if (config.swapQuick()) - { - swap("quick-travel", option, target, index); - } - - if (config.swapEnchant()) - { - swap("enchant", option, target, index); - } - - if (config.swapStartMinigame()) - { - swap("start-minigame", option, target, index); - } - - if (config.swapEssenceMineTeleport() && ESSENCE_MINE_NPCS.contains(target)) - { - swap("teleport", option, target, index); - } - } - else if (config.swapQuickLeave() && option.equals("leave tomb") && target.equals("tomb door")) - { - swap("quick-leave", option, target, index); - } - else if (config.swapTravel() && option.equals("pass") && target.equals("energy barrier")) - { - swap("pay-toll(2-ecto)", option, target, index); - } - else if (config.swapTravel() && option.equals("open") && target.equals("gate")) - { - swap("pay-toll(10gp)", option, target, index); - } - else if (config.swapHardWoodGrove() && option.equals("open") && target.equals("hardwood grove doors")) - { - swap("quick-pay(100)", option, target, index); - } - else if (config.swapTravel() && option.equals("inspect") && target.equals("trapdoor")) - { - swap("travel", option, target, index); - } - else if (config.swapTravel() && option.equals("board") && target.equals("travel cart")) - { - swap("pay-fare", option, target, index); - } - else if (config.swapHarpoon() && option.equals("cage")) - { - swap("harpoon", option, target, index); - } - else if (config.swapHarpoon() && (option.equals("big net") || option.equals("net"))) - { - swap("harpoon", option, target, index); - } - else if (config.swapHomePortal() != HouseMode.ENTER && option.equals("enter") && target.equals("portal")) - { - switch (config.swapHomePortal()) - { - case HOME: - swap("home", option, target, index); - break; - case BUILD_MODE: - swap("build mode", option, target, index); - break; - case FRIENDS_HOUSE: - swap("friend's house", option, target, index); - break; - } - } - else if (config.swapHouseAdvertisement() != HouseAdvertisementMode.VIEW && option.equals("view")) - { - switch (config.swapHouseAdvertisement()) - { - case ADD_HOUSE: - swap("add-house", option, target, index); - break; - case VISIT_LAST: - swap("visit-last", option, target, index); - break; - } - } - else if (config.swapFairyRing() != FairyRingMode.OFF && config.swapFairyRing() != FairyRingMode.ZANARIS - && (option.equals("zanaris") || option.equals("configure") || option.equals("tree"))) - { - if (config.swapFairyRing() == FairyRingMode.LAST_DESTINATION) - { - swapContains("last-destination", option, target, index); - } - else if (config.swapFairyRing() == FairyRingMode.CONFIGURE) - { - swapContains("configure", option, target, index); - } - } - else if (config.swapFairyRing() == FairyRingMode.ZANARIS && option.equals("tree")) - { - swapContains("zanaris", option, target, index); - } - else if (config.swapBoxTrap() && (option.equals("check") || option.equals("dismantle"))) - { - swap("reset", option, target, index); - } - else if (config.swapBoxTrap() && option.equals("take")) - { - swap("lay", option, target, index); - } - else if (config.swapChase() && option.equals("pick-up")) - { - swap("chase", option, target, index); - } - else if (config.swapBirdhouseEmpty() && option.equals("interact") && target.contains("birdhouse")) - { - swap("empty", option, target, index); - } - else if (config.swapGauntlet() && option.equals("enter") && target.equals("the gauntlet")) - { - swap("enter-corrupted", option, target, index); - } - else if (config.swapQuick() && option.equals("enter")) - { - swap("quick-enter", option, target, index); - } - else if (config.swapQuick() && option.equals("ring")) - { - swap("quick-start", option, target, index); - } - else if (config.swapQuick() && option.equals("pass")) - { - swap("quick-pass", option, target, index); - swap("quick pass", option, target, index); - } - else if (config.swapQuick() && option.equals("open")) - { - swap("quick-open", option, target, index); - } - else if (config.swapQuick() && option.equals("climb-down")) - { - swap("quick-start", option, target, index); - swap("pay", option, target, index); - } - else if (config.swapAdmire() && option.equals("admire")) - { - swap("teleport", option, target, index); - swap("spellbook", option, target, index); - swap("perks", option, target, index); - } - else if (config.swapJewelleryBox() && option.equals("teleport menu")) - { - swap("duel arena", option, target, index); - swap("castle wars", option, target, index); - swap("clan wars", option, target, index); - swap("burthorpe", option, target, index); - swap("barbarian outpost", option, target, index); - swap("corporeal beast", option, target, index); - swap("tears of guthix", option, target, index); - swap("wintertodt camp", option, target, index); - swap("warriors' guild", option, target, index); - swap("champions' guild", option, target, index); - swap("monastery", option, target, index); - swap("ranging guild", option, target, index); - swap("fishing guild", option, target, index); - swap("mining guild", option, target, index); - swap("crafting guild", option, target, index); - swap("cooking guild", option, target, index); - swap("woodcutting guild", option, target, index); - swap("farming guild", option, target, index); - swap("miscellania", option, target, index); - swap("grand exchange", option, target, index); - swap("falador park", option, target, index); - swap("dondakan's rock", option, target, index); - swap("edgeville", option, target, index); - swap("karamja", option, target, index); - swap("draynor village", option, target, index); - swap("al kharid", option, target, index); - } - else if (config.swapPrivate() && option.equals("shared")) - { - swap("private", option, target, index); - } - else if (config.swapPick() && option.equals("pick")) - { - swap("pick-lots", option, target, index); - } - else if (shiftModifier && option.equals("view offer") && config.swapGEAbort()) - { - swap("abort offer", option, target, index); - } - else if (shiftModifier && target.equals("npc contact") && config.swapNpcContact()) - { - swap("honest jimmy", option, target, index); - swap("bert the sandman", option, target, index); - swap("advisor ghrim", option, target, index); - swap("dark mage", option, target, index); - swap("lanthus", option, target, index); - swap("turael", option, target, index); - swap("mazchna", option, target, index); - swap("vannaka", option, target, index); - swap("chaeldar", option, target, index); - swap("nieve", option, target, index); - swap("steve", option, target, index); - swap("duradel", option, target, index); - swap("krystilia", option, target, index); - swap("konar", option, target, index); - swap("murphy", option, target, index); - swap("cyrisus", option, target, index); - swap("smoggy", option, target, index); - swap("ginea", option, target, index); - swap("watson", option, target, index); - swap("barbarian guard", option, target, index); - swap("random", option, target, index); - } - else if (shiftModifier && option.equals("value")) - { - if (config.shopBuy() != null && config.shopBuy() != BuyMode.OFF) - { - swap(config.shopBuy().getOption(), option, target, index); - } - - if (config.shopSell() != null && config.shopSell() != SellMode.OFF) - { - swap(config.shopSell().getOption(), option, target, index); - } - } - else if (config.shiftClickCustomization() && shiftModifier && !option.equals("use")) + // Special case use shift click due to items not actually containing a "Use" option, making + // the client unable to perform the swap itself. + if (shiftModifier && config.shiftClickCustomization() && !option.equals("use")) { Integer customOption = getSwapConfig(eventId); if (customOption != null && customOption == -1) { - swap("use", option, target, index); - } - } - // Put all item-related swapping after shift-click - else if (config.swapTeleportItem() && option.equals("wear")) - { - swap("rub", option, target, index); - swap("teleport", option, target, index); - } - else if (option.equals("wield")) - { - if (config.swapTeleportItem()) - { - swap("teleport", option, target, index); - } - } - else if (config.swapBones() && option.equals("bury")) - { - swap("use", option, target, index); - } - else if (option.equals("collect to inventory") || option.startsWith("collect-note") || option.startsWith("collect-item")) - { - switch (config.swapGEItemCollect()) - { - case ITEMS: - swap("collect-items", option, target, index); - swap("collect-item", option, target, index); - break; - case NOTES: - swap("collect-notes", option, target, index); - swap("collect-note", option, target, index); - break; - case BANK: - swap("collect to bank", option, target, index); - swap("bank", option, target, index); - break; + if (swap("use", target, index, true)) + { + return; + } } } - if (shiftModifier && config.swapTeleportSpell()) + Collection swaps = this.swaps.get(option); + for (Swap swap : swaps) { - if (target.equals("varrock teleport")) + if (swap.getTargetPredicate().test(target) && swap.getEnabled().get()) { - swapTeleport(target, option, "grand exchange", index); + if (swap(swap.getSwappedOption(), target, index, swap.isStrict())) + { + break; + } } - else if (target.equals("camelot teleport")) - { - swapTeleport(target, option, "seers'", index); - } - else if (target.equals("watchtower teleport")) - { - swapTeleport(target, option, "yanille", index); - } - else if (target.equals("teleport to house")) - { - swapTeleport(target, option, "outside", index); - } - } - } - - private void swapTeleport(String target, String option, String optionA, int index) - { - if (option.equals("cast")) - { - swap(optionA, option, target, index); - } - else if (option.equals(optionA)) - { - swap("cast", option, target, index); } } @@ -873,27 +723,20 @@ public class MenuEntrySwapperPlugin extends Plugin } } - private void swap(String optionA, String optionB, String target, int index) - { - swap(optionA, optionB, target, index, true); - } - - private void swapContains(String optionA, String optionB, String target, int index) - { - swap(optionA, optionB, target, index, false); - } - - private void swap(String optionA, String optionB, String target, int index, boolean strict) + private boolean swap(String option, String target, int index, boolean strict) { MenuEntry[] menuEntries = client.getMenuEntries(); - int thisIndex = findIndex(menuEntries, index, optionB, target, strict); - int optionIdx = findIndex(menuEntries, thisIndex, optionA, target, strict); + // find option to swap with + int optionIdx = findIndex(menuEntries, index, option, target, strict); - if (thisIndex >= 0 && optionIdx >= 0) + if (optionIdx >= 0) { - swap(optionIndexes, menuEntries, optionIdx, thisIndex); + swap(optionIndexes, menuEntries, optionIdx, index); + return true; } + + return false; } private int findIndex(MenuEntry[] entries, int limit, String option, String target, boolean strict) @@ -911,7 +754,7 @@ public class MenuEntrySwapperPlugin extends Plugin String entryTarget = Text.removeTags(entry.getTarget()).toLowerCase(); // Limit to the last index which is prior to the current entry - if (idx <= limit && entryTarget.equals(target)) + if (idx < limit && entryTarget.equals(target)) { return idx; } @@ -920,7 +763,7 @@ public class MenuEntrySwapperPlugin extends Plugin else { // Without strict matching we have to iterate all entries up to the current limit... - for (int i = limit; i >= 0; i--) + for (int i = limit - 1; i >= 0; i--) { MenuEntry entry = entries[i]; String entryOption = Text.removeTags(entry.getOption()).toLowerCase(); @@ -939,20 +782,33 @@ public class MenuEntrySwapperPlugin extends Plugin private void swap(ArrayListMultimap optionIndexes, MenuEntry[] entries, int index1, int index2) { - MenuEntry entry = entries[index1]; - entries[index1] = entries[index2]; - entries[index2] = entry; + MenuEntry entry1 = entries[index1], + entry2 = entries[index2]; + + entries[index1] = entry2; + entries[index2] = entry1; client.setMenuEntries(entries); - // Rebuild option indexes - optionIndexes.clear(); - int idx = 0; - for (MenuEntry menuEntry : entries) - { - String option = Text.removeTags(menuEntry.getOption()).toLowerCase(); - optionIndexes.put(option, idx++); - } + // Update optionIndexes + String option1 = Text.removeTags(entry1.getOption()).toLowerCase(), + option2 = Text.removeTags(entry2.getOption()).toLowerCase(); + + List list1 = optionIndexes.get(option1), + list2 = optionIndexes.get(option2); + + // call remove(Object) instead of remove(int) + list1.remove((Integer) index1); + list2.remove((Integer) index2); + + sortedInsert(list1, index2); + sortedInsert(list2, index1); + } + + private static > void sortedInsert(List list, T value) + { + int idx = Collections.binarySearch(list, value); + list.add(idx < 0 ? -idx - 1 : idx, value); } private void removeShiftClickCustomizationMenus() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/SellMode.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/SellMode.java index 814628eded..048b77752e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/SellMode.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/SellMode.java @@ -24,18 +24,11 @@ */ package net.runelite.client.plugins.menuentryswapper; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -@Getter -@RequiredArgsConstructor public enum SellMode { - OFF(null), - SELL_1("sell 1"), - SELL_5("sell 5"), - SELL_10("sell 10"), - SELL_50("sell 50"); - - private final String option; + OFF, + SELL_1, + SELL_5, + SELL_10, + SELL_50; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/Swap.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/Swap.java new file mode 100644 index 0000000000..5cfa0a52ba --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/Swap.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.menuentryswapper; + +import java.util.function.Predicate; +import java.util.function.Supplier; +import lombok.Value; + +@Value +class Swap +{ + private Predicate optionPredicate; + private Predicate targetPredicate; + private String swappedOption; + private Supplier enabled; + private boolean strict; +} diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPluginTest.java index da2e028af6..851e09c6f5 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPluginTest.java @@ -45,6 +45,7 @@ import static org.mockito.ArgumentMatchers.any; import org.mockito.Mock; import static org.mockito.Mockito.clearInvocations; import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -96,6 +97,8 @@ public class MenuEntrySwapperPluginTest entries = (MenuEntry[]) argument; return null; }).when(client).setMenuEntries(any(MenuEntry[].class)); + + menuEntrySwapperPlugin.setupSwaps(); } private static MenuEntry menu(String option, String target, MenuAction menuAction) @@ -116,7 +119,7 @@ public class MenuEntrySwapperPluginTest @Test public void testSlayerMaster() { - when(config.swapTrade()).thenReturn(true); + lenient().when(config.swapTrade()).thenReturn(true); when(config.swapAssignment()).thenReturn(true); entries = new MenuEntry[]{ @@ -129,15 +132,14 @@ public class MenuEntrySwapperPluginTest menuEntrySwapperPlugin.onClientTick(new ClientTick()); ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(MenuEntry[].class); - // Once for assignment<->talk-to and once for trade<->talk-to - verify(client, times(2)).setMenuEntries(argumentCaptor.capture()); + verify(client).setMenuEntries(argumentCaptor.capture()); - MenuEntry[] value = argumentCaptor.getValue(); + // check the assignment swap is hit first instead of trade assertArrayEquals(new MenuEntry[]{ menu("Cancel", "", MenuAction.CANCEL), menu("Rewards", "Duradel", MenuAction.NPC_FIFTH_OPTION), - menu("Talk-to", "Duradel", MenuAction.NPC_FIRST_OPTION), menu("Trade", "Duradel", MenuAction.NPC_FOURTH_OPTION), + menu("Talk-to", "Duradel", MenuAction.NPC_FIRST_OPTION), menu("Assignment", "Duradel", MenuAction.NPC_THIRD_OPTION), }, argumentCaptor.getValue()); } @@ -275,7 +277,6 @@ public class MenuEntrySwapperPluginTest public void testTobDoor() { when(config.swapQuick()).thenReturn(true); - when(config.swapHomePortal()).thenReturn(HouseMode.HOME); //Quick-enter, Enter entries = new MenuEntry[]{ From 6950bf166efb6bcd071c938c7f711329112e829c Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 23 Jun 2020 15:17:07 -0400 Subject: [PATCH 15/45] menu swapper: add tan all swap --- .../menuentryswapper/MenuEntrySwapperConfig.java | 11 +++++++++++ .../menuentryswapper/MenuEntrySwapperPlugin.java | 2 ++ 2 files changed, 13 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java index 2f06379369..e3d50db7f4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java @@ -549,4 +549,15 @@ public interface MenuEntrySwapperConfig extends Config { return false; } + + @ConfigItem( + keyName = "swapTan", + name = "Tan", + description = "Swap Tan 1 with Tan All", + section = uiSection + ) + default boolean swapTan() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index b9544d39fc..59d971e57c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -352,6 +352,8 @@ public class MenuEntrySwapperPlugin extends Plugin swap("collect-item", "bank", () -> config.swapGEItemCollect() == GEItemCollectMode.BANK); swap("collect-items", "bank", () -> config.swapGEItemCollect() == GEItemCollectMode.BANK); + swap("tan 1", "tan all", config::swapTan); + swapTeleport("varrock teleport", "grand exchange"); swapTeleport("camelot teleport", "seers'"); swapTeleport("watchtower teleport", "yanille"); From 9168c1520d3c945f747107f5009dffe350de92e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Paulsen?= Date: Tue, 23 Jun 2020 17:38:38 -0400 Subject: [PATCH 16/45] npc indicators: allow combination of higlight styles --- .../npchighlight/NpcIndicatorsConfig.java | 71 ++++++++++++++----- .../plugins/npchighlight/NpcSceneOverlay.java | 40 +++++------ .../plugins/npchighlight/RenderStyle.java | 33 --------- 3 files changed, 71 insertions(+), 73 deletions(-) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/RenderStyle.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java index a9eede906e..3511f7c2f9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java @@ -28,23 +28,56 @@ import java.awt.Color; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.config.ConfigSection; @ConfigGroup("npcindicators") public interface NpcIndicatorsConfig extends Config { + @ConfigSection( + name = "Render style", + description = "The render style of NPC highlighting", + position = 0 + ) + String renderStyleSection = "renderStyleSection"; + @ConfigItem( position = 0, - keyName = "highlightStyle", - name = "Highlight Style", - description = "Highlight setting" + keyName = "highlightHull", + name = "Highlight hull", + description = "Configures whether or not NPC should be highlighted by hull", + section = renderStyleSection ) - default RenderStyle renderStyle() + default boolean highlightHull() { - return RenderStyle.HULL; + return true; } @ConfigItem( position = 1, + keyName = "highlightTile", + name = "Highlight tile", + description = "Configures whether or not NPC should be highlighted by tile", + section = renderStyleSection + ) + default boolean highlightTile() + { + return false; + } + + @ConfigItem( + position = 2, + keyName = "highlightSouthWestTile", + name = "Highlight south west tile", + description = "Configures whether or not NPC should be highlighted by south western tile", + section = renderStyleSection + ) + default boolean highlightSouthWestTile() + { + return false; + } + + @ConfigItem( + position = 3, keyName = "npcToHighlight", name = "NPCs to Highlight", description = "List of NPC names to highlight" @@ -55,7 +88,7 @@ public interface NpcIndicatorsConfig extends Config } @ConfigItem( - position = 2, + position = 4, keyName = "npcColor", name = "Highlight Color", description = "Color of the NPC highlight" @@ -66,7 +99,7 @@ public interface NpcIndicatorsConfig extends Config } @ConfigItem( - position = 3, + position = 5, keyName = "drawNames", name = "Draw names above NPC", description = "Configures whether or not NPC names should be drawn above the NPC" @@ -77,7 +110,7 @@ public interface NpcIndicatorsConfig extends Config } @ConfigItem( - position = 4, + position = 6, keyName = "drawMinimapNames", name = "Draw names on minimap", description = "Configures whether or not NPC names should be drawn on the minimap" @@ -88,7 +121,7 @@ public interface NpcIndicatorsConfig extends Config } @ConfigItem( - position = 5, + position = 7, keyName = "highlightMenuNames", name = "Highlight menu names", description = "Highlight NPC names in right click menu" @@ -99,7 +132,7 @@ public interface NpcIndicatorsConfig extends Config } @ConfigItem( - position = 6, + position = 8, keyName = "ignoreDeadNpcs", name = "Ignore dead NPCs", description = "Prevents highlighting NPCs after they are dead" @@ -110,7 +143,15 @@ public interface NpcIndicatorsConfig extends Config } @ConfigItem( - position = 7, + position = 9, + keyName = "deadNpcMenuColor", + name = "Dead NPC menu color", + description = "Color of the NPC menus for dead NPCs" + ) + Color deadNpcMenuColor(); + + @ConfigItem( + position = 10, keyName = "showRespawnTimer", name = "Show respawn timer", description = "Show respawn timer of tagged NPCs") @@ -118,12 +159,4 @@ public interface NpcIndicatorsConfig extends Config { return false; } - - @ConfigItem( - position = 7, - keyName = "deadNpcMenuColor", - name = "Dead NPC menu color", - description = "Color of the NPC menus for dead NPCs" - ) - Color deadNpcMenuColor(); } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java index f3befac1e2..441d811a97 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java @@ -152,34 +152,32 @@ public class NpcSceneOverlay extends Overlay return; } - switch (config.renderStyle()) + if (config.highlightHull()) { - case SOUTH_WEST_TILE: - { - int size = npcComposition.getSize(); - LocalPoint localPoint = actor.getLocalLocation(); + Shape objectClickbox = actor.getConvexHull(); + renderPoly(graphics, color, objectClickbox); + } - int x = localPoint.getX() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2); - int y = localPoint.getY() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2); + if (config.highlightTile()) + { + int size = npcComposition.getSize(); + LocalPoint lp = actor.getLocalLocation(); + Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size); - Polygon tilePoly = Perspective.getCanvasTilePoly(client, new LocalPoint(x, y)); + renderPoly(graphics, color, tilePoly); + } - renderPoly(graphics, color, tilePoly); - break; - } - case TILE: - int size = npcComposition.getSize(); - LocalPoint lp = actor.getLocalLocation(); - Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size); + if (config.highlightSouthWestTile()) + { + int size = npcComposition.getSize(); + LocalPoint lp = actor.getLocalLocation(); - renderPoly(graphics, color, tilePoly); - break; + int x = lp.getX() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2); + int y = lp.getY() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2); - case HULL: - Shape objectClickbox = actor.getConvexHull(); + Polygon southWestTilePoly = Perspective.getCanvasTilePoly(client, new LocalPoint(x, y)); - renderPoly(graphics, color, objectClickbox); - break; + renderPoly(graphics, color, southWestTilePoly); } if (config.drawNames() && actor.getName() != null) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/RenderStyle.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/RenderStyle.java deleted file mode 100644 index 811ee5dda9..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/RenderStyle.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2018, Raqes - * 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.npchighlight; - -public enum RenderStyle -{ - OFF, - TILE, - HULL, - SOUTH_WEST_TILE -} From 791f2bd9e01587cca04082fd328df4840c5c8f39 Mon Sep 17 00:00:00 2001 From: MMagicala Date: Mon, 1 Jun 2020 14:38:52 -0700 Subject: [PATCH 17/45] antidrag: add antidrag to inventory when bank interface is open --- .../runelite/client/plugins/antidrag/AntiDragPlugin.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragPlugin.java index 5f55e44a04..a74895ce12 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/antidrag/AntiDragPlugin.java @@ -210,6 +210,7 @@ public class AntiDragPlugin extends Plugin implements KeyListener private void setBankDragDelay(int delay) { final Widget bankItemContainer = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER); + final Widget bankInventoryItemsContainer = client.getWidget(WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER); if (bankItemContainer != null) { Widget[] items = bankItemContainer.getDynamicChildren(); @@ -218,6 +219,14 @@ public class AntiDragPlugin extends Plugin implements KeyListener item.setDragDeadTime(delay); } } + if (bankInventoryItemsContainer != null) + { + Widget[] items = bankInventoryItemsContainer.getDynamicChildren(); + for (Widget item : items) + { + item.setDragDeadTime(delay); + } + } } private void setDragDelay() From 25cf3eeaac6c313291e8da6d560f42759cc7b57e Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Tue, 2 Jun 2020 19:26:06 -0400 Subject: [PATCH 18/45] agility: Fix config order --- .../net/runelite/client/plugins/agility/AgilityConfig.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java index b6eae25fe1..5ecdda516b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/agility/AgilityConfig.java @@ -203,7 +203,7 @@ public interface AgilityConfig extends Config keyName = "highlightStick", name = "Highlight Stick", description = "Highlight the retrievable stick in the Werewolf Agility Course", - position = 13 + position = 15 ) default boolean highlightStick() { @@ -214,7 +214,7 @@ public interface AgilityConfig extends Config keyName = "stickHighlightColor", name = "Stick Highlight Color", description = "Color of highlighted stick", - position = 14 + position = 16 ) default Color stickHighlightColor() { From b0677e68e95c9e58872b106cc7615a4e2cfc5302 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Wed, 3 Jun 2020 15:51:04 -0600 Subject: [PATCH 19/45] chatcommands: don't throw every tick if the player has opened a scroll This interface is used in many other places --- .../net/runelite/api/widgets/WidgetID.java | 5 +- .../net/runelite/api/widgets/WidgetInfo.java | 2 +- .../chatcommands/ChatCommandsPlugin.java | 53 ++++++++++--------- .../chatcommands/ChatCommandsPluginTest.java | 12 ++--- 4 files changed, 37 insertions(+), 35 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 2a9927894a..7f31f41813 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 @@ -152,7 +152,7 @@ public class WidgetID public static final int LMS_GROUP_ID = 333; public static final int LMS_INGAME_GROUP_ID = 328; public static final int ADVENTURE_LOG_ID = 187; - public static final int COUNTERS_LOG_GROUP_ID = 625; + public static final int GENERIC_SCROLL_GROUP_ID = 625; public static final int GAUNTLET_TIMER_GROUP_ID = 637; public static final int BANK_PIN_GROUP_ID = 213; @@ -915,9 +915,8 @@ public class WidgetID static final int CONTAINER = 0; } - static class CountersLog + static class GenericScroll { - static final int OWNER = 4; static final int TEXT = 6; } diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index 1372874a20..f9534c96f1 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -488,7 +488,7 @@ public enum WidgetInfo ADVENTURE_LOG(WidgetID.ADVENTURE_LOG_ID, WidgetID.AdventureLog.CONTAINER), - COUNTERS_LOG_TEXT(WidgetID.COUNTERS_LOG_GROUP_ID, WidgetID.CountersLog.TEXT), + GENERIC_SCROLL_TEXT(WidgetID.GENERIC_SCROLL_GROUP_ID, WidgetID.GenericScroll.TEXT), WORLD_SWITCHER_LIST(WidgetID.WORLD_SWITCHER_GROUP_ID, WidgetID.WorldSwitcher.WORLD_LIST), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 0b129164af..7549d22106 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -56,7 +56,7 @@ import net.runelite.api.events.WidgetLoaded; import net.runelite.api.vars.AccountType; import net.runelite.api.widgets.Widget; import static net.runelite.api.widgets.WidgetID.ADVENTURE_LOG_ID; -import static net.runelite.api.widgets.WidgetID.COUNTERS_LOG_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.GENERIC_SCROLL_GROUP_ID; import static net.runelite.api.widgets.WidgetID.KILL_LOGS_GROUP_ID; import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.chat.ChatColorType; @@ -132,7 +132,7 @@ public class ChatCommandsPlugin extends Plugin private boolean bossLogLoaded; private boolean advLogLoaded; - private boolean countersLogLoaded; + private boolean scrollInterfaceLoaded; private String pohOwner; private HiscoreEndpoint hiscoreEndpoint; // hiscore endpoint for current player private String lastBossKill; @@ -497,36 +497,39 @@ public class ChatCommandsPlugin extends Plugin } } - if (countersLogLoaded && pohOwner.equals(client.getLocalPlayer().getName())) + if (scrollInterfaceLoaded) { - countersLogLoaded = false; + scrollInterfaceLoaded = false; - String counterText = Text.sanitizeMultilineText(client.getWidget(WidgetInfo.COUNTERS_LOG_TEXT).getText()); - Matcher mCounterText = ADVENTURE_LOG_PB_PATTERN.matcher(counterText); - while (mCounterText.find()) + if (client.getLocalPlayer().getName().equals(pohOwner)) { - String bossName = longBossName(mCounterText.group(1)); - if (bossName.equalsIgnoreCase("chambers of xeric") || - bossName.equalsIgnoreCase("chambers of xeric challenge mode")) + String counterText = Text.sanitizeMultilineText(client.getWidget(WidgetInfo.GENERIC_SCROLL_TEXT).getText()); + Matcher mCounterText = ADVENTURE_LOG_PB_PATTERN.matcher(counterText); + while (mCounterText.find()) { - Matcher mCoxRuns = ADVENTURE_LOG_COX_PB_PATTERN.matcher(mCounterText.group()); - int bestPbTime = Integer.MAX_VALUE; - while (mCoxRuns.find()) + String bossName = longBossName(mCounterText.group(1)); + if (bossName.equalsIgnoreCase("chambers of xeric") || + bossName.equalsIgnoreCase("chambers of xeric challenge mode")) { - bestPbTime = Math.min(timeStringToSeconds(mCoxRuns.group(1)), bestPbTime); + Matcher mCoxRuns = ADVENTURE_LOG_COX_PB_PATTERN.matcher(mCounterText.group()); + int bestPbTime = Integer.MAX_VALUE; + while (mCoxRuns.find()) + { + bestPbTime = Math.min(timeStringToSeconds(mCoxRuns.group(1)), bestPbTime); + } + // So we don't reset people's already saved PB's if they had one before the update + int currentPb = getPb(bossName); + if (currentPb == 0 || currentPb > bestPbTime) + { + setPb(bossName, bestPbTime); + } } - // So we don't reset people's already saved PB's if they had one before the update - int currentPb = getPb(bossName); - if (currentPb == 0 || currentPb > bestPbTime) + else { - setPb(bossName, bestPbTime); + String pbTime = mCounterText.group(2); + setPb(bossName, timeStringToSeconds(pbTime)); } } - else - { - String pbTime = mCounterText.group(2); - setPb(bossName, timeStringToSeconds(pbTime)); - } } } } @@ -542,8 +545,8 @@ public class ChatCommandsPlugin extends Plugin case KILL_LOGS_GROUP_ID: bossLogLoaded = true; break; - case COUNTERS_LOG_GROUP_ID: - countersLogLoaded = true; + case GENERIC_SCROLL_GROUP_ID: + scrollInterfaceLoaded = true; break; } } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java index 5de68a0cb7..8c45359e61 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java @@ -43,7 +43,7 @@ import net.runelite.api.events.GameTick; import net.runelite.api.events.WidgetLoaded; import net.runelite.api.widgets.Widget; import static net.runelite.api.widgets.WidgetID.ADVENTURE_LOG_ID; -import static net.runelite.api.widgets.WidgetID.COUNTERS_LOG_GROUP_ID; +import static net.runelite.api.widgets.WidgetID.GENERIC_SCROLL_GROUP_ID; import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.chat.ChatCommandManager; import net.runelite.client.chat.ChatMessageManager; @@ -465,10 +465,10 @@ public class ChatCommandsPluginTest Widget countersPage = mock(Widget.class); when(countersPage.getText()).thenReturn(COUNTER_TEXT); - when(client.getWidget(WidgetInfo.COUNTERS_LOG_TEXT)).thenReturn(countersPage); + when(client.getWidget(WidgetInfo.GENERIC_SCROLL_TEXT)).thenReturn(countersPage); WidgetLoaded countersLogEvent = new WidgetLoaded(); - countersLogEvent.setGroupId(COUNTERS_LOG_GROUP_ID); + countersLogEvent.setGroupId(GENERIC_SCROLL_GROUP_ID); chatCommandsPlugin.onWidgetLoaded(countersLogEvent); chatCommandsPlugin.onGameTick(new GameTick()); @@ -521,10 +521,10 @@ public class ChatCommandsPluginTest Widget countersPage = mock(Widget.class); when(countersPage.getText()).thenReturn(COUNTER_TEXT); - when(client.getWidget(WidgetInfo.COUNTERS_LOG_TEXT)).thenReturn(countersPage); + when(client.getWidget(WidgetInfo.GENERIC_SCROLL_TEXT)).thenReturn(countersPage); WidgetLoaded countersLogEvent = new WidgetLoaded(); - countersLogEvent.setGroupId(COUNTERS_LOG_GROUP_ID); + countersLogEvent.setGroupId(GENERIC_SCROLL_GROUP_ID); chatCommandsPlugin.onWidgetLoaded(countersLogEvent); chatCommandsPlugin.onGameTick(new GameTick()); @@ -555,7 +555,7 @@ public class ChatCommandsPluginTest chatCommandsPlugin.onGameTick(new GameTick()); WidgetLoaded countersLogEvent = new WidgetLoaded(); - countersLogEvent.setGroupId(COUNTERS_LOG_GROUP_ID); + countersLogEvent.setGroupId(GENERIC_SCROLL_GROUP_ID); chatCommandsPlugin.onWidgetLoaded(countersLogEvent); chatCommandsPlugin.onGameTick(new GameTick()); From 1a7014a0f2b8895746e8e719cd0495bee46818d7 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Tue, 23 Jun 2020 16:18:51 -0700 Subject: [PATCH 20/45] SkillChallengeClue: Fix "Mine a mithril ore" step --- .../client/plugins/cluescrolls/clues/SkillChallengeClue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java index 02a8a15de9..de66057d6a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/SkillChallengeClue.java @@ -139,7 +139,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam new SkillChallengeClue("Kill a Dust Devil.", "slay a dust devil.", true, any("Facemask or Slayer Helmet", item(ItemID.FACEMASK), item(ItemID.SLAYER_HELMET), item(ItemID. SLAYER_HELMET_I), item(ItemID. BLACK_SLAYER_HELMET), item(ItemID. BLACK_SLAYER_HELMET_I), item(ItemID. PURPLE_SLAYER_HELMET), item(ItemID. PURPLE_SLAYER_HELMET_I), item(ItemID. RED_SLAYER_HELMET), item(ItemID. RED_SLAYER_HELMET_I), item(ItemID.GREEN_SLAYER_HELMET), item(ItemID. GREEN_SLAYER_HELMET_I), item(ItemID. TURQUOISE_SLAYER_HELMET), item(ItemID. TURQUOISE_SLAYER_HELMET_I), item(ItemID. HYDRA_SLAYER_HELMET), item(ItemID. HYDRA_SLAYER_HELMET_I))), new SkillChallengeClue("Catch a black warlock.", item(ItemID.BUTTERFLY_JAR), any("Butterfly Net", item(ItemID.BUTTERFLY_NET), item(ItemID.MAGIC_BUTTERFLY_NET))), new SkillChallengeClue("Catch a red chinchompa.", item(ItemID.BOX_TRAP)), - new SkillChallengeClue("Mine a piece of mithril ore.", ANY_PICKAXE), + new SkillChallengeClue("Mine a mithril ore.", ANY_PICKAXE), new SkillChallengeClue("Smith a mithril 2h sword.", item(ItemID.HAMMER), xOfItem(ItemID.MITHRIL_BAR, 3)), new SkillChallengeClue("Catch a raw shark.", ANY_HARPOON), new SkillChallengeClue("Cut a yew log.", ANY_AXE), From b4de8108658bdf434bddef116d0beb7579bdc915 Mon Sep 17 00:00:00 2001 From: MMagicala <36617521+MMagicala@users.noreply.github.com> Date: Tue, 23 Jun 2020 16:20:28 -0700 Subject: [PATCH 21/45] xp tracker: add option to sort skills by most recently gained xp --- .../runelite/client/plugins/xptracker/XpInfoBox.java | 5 +++++ .../client/plugins/xptracker/XpTrackerConfig.java | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java index a1aab90b80..fdd083262e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java @@ -251,6 +251,11 @@ class XpInfoBox extends JPanel panel.revalidate(); } + if (xpTrackerConfig.prioritizeRecentXpSkills()) + { + panel.setComponentZOrder(this, 0); + } + paused = skillPaused; // Update progress bar diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java index c195d46987..21ed053398 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java @@ -177,4 +177,15 @@ public interface XpTrackerConfig extends Config { return XpProgressBarLabel.PERCENTAGE; } + + @ConfigItem( + position = 12, + keyName = "prioritizeRecentXpSkills", + name = "Move recently trained skills to top", + description = "Configures whether skills should be organized by most recently gained xp" + ) + default boolean prioritizeRecentXpSkills() + { + return false; + } } From 3e7b9e169f48174f093560d4f9e15ed17fdb1ded Mon Sep 17 00:00:00 2001 From: johannfrias <30681899+johannfrias@users.noreply.github.com> Date: Wed, 24 Jun 2020 00:04:15 -0400 Subject: [PATCH 22/45] banktags: Save last opened tab when opening worn items (#11660) Co-authored-by: Ron Young --- .../net/runelite/api/widgets/WidgetID.java | 2 + .../net/runelite/api/widgets/WidgetInfo.java | 2 + .../plugins/banktags/tabs/TabInterface.java | 75 +++++++++++++------ 3 files changed, 56 insertions(+), 23 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 7f31f41813..3dc8a98bf6 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 @@ -252,6 +252,7 @@ public class WidgetID static final int BANK_CONTAINER = 1; static final int INVENTORY_ITEM_CONTAINER = 3; static final int BANK_TITLE_BAR = 3; + static final int TUTORIAL_BUTTON = 4; static final int ITEM_COUNT_TOP = 5; static final int ITEM_COUNT_BAR = 6; static final int ITEM_COUNT_BOTTOM = 7; @@ -264,6 +265,7 @@ public class WidgetID static final int INCINERATOR = 45; static final int INCINERATOR_CONFIRM = 46; static final int EQUIPMENT_CONTENT_CONTAINER = 68; + static final int SETTINGS_BUTTON = 108; static final int EQUIPMENT_BUTTON = 109; } diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index f9534c96f1..e8b389b897 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -147,6 +147,8 @@ public enum WidgetInfo BANK_ITEM_COUNT_BAR(WidgetID.BANK_GROUP_ID, WidgetID.Bank.ITEM_COUNT_BAR), BANK_ITEM_COUNT_BOTTOM(WidgetID.BANK_GROUP_ID, WidgetID.Bank.ITEM_COUNT_BOTTOM), BANK_PIN_CONTAINER(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.CONTAINER), + BANK_SETTINGS_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.SETTINGS_BUTTON), + BANK_TUTORIAL_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.TUTORIAL_BUTTON), GRAND_EXCHANGE_WINDOW_CONTAINER(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.WINDOW_CONTAINER), GRAND_EXCHANGE_OFFER_CONTAINER(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER_CONTAINER), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java index 329a539d93..a9c930258f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/tabs/TabInterface.java @@ -116,6 +116,11 @@ public class TabInterface private static final String TAB_MENU_KEY = "tagtabs"; private static final String TAB_MENU = TAG_SEARCH + TAB_MENU_KEY; private static final String OPEN_TAB_MENU = "View tag tabs"; + private static final String SHOW_WORN = "Show worn items"; + private static final String SHOW_SETTINGS = "Show menu"; + private static final String HIDE_WORN = "Hide worn items"; + private static final String HIDE_SETTINGS = "Hide menu"; + private static final String SHOW_TUTORIAL = "Show tutorial"; private static final int TAB_HEIGHT = 40; private static final int TAB_WIDTH = 39; private static final int BUTTON_HEIGHT = 20; @@ -497,29 +502,13 @@ public class TabInterface waitSearchTick = false; rememberedSearch = ""; - // If bank window was just hidden, update last active tab position - if (currentTabIndex != config.position()) - { - config.position(currentTabIndex); - } - - // Do the same for last active tab - if (config.rememberTab()) - { - if (activeTab == null && !Strings.isNullOrEmpty(config.tab())) - { - config.tab(""); - } - else if (activeTab != null && !activeTab.getTag().equals(config.tab())) - { - config.tab(activeTab.getTag()); - } - } - else if (!Strings.isNullOrEmpty(config.tab())) - { - config.tab(""); - } + saveTab(); + return; + } + // Don't continue ticking if equipment menu or bank menu is open + if (parent.isSelfHidden()) + { return; } @@ -578,6 +567,32 @@ public class TabInterface scrollTab(0); } + private void saveTab() + { + // If bank window was just hidden, update last active tab position + if (currentTabIndex != config.position()) + { + config.position(currentTabIndex); + } + + // Do the same for last active tab + if (config.rememberTab()) + { + if (activeTab == null && !Strings.isNullOrEmpty(config.tab())) + { + config.tab(""); + } + else if (activeTab != null && !activeTab.getTag().equals(config.tab())) + { + config.tab(activeTab.getTag()); + } + } + else if (!Strings.isNullOrEmpty(config.tab())) + { + config.tab(""); + } + } + private void setTabMenuVisible(boolean visible) { for (TagTab t : tabManager.getTabs()) @@ -753,6 +768,20 @@ public class TabInterface { handleDeposit(event, event.getWidgetId() == WidgetInfo.BANK_DEPOSIT_INVENTORY.getId()); } + else if (activeTab != null && ((event.getWidgetId() == WidgetInfo.BANK_EQUIPMENT_BUTTON.getId() && event.getMenuOption().equals(SHOW_WORN)) + || (event.getWidgetId() == WidgetInfo.BANK_SETTINGS_BUTTON.getId() && event.getMenuOption().equals(SHOW_SETTINGS)) + || (event.getWidgetId() == WidgetInfo.BANK_TUTORIAL_BUTTON.getId() && event.getMenuOption().equals(SHOW_TUTORIAL)))) + { + saveTab(); + rememberedSearch = TAG_SEARCH + activeTab.getTag(); + } + else if (!Strings.isNullOrEmpty(rememberedSearch) && ((event.getWidgetId() == WidgetInfo.BANK_EQUIPMENT_BUTTON.getId() && event.getMenuOption().equals(HIDE_WORN)) + || (event.getWidgetId() == WidgetInfo.BANK_SETTINGS_BUTTON.getId() && event.getMenuOption().equals(HIDE_SETTINGS)))) + { + bankSearch.reset(true); + bankSearch.search(InputType.NONE, rememberedSearch, true); + rememberedSearch = ""; + } } public void updateTabIfActive(final Collection tags) @@ -830,7 +859,7 @@ public class TabInterface { return; } - + if (client.getVar(Varbits.BANK_REARRANGE_MODE) == 0) { tabManager.swap(source.getName(), dest.getName()); From 573baa40fcd89b3d755cfa329c8b6a49f97ef711 Mon Sep 17 00:00:00 2001 From: MMagicala <36617521+MMagicala@users.noreply.github.com> Date: Tue, 23 Jun 2020 21:09:48 -0700 Subject: [PATCH 23/45] item charges: Fix Amulet of Chemistry charges for low-dose potions (#11825) Prior to this change, an amulet of chemistry creating potions of any dose amount less than four (by using it when mixing one-dose Stamina potions, for instance) would not have its charge count updated. --- .../plugins/itemcharges/ItemChargePlugin.java | 21 ++++---- .../itemcharges/ItemChargePluginTest.java | 50 +++++++++++++++++++ 2 files changed, 62 insertions(+), 9 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 b4714f096d..97ff94a705 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 @@ -84,9 +84,11 @@ public class ItemChargePlugin extends Plugin "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\\." + "Your amulet of chemistry helps you create a \\d-dose potion\\. (?:)?It has (\\d|one) charges? left\\." + ); + private static final Pattern AMULET_OF_CHEMISTRY_BREAK_PATTERN = Pattern.compile( + "Your amulet of chemistry helps you create a \\d-dose potion\\. (?:)?It then crumbles to dust\\." ); - 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\\." ); @@ -217,6 +219,7 @@ 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 amuletOfChemistryBreakMatcher = AMULET_OF_CHEMISTRY_BREAK_PATTERN.matcher(message); Matcher amuletOfBountyCheckMatcher = AMULET_OF_BOUNTY_CHECK_PATTERN.matcher(message); Matcher amuletOfBountyUsedMatcher = AMULET_OF_BOUNTY_USED_PATTERN.matcher(message); @@ -243,7 +246,7 @@ public class ItemChargePlugin extends Plugin } else if (amuletOfChemistryCheckMatcher.find()) { - updateAmuletOfChemistyCharges(Integer.parseInt(amuletOfChemistryCheckMatcher.group(1))); + updateAmuletOfChemistryCharges(Integer.parseInt(amuletOfChemistryCheckMatcher.group(1))); } else if (amuletOfChemistryUsedMatcher.find()) { @@ -255,11 +258,11 @@ public class ItemChargePlugin extends Plugin charges = Integer.parseInt(match); } - updateAmuletOfChemistyCharges(charges); + updateAmuletOfChemistryCharges(charges); } - else if (message.equals(AMULET_OF_CHEMISTRY_BREAK_TEXT)) + else if (amuletOfChemistryBreakMatcher.find()) { - updateAmuletOfChemistyCharges(MAX_AMULET_OF_CHEMISTRY_CHARGES); + updateAmuletOfChemistryCharges(MAX_AMULET_OF_CHEMISTRY_CHARGES); } else if (amuletOfBountyCheckMatcher.find()) { @@ -432,7 +435,7 @@ public class ItemChargePlugin extends Plugin } } - private void updateAmuletOfChemistyCharges(final int value) + private void updateAmuletOfChemistryCharges(final int value) { config.amuletOfChemistry(value); @@ -545,7 +548,7 @@ public class ItemChargePlugin extends Plugin updateRingOfForgingCharges(MAX_RING_OF_FORGING_CHARGES); break; case "Amulet of chemistry": - updateAmuletOfChemistyCharges(MAX_AMULET_OF_CHEMISTRY_CHARGES); + updateAmuletOfChemistryCharges(MAX_AMULET_OF_CHEMISTRY_CHARGES); break; } } @@ -633,7 +636,7 @@ public class ItemChargePlugin extends Plugin return false; } - final ItemChargeInfobox i = (ItemChargeInfobox)t; + final ItemChargeInfobox i = (ItemChargeInfobox) t; return i.getItem() == item && i.getSlot() == slot; }); } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/itemcharges/ItemChargePluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/itemcharges/ItemChargePluginTest.java index c5eea10375..6534225980 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/itemcharges/ItemChargePluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/itemcharges/ItemChargePluginTest.java @@ -62,6 +62,15 @@ public class ItemChargePluginTest private static final String USED_RING_OF_FORGING = "You retrieve a bar of iron."; private static final String BREAK_RING_OF_FORGING = "Your Ring of Forging has melted."; + private static final String CHECK_AMULET_OF_CHEMISTRY = "Your amulet of chemistry has 5 charges left."; + private static final String CHECK_AMULET_OF_CHEMISTRY_1 = "Your amulet of chemistry has 1 charge left."; + private static final String USED_AMULET_OF_CHEMISTRY = "Your amulet of chemistry helps you create a 4-dose potion. It has 4 charges left."; + private static final String USED_AMULET_OF_CHEMISTRY_3_DOSES = "Your amulet of chemistry helps you create a 3-dose potion. It has 2 charges left."; + private static final String USED_AMULET_OF_CHEMISTRY_2_DOSES = "Your amulet of chemistry helps you create a 2-dose potion. It has one charge left."; + private static final String BREAK_AMULET_OF_CHEMISTRY = "Your amulet of chemistry helps you create a 4-dose potion. It then crumbles to dust."; + private static final String BREAK_AMULET_OF_CHEMISTRY_3_DOSES = "Your amulet of chemistry helps you create a 3-dose potion. It then crumbles to dust."; + private static final String BREAK_AMULET_OF_CHEMISTRY_2_DOSES = "Your amulet of chemistry helps you create a 2-dose potion. It then crumbles to dust."; + @Mock @Bind private Client client; @@ -143,5 +152,46 @@ public class ItemChargePluginTest itemChargePlugin.onChatMessage(chatMessage); verify(config).ringOfForging(eq(140)); reset(config); + + chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", CHECK_AMULET_OF_CHEMISTRY, "", 0); + itemChargePlugin.onChatMessage(chatMessage); + verify(config).amuletOfChemistry(eq(5)); + reset(config); + + chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", CHECK_AMULET_OF_CHEMISTRY_1, "", 0); + itemChargePlugin.onChatMessage(chatMessage); + verify(config).amuletOfChemistry(eq(1)); + reset(config); + + chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", USED_AMULET_OF_CHEMISTRY, "", 0); + itemChargePlugin.onChatMessage(chatMessage); + verify(config).amuletOfChemistry(eq(4)); + reset(config); + + chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", USED_AMULET_OF_CHEMISTRY_3_DOSES, "", 0); + itemChargePlugin.onChatMessage(chatMessage); + verify(config).amuletOfChemistry(eq(2)); + reset(config); + + chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", USED_AMULET_OF_CHEMISTRY_2_DOSES, "", 0); + itemChargePlugin.onChatMessage(chatMessage); + verify(config).amuletOfChemistry(eq(1)); + reset(config); + + chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BREAK_AMULET_OF_CHEMISTRY, "", 0); + itemChargePlugin.onChatMessage(chatMessage); + verify(config).amuletOfChemistry(eq(5)); + reset(config); + + chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BREAK_AMULET_OF_CHEMISTRY_3_DOSES, "", 0); + itemChargePlugin.onChatMessage(chatMessage); + verify(config).amuletOfChemistry(eq(5)); + reset(config); + + chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", BREAK_AMULET_OF_CHEMISTRY_2_DOSES, "", 0); + itemChargePlugin.onChatMessage(chatMessage); + verify(config).amuletOfChemistry(eq(5)); + reset(config); + } } \ No newline at end of file From f7b49fa4e2f36dc608af3465883081a86e7301a2 Mon Sep 17 00:00:00 2001 From: Tim Hinz Date: Tue, 23 Jun 2020 23:27:05 -0700 Subject: [PATCH 24/45] mining: Add Daeyalt essence timers --- .../client/plugins/mining/MiningOverlay.java | 5 ++++ .../client/plugins/mining/MiningPlugin.java | 24 +++++++++++++++---- .../runelite/client/plugins/mining/Rock.java | 3 ++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java index df000638ea..86d3be1ef8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java @@ -46,6 +46,10 @@ class MiningOverlay extends Overlay private static final int ORE_VEIN_MIN_RESPAWN_TIME = 150; // Game ticks private static final float ORE_VEIN_RANDOM_PERCENT_THRESHOLD = (float) ORE_VEIN_MIN_RESPAWN_TIME / ORE_VEIN_MAX_RESPAWN_TIME; + static final int DAEYALT_MAX_RESPAWN_TIME = 110; // Game ticks + private static final int DAEYALT_MIN_RESPAWN_TIME = 91; // Game ticks + private static final float DAEYALT_RANDOM_PERCENT_THRESHOLD = (float) DAEYALT_MIN_RESPAWN_TIME / DAEYALT_MAX_RESPAWN_TIME; + static final int LOVAKITE_ORE_MAX_RESPAWN_TIME = 65; // Game ticks private static final int LOVAKITE_ORE_MIN_RESPAWN_TIME = 50; // Game ticks private static final float LOVAKITE_ORE_RANDOM_PERCENT_THRESHOLD = (float) LOVAKITE_ORE_MIN_RESPAWN_TIME / LOVAKITE_ORE_MAX_RESPAWN_TIME; @@ -104,6 +108,7 @@ class MiningOverlay extends Overlay // Recolour pie on motherlode veins or Lovakite ore during the portion of the timer where they may respawn if ((rock == Rock.ORE_VEIN && percent > ORE_VEIN_RANDOM_PERCENT_THRESHOLD) + || (rock == Rock.DAEYALT_ESSENCE && percent > DAEYALT_RANDOM_PERCENT_THRESHOLD) || (rock == Rock.LOVAKITE && percent > LOVAKITE_ORE_RANDOM_PERCENT_THRESHOLD)) { pieFillColor = Color.GREEN; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java index be0bdcee70..5c79687f6c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java @@ -128,23 +128,39 @@ public class MiningPlugin extends Plugin Rock rock = Rock.getRock(object.getId()); if (rock != null) { - RockRespawn rockRespawn = new RockRespawn(rock, object.getWorldLocation(), Instant.now(), (int) rock.getRespawnTime(region).toMillis(), rock.getZOffset()); - respawns.add(rockRespawn); + if (rock == Rock.DAEYALT_ESSENCE) + { + final WorldPoint point = object.getWorldLocation(); + respawns.removeIf(rockRespawn -> rockRespawn.getWorldPoint().equals(point)); + } + else + { + RockRespawn rockRespawn = new RockRespawn(rock, object.getWorldLocation(), Instant.now(), (int) rock.getRespawnTime(region).toMillis(), rock.getZOffset()); + respawns.add(rockRespawn); + } } } @Subscribe public void onGameObjectSpawned(GameObjectSpawned event) { - if (client.getGameState() != GameState.LOGGED_IN) + if (client.getGameState() != GameState.LOGGED_IN || recentlyLoggedIn) { return; } GameObject object = event.getGameObject(); + Rock rock = Rock.getRock(object.getId()); + // Inverse timer to track daeyalt essence active duration + if (rock == Rock.DAEYALT_ESSENCE) + { + final int region = client.getLocalPlayer().getWorldLocation().getRegionID(); + RockRespawn rockRespawn = new RockRespawn(rock, object.getWorldLocation(), Instant.now(), (int) rock.getRespawnTime(region).toMillis(), rock.getZOffset()); + respawns.add(rockRespawn); + } // If the Lovakite ore respawns before the timer is up, remove it - if (Rock.getRock(object.getId()) == Rock.LOVAKITE) + else if (rock == Rock.LOVAKITE) { final WorldPoint point = object.getWorldLocation(); respawns.removeIf(rockRespawn -> rockRespawn.getWorldPoint().equals(point)); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java b/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java index 8dc2bdac7b..b7a1398ef2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mining/Rock.java @@ -96,7 +96,8 @@ enum Rock URT_SALT(Duration.of(9, GAME_TICKS), 0, ROCKS_33254), EFH_SALT(Duration.of(9, GAME_TICKS), 0, ROCKS_33255), TE_SALT(Duration.of(9, GAME_TICKS), 0, ROCKS_33256), - BASALT(Duration.of(9, GAME_TICKS), 0, ROCKS_33257); + BASALT(Duration.of(9, GAME_TICKS), 0, ROCKS_33257), + DAEYALT_ESSENCE(Duration.of(MiningOverlay.DAEYALT_MAX_RESPAWN_TIME, GAME_TICKS), 0, DAEYALT_ESSENCE_39095); private static final int WILDERNESS_RESOURCE_AREA = 12605; private static final int MISCELLANIA = 10044; From b17ef5615bdb6d7729ae961e4d43caa2f80de8b0 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sun, 21 Jun 2020 15:58:55 -0700 Subject: [PATCH 25/45] discord: Add Darkmeyer and Hallowed Sepulchre minigame --- .../runelite/client/plugins/discord/DiscordGameEventType.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java index 26401c2bf5..21a474776b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java @@ -104,6 +104,7 @@ enum DiscordGameEventType CITY_CANIFIS("Canifis" , DiscordAreaType.CITIES, 13878), CITY_CATHERBY("Catherby" , DiscordAreaType.CITIES, 11317, 11318, 11061), CITY_CORSAIR_CAVE("Corsair Cove" , DiscordAreaType.CITIES, 10028, 10284), + CITY_DARKMEYER("Darkmeyer", DiscordAreaType.CITIES, 14388), CITY_DORGESH_KAAN("Dorgesh-Kaan" , DiscordAreaType.CITIES, 10835, 10834), CITY_DRAYNOR("Draynor" , DiscordAreaType.CITIES, 12338), CITY_EDGEVILLE("Edgeville" , DiscordAreaType.CITIES, 12342), @@ -121,7 +122,7 @@ enum DiscordGameEventType CITY_LOVAKENGJ_HOUSE("Lovakengj" , DiscordAreaType.CITIES, 5692, 5948, 5691, 5947, 6203, 6202, 5690, 5946), CITY_LUMBRIDGE("Lumbridge" , DiscordAreaType.CITIES, 12850), CITY_LUNAR_ISLE("Lunar Isle" , DiscordAreaType.CITIES, 8253, 8252, 8509, 8508), - CITY_MEIYERDITCH("Meiyerditch" , DiscordAreaType.CITIES, 14132, 14388, 14387, 14386, 14385), + CITY_MEIYERDITCH("Meiyerditch" , DiscordAreaType.CITIES, 14132, 14387, 14386, 14385), CITY_MISCELLANIA("Miscellania" , DiscordAreaType.CITIES, 10044, 10300), CITY_MOS_LE_HARMLESS("Mos Le'Harmless" , DiscordAreaType.CITIES, 14638), CITY_MORTTON("Mort'ton" , DiscordAreaType.CITIES, 13875), @@ -244,6 +245,7 @@ enum DiscordGameEventType MG_GAUNTLET("Gauntlet", DiscordAreaType.MINIGAMES, 12995), MG_INFERNO("The Inferno", DiscordAreaType.MINIGAMES, 9043), MG_LAST_MAN_STANDING("Last Man Standing", DiscordAreaType.MINIGAMES, 13660, 13659, 13658, 13916, 13915, 13914), + MG_HALLOWED_SEPULCHRE("Hallowed Sepulchre", DiscordAreaType.MINIGAMES, 8797, 9051, 9052, 9053, 9054, 9309, 9563, 9565, 9821, 10074, 10075, 10077), MG_MAGE_TRAINING_ARENA("Mage Training Arena", DiscordAreaType.MINIGAMES, 13462, 13463), MG_NIGHTMARE_ZONE("Nightmare Zone", DiscordAreaType.MINIGAMES, 9033), MG_PEST_CONTROL("Pest Control", DiscordAreaType.MINIGAMES, 10536), From e02bd1d5b8336f5d3f33ff44cc976169780d67f7 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 24 Jun 2020 10:01:46 -0400 Subject: [PATCH 26/45] client: remove itemskeptondeath plugin This is being superseded in the game update tomorrow - https://twitter.com/JagexAsh/status/1275786030038335488 --- .../itemskeptondeath/AlwaysLostItem.java | 67 -- .../itemskeptondeath/BrokenOnDeathItem.java | 113 --- .../itemskeptondeath/DynamicPriceItem.java | 107 --- .../itemskeptondeath/FixedPriceItem.java | 259 ------- .../plugins/itemskeptondeath/ItemStack.java | 36 - .../ItemsKeptOnDeathPlugin.java | 731 ------------------ .../itemskeptondeath/LostIfNotProtected.java | 45 -- .../client/plugins/itemskeptondeath/Pets.java | 99 --- .../itemskeptondeath/WidgetButton.java | 163 ---- .../ItemsKeptOnDeathPluginTest.java | 659 ---------------- 10 files changed, 2279 deletions(-) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/AlwaysLostItem.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/BrokenOnDeathItem.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/DynamicPriceItem.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/FixedPriceItem.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemStack.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPlugin.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/LostIfNotProtected.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/Pets.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/WidgetButton.java delete mode 100644 runelite-client/src/test/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPluginTest.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/AlwaysLostItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/AlwaysLostItem.java deleted file mode 100644 index 140b524cfe..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/AlwaysLostItem.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2018, TheStonedTurtle - * 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.itemskeptondeath; - -import com.google.common.collect.ImmutableMap; -import lombok.AllArgsConstructor; -import lombok.Getter; -import net.runelite.api.ItemID; - -/** - * Certain Items receive a white outline by Jagex as they are always lost on death. This is sometimes incorrectly - * added to Items by Jagex as the item is actually kept in non-pvp areas of the game, such as the Rune Pouch. - * - * The white outline will be added to these items when they are lost on death. - */ -@AllArgsConstructor -@Getter -enum AlwaysLostItem -{ - RUNE_POUCH(ItemID.RUNE_POUCH, true), - LOOTING_BAG(ItemID.LOOTING_BAG, false), - CLUE_BOX(ItemID.CLUE_BOX, false), - BRACELET_OF_ETHEREUM(ItemID.BRACELET_OF_ETHEREUM, false), - BRACELET_OF_ETHEREUM_UNCHARGED(ItemID.BRACELET_OF_ETHEREUM_UNCHARGED, false); - - private final int itemID; - private final boolean keptOutsideOfWilderness; - - private static final ImmutableMap ID_MAP; - - static - { - final ImmutableMap.Builder map = ImmutableMap.builder(); - for (final AlwaysLostItem p : values()) - { - map.put(p.itemID, p); - } - ID_MAP = map.build(); - } - - static AlwaysLostItem getByItemID(final int itemID) - { - return ID_MAP.get(itemID); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/BrokenOnDeathItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/BrokenOnDeathItem.java deleted file mode 100644 index 8512a05541..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/BrokenOnDeathItem.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2018, TheStonedTurtle - * 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.itemskeptondeath; - -import com.google.common.collect.ImmutableMap; -import javax.annotation.Nullable; -import lombok.AllArgsConstructor; -import net.runelite.api.ItemID; - -/** - * Some non tradeable items are kept on death inside low level wilderness (1-20) but are turned into a broken variant. - * - * The non-broken variant will be shown inside the interface. - */ -@AllArgsConstructor -enum BrokenOnDeathItem -{ - // Capes - FIRE_CAPE(ItemID.FIRE_CAPE, 50000), - FIRE_MAX_CAPE(ItemID.FIRE_MAX_CAPE, 50000), - INFERNAL_CAPE(ItemID.INFERNAL_CAPE, 50000), - INFERNAL_MAX_CAPE(ItemID.INFERNAL_MAX_CAPE, 50000), - AVAS_ASSEMBLER(ItemID.AVAS_ASSEMBLER, 75000), - ASSEMBLER_MAX_CAPE(ItemID.ASSEMBLER_MAX_CAPE, 75000), - - // Defenders - BRONZE_DEFENDER(ItemID.BRONZE_DEFENDER, 1000), - IRON_DEFENDER(ItemID.IRON_DEFENDER, 2000), - STEEL_DEFENDER(ItemID.STEEL_DEFENDER, 2500), - BLACK_DEFENDER(ItemID.BLACK_DEFENDER, 5000), - MITHRIL_DEFENDER(ItemID.MITHRIL_DEFENDER, 15000), - ADAMANT_DEFENDER(ItemID.ADAMANT_DEFENDER, 25000), - RUNE_DEFENDER(ItemID.RUNE_DEFENDER, 35000), - DRAGON_DEFENDER(ItemID.DRAGON_DEFENDER, 40000), - AVERNIC_DEFENDER(ItemID.AVERNIC_DEFENDER, 1000000), - - // Void - VOID_MAGE_HELM(ItemID.VOID_MAGE_HELM, 40000), - VOID_RANGER_HELM(ItemID.VOID_RANGER_HELM, 40000), - VOID_MELEE_HELM(ItemID.VOID_MELEE_HELM, 40000), - VOID_KNIGHT_TOP(ItemID.VOID_KNIGHT_TOP, 45000), - VOID_KNIGHT_ROBE(ItemID.VOID_KNIGHT_ROBE, 45000), - VOID_KNIGHT_GLOVES(ItemID.VOID_KNIGHT_GLOVES, 30000), - ELITE_VOID_TOP(ItemID.ELITE_VOID_TOP, 50000), - ELITE_VOID_ROBE(ItemID.ELITE_VOID_ROBE, 50000), - - // Barb Assault - FIGHTER_HAT(ItemID.FIGHTER_HAT, 45000), - RANGER_HAT(ItemID.RANGER_HAT, 45000), - HEALER_HAT(ItemID.HEALER_HAT, 45000), - FIGHTER_TORSO(ItemID.FIGHTER_TORSO, 50000), - PENANCE_SKIRT(ItemID.PENANCE_SKIRT, 20000), - - // Castle Wars - SARADOMIN_HALO(ItemID.SARADOMIN_HALO, 25000), - ZAMORAK_HALO(ItemID.ZAMORAK_HALO, 25000), - GUTHIX_HALO(ItemID.GUTHIX_HALO, 25000), - DECORATIVE_MAGIC_HAT(ItemID.DECORATIVE_ARMOUR_11898, 5000), - DECORATIVE_MAGIC_ROBE_TOP(ItemID.DECORATIVE_ARMOUR_11896, 5000), - DECORATIVE_MAGIC_ROBE_LEGS(ItemID.DECORATIVE_ARMOUR_11897, 5000), - DECORATIVE_RANGE_TOP(ItemID.DECORATIVE_ARMOUR_11899, 5000), - DECORATIVE_RANGE_BOTTOM(ItemID.DECORATIVE_ARMOUR_11900, 5000), - DECORATIVE_RANGE_QUIVER(ItemID.DECORATIVE_ARMOUR_11901, 5000), - GOLD_DECORATIVE_HELM(ItemID.DECORATIVE_HELM_4511, 5000), - GOLD_DECORATIVE_BODY(ItemID.DECORATIVE_ARMOUR_4509, 5000), - GOLD_DECORATIVE_LEGS(ItemID.DECORATIVE_ARMOUR_4510, 5000), - GOLD_DECORATIVE_SKIRT(ItemID.DECORATIVE_ARMOUR_11895, 5000), - GOLD_DECORATIVE_SHIELD(ItemID.DECORATIVE_SHIELD_4512, 5000), - GOLD_DECORATIVE_SWORD(ItemID.DECORATIVE_SWORD_4508, 5000); - - private final int itemID; - private final int repairPrice; - - private static final ImmutableMap REPAIR_MAP; - - static - { - final ImmutableMap.Builder map = new ImmutableMap.Builder<>(); - for (final BrokenOnDeathItem p : values()) - { - map.put(p.itemID, p.repairPrice); - } - REPAIR_MAP = map.build(); - } - - @Nullable - static Integer getRepairPrice(int itemId) - { - return REPAIR_MAP.get(itemId); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/DynamicPriceItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/DynamicPriceItem.java deleted file mode 100644 index 4726555485..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/DynamicPriceItem.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2019, TheStonedTurtle - * 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.itemskeptondeath; - -import com.google.common.collect.ImmutableMap; -import java.util.Map; -import javax.annotation.Nullable; -import lombok.AllArgsConstructor; -import lombok.Getter; -import net.runelite.api.ItemID; - -/** - * Degradable/Non-rechargeable Jewelry death prices are usually determined by the amount of charges the item has left. - * The price of each charge is based on the GE price of the fully charged item divided by the maximum item charges - * Charge price = GE Price / Max Charges - * Death Price = Charge price * Current Charges - */ -@AllArgsConstructor -@Getter -enum DynamicPriceItem -{ - GAMES_NECKLACE1(ItemID.GAMES_NECKLACE1, 1, 8, ItemID.GAMES_NECKLACE8), - GAMES_NECKLACE2(ItemID.GAMES_NECKLACE2, 2, 8, ItemID.GAMES_NECKLACE8), - GAMES_NECKLACE3(ItemID.GAMES_NECKLACE3, 3, 8, ItemID.GAMES_NECKLACE8), - GAMES_NECKLACE4(ItemID.GAMES_NECKLACE4, 4, 8, ItemID.GAMES_NECKLACE8), - GAMES_NECKLACE5(ItemID.GAMES_NECKLACE5, 5, 8, ItemID.GAMES_NECKLACE8), - GAMES_NECKLACE6(ItemID.GAMES_NECKLACE6, 6, 8, ItemID.GAMES_NECKLACE8), - GAMES_NECKLACE7(ItemID.GAMES_NECKLACE7, 7, 8, ItemID.GAMES_NECKLACE8), - - RING_OF_DUELING1(ItemID.RING_OF_DUELING1, 1, 8, ItemID.RING_OF_DUELING8), - RING_OF_DUELING2(ItemID.RING_OF_DUELING2, 2, 8, ItemID.RING_OF_DUELING8), - RING_OF_DUELING3(ItemID.RING_OF_DUELING3, 3, 8, ItemID.RING_OF_DUELING8), - RING_OF_DUELING4(ItemID.RING_OF_DUELING4, 4, 8, ItemID.RING_OF_DUELING8), - RING_OF_DUELING5(ItemID.RING_OF_DUELING5, 5, 8, ItemID.RING_OF_DUELING8), - RING_OF_DUELING6(ItemID.RING_OF_DUELING6, 6, 8, ItemID.RING_OF_DUELING8), - RING_OF_DUELING7(ItemID.RING_OF_DUELING7, 7, 8, ItemID.RING_OF_DUELING8), - - RING_OF_RETURNING1(ItemID.RING_OF_RETURNING1, 1, 5, ItemID.RING_OF_RETURNING5), - RING_OF_RETURNING2(ItemID.RING_OF_RETURNING2, 2, 5, ItemID.RING_OF_RETURNING5), - RING_OF_RETURNING3(ItemID.RING_OF_RETURNING3, 3, 5, ItemID.RING_OF_RETURNING5), - RING_OF_RETURNING4(ItemID.RING_OF_RETURNING4, 4, 5, ItemID.RING_OF_RETURNING5), - - NECKLACE_OF_PASSAGE1(ItemID.NECKLACE_OF_PASSAGE1, 1, 5, ItemID.NECKLACE_OF_PASSAGE5), - NECKLACE_OF_PASSAGE2(ItemID.NECKLACE_OF_PASSAGE2, 2, 5, ItemID.NECKLACE_OF_PASSAGE5), - NECKLACE_OF_PASSAGE3(ItemID.NECKLACE_OF_PASSAGE3, 3, 5, ItemID.NECKLACE_OF_PASSAGE5), - NECKLACE_OF_PASSAGE4(ItemID.NECKLACE_OF_PASSAGE4, 4, 5, ItemID.NECKLACE_OF_PASSAGE5), - - BURNING_AMULET1(ItemID.BURNING_AMULET1, 1, 5, ItemID.BURNING_AMULET5), - BURNING_AMULET2(ItemID.BURNING_AMULET2, 2, 5, ItemID.BURNING_AMULET5), - BURNING_AMULET3(ItemID.BURNING_AMULET3, 3, 5, ItemID.BURNING_AMULET5), - BURNING_AMULET4(ItemID.BURNING_AMULET4, 4, 5, ItemID.BURNING_AMULET5); - - private final int itemId; - private final int currentCharges; - private final int maxCharges; - private final int chargedId; - - private static final Map DYNAMIC_ITEMS; - - static - { - final ImmutableMap.Builder map = ImmutableMap.builder(); - for (final DynamicPriceItem p : values()) - { - map.put(p.itemId, p); - } - DYNAMIC_ITEMS = map.build(); - } - - /** - * Calculates the price off the partially charged jewelry based on the base items price - * @param basePrice price of the base item, usually the trade-able variant - * @return death price of the current DynamicPriceItem - */ - int calculateDeathPrice(final int basePrice) - { - return (basePrice / maxCharges) * currentCharges; - } - - @Nullable - static DynamicPriceItem find(int itemId) - { - return DYNAMIC_ITEMS.get(itemId); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/FixedPriceItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/FixedPriceItem.java deleted file mode 100644 index 04d731bb3d..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/FixedPriceItem.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) 2019, Adam - * Copyright (c) 2019, TheStonedTurtle - * 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.itemskeptondeath; - -import com.google.common.collect.ImmutableMap; -import java.util.Map; -import javax.annotation.Nullable; -import lombok.Getter; -import net.runelite.api.ItemID; - -/** - * Some items have a fixed price that is added to its default value when calculating death prices. - * These are typically imbued items, such as Berserker ring (i), to help it protect over the non-imbued variants. - */ -@Getter -enum FixedPriceItem -{ - IMBUED_BLACK_MASK_I(ItemID.BLACK_MASK_I, 5000), - IMBUED_BLACK_MASK_1_I(ItemID.BLACK_MASK_1_I, 5000), - IMBUED_BLACK_MASK_2_I(ItemID.BLACK_MASK_2_I, 5000), - IMBUED_BLACK_MASK_3_I(ItemID.BLACK_MASK_3_I, 5000), - IMBUED_BLACK_MASK_4_I(ItemID.BLACK_MASK_4_I, 5000), - IMBUED_BLACK_MASK_5_I(ItemID.BLACK_MASK_5_I, 5000), - IMBUED_BLACK_MASK_6_I(ItemID.BLACK_MASK_6_I, 5000), - IMBUED_BLACK_MASK_7_I(ItemID.BLACK_MASK_7_I, 5000), - IMBUED_BLACK_MASK_8_I(ItemID.BLACK_MASK_8_I, 5000), - IMBUED_BLACK_MASK_9_I(ItemID.BLACK_MASK_9_I, 5000), - IMBUED_BLACK_MASK_10_I(ItemID.BLACK_MASK_10_I, 5000), - - IMBUED_SLAYER_HELMET_I(ItemID.SLAYER_HELMET_I, 1000), - IMBUED_BLACK_SLAYER_HELMET_I(ItemID.BLACK_SLAYER_HELMET_I, 1000), - IMBUED_PURPLE_SLAYER_HELMET_I(ItemID.PURPLE_SLAYER_HELMET_I, 1000), - IMBUED_RED_SLAYER_HELMET_I(ItemID.RED_SLAYER_HELMET_I, 1000), - IMBUED_GREEN_SLAYER_HELMET_I(ItemID.GREEN_SLAYER_HELMET_I, 1000), - IMBUED_TURQUOISE_SLAYER_HELMET_I(ItemID.TURQUOISE_SLAYER_HELMET_I, 1000), - IMBUED_HYDRA_SLAYER_HELMET_I(ItemID.HYDRA_SLAYER_HELMET_I, 1000), - - IMBUED_ARCHERS_RING_I(ItemID.ARCHERS_RING_I, 2000), - IMBUED_BERSERKER_RING_I(ItemID.BERSERKER_RING_I, 2000), - IMBUED_SEERS_RING_I(ItemID.SEERS_RING_I, 2000), - - IMBUED_RING_OF_THE_GODS_I(ItemID.RING_OF_THE_GODS_I, 2000), - IMBUED_TREASONOUS_RING_I(ItemID.TREASONOUS_RING_I, 2000), - IMBUED_TYRANNICAL_RING_I(ItemID.TYRANNICAL_RING_I, 2000), - - GRACEFUL_HOOD(ItemID.GRACEFUL_HOOD, 1965), - GRACEFUL_CAPE(ItemID.GRACEFUL_CAPE, 2460), - GRACEFUL_TOP(ItemID.GRACEFUL_TOP, 2345), - GRACEFUL_LEGS(ItemID.GRACEFUL_LEGS, 2290), - GRACEFUL_GLOVES(ItemID.GRACEFUL_GLOVES, 1970), - GRACEFUL_BOOTS(ItemID.GRACEFUL_BOOTS, 2060), - - ANGLER_HAT(ItemID.ANGLER_HAT, 2600), - ANGLER_TOP(ItemID.ANGLER_TOP, 3550), - ANGLER_WADERS(ItemID.ANGLER_WADERS, 4400), - ANGLER_BOOTS(ItemID.ANGLER_BOOTS, 5300), - - PROSPECTOR_HELMET(ItemID.PROSPECTOR_HELMET, 2640), - PROSPECTOR_JACKET(ItemID.PROSPECTOR_JACKET, 3550), - PROSPECTOR_LEGS(ItemID.PROSPECTOR_LEGS, 4460), - PROSPECTOR_BOOTS(ItemID.PROSPECTOR_BOOTS, 5370), - - LUMBERJACK_HAT(ItemID.LUMBERJACK_HAT, 19950), - LUMBERJACK_TOP(ItemID.LUMBERJACK_TOP, 19950), - LUMBERJACK_LEGS(ItemID.LUMBERJACK_LEGS, 19950), - LUMBERJACK_BOOTS(ItemID.LUMBERJACK_BOOTS, 19950), - - ROGUE_MASK(ItemID.ROGUE_MASK, 725), - ROGUE_TOP(ItemID.ROGUE_TOP, 575), - ROGUE_TROUSERS(ItemID.ROGUE_TROUSERS, 500), - ROGUE_GLOVES(ItemID.ROGUE_GLOVES, 650), - ROGUE_BOOTS(ItemID.ROGUE_BOOTS, 650), - - SALVE_AMULET_EI(ItemID.SALVE_AMULETEI, 209900), - - RING_OF_WEALTH_1(ItemID.RING_OF_WEALTH_1, 500, ItemID.RING_OF_WEALTH), - RING_OF_WEALTH_2(ItemID.RING_OF_WEALTH_2, 1000, ItemID.RING_OF_WEALTH), - RING_OF_WEALTH_3(ItemID.RING_OF_WEALTH_3, 1500, ItemID.RING_OF_WEALTH), - RING_OF_WEALTH_4(ItemID.RING_OF_WEALTH_4, 2000, ItemID.RING_OF_WEALTH), - - AMULET_OF_GLORY1(ItemID.AMULET_OF_GLORY1, 500, ItemID.AMULET_OF_GLORY), - AMULET_OF_GLORY2(ItemID.AMULET_OF_GLORY2, 1000, ItemID.AMULET_OF_GLORY), - AMULET_OF_GLORY3(ItemID.AMULET_OF_GLORY3, 1500, ItemID.AMULET_OF_GLORY), - AMULET_OF_GLORY5(ItemID.AMULET_OF_GLORY5, 2500, ItemID.AMULET_OF_GLORY), - - COMBAT_BRACELET1(ItemID.COMBAT_BRACELET1, 500, ItemID.COMBAT_BRACELET), - COMBAT_BRACELET2(ItemID.COMBAT_BRACELET2, 1000, ItemID.COMBAT_BRACELET), - COMBAT_BRACELET3(ItemID.COMBAT_BRACELET3, 1500, ItemID.COMBAT_BRACELET), - COMBAT_BRACELET5(ItemID.COMBAT_BRACELET5, 2500, ItemID.COMBAT_BRACELET), - - SKILLS_NECKLACE1(ItemID.SKILLS_NECKLACE1, 500, ItemID.SKILLS_NECKLACE), - SKILLS_NECKLACE2(ItemID.SKILLS_NECKLACE2, 1000, ItemID.SKILLS_NECKLACE), - SKILLS_NECKLACE3(ItemID.SKILLS_NECKLACE3, 1500, ItemID.SKILLS_NECKLACE), - SKILLS_NECKLACE4(ItemID.SKILLS_NECKLACE5, 2500, ItemID.SKILLS_NECKLACE), - - AHRIMS_HOOD_25(ItemID.AHRIMS_HOOD_25, 2500, ItemID.AHRIMS_HOOD_0), - AHRIMS_HOOD_50(ItemID.AHRIMS_HOOD_50, 5000, ItemID.AHRIMS_HOOD_0), - AHRIMS_HOOD_75(ItemID.AHRIMS_HOOD_75, 7500, ItemID.AHRIMS_HOOD_0), - AHRIMS_HOOD_100(ItemID.AHRIMS_HOOD_100, 10000, ItemID.AHRIMS_HOOD_0), - AHRIMS_ROBETOP_25(ItemID.AHRIMS_ROBETOP_25, 2500, ItemID.AHRIMS_ROBETOP_0), - AHRIMS_ROBETOP_50(ItemID.AHRIMS_ROBETOP_50, 5000, ItemID.AHRIMS_ROBETOP_0), - AHRIMS_ROBETOP_75(ItemID.AHRIMS_ROBETOP_75, 7500, ItemID.AHRIMS_ROBETOP_0), - AHRIMS_ROBETOP_100(ItemID.AHRIMS_ROBETOP_100, 10000, ItemID.AHRIMS_ROBETOP_0), - AHRIMS_ROBESKIRT_25(ItemID.AHRIMS_ROBESKIRT_25, 2500, ItemID.AHRIMS_ROBESKIRT_0), - AHRIMS_ROBESKIRT_50(ItemID.AHRIMS_ROBESKIRT_50, 5000, ItemID.AHRIMS_ROBESKIRT_0), - AHRIMS_ROBESKIRT_75(ItemID.AHRIMS_ROBESKIRT_75, 7500, ItemID.AHRIMS_ROBESKIRT_0), - AHRIMS_ROBESKIRT_100(ItemID.AHRIMS_ROBESKIRT_100, 10000, ItemID.AHRIMS_ROBESKIRT_0), - AHRIMS_STAFF_25(ItemID.AHRIMS_STAFF_25, 2500, ItemID.AHRIMS_STAFF_0), - AHRIMS_STAFF_50(ItemID.AHRIMS_STAFF_50, 5000, ItemID.AHRIMS_STAFF_0), - AHRIMS_STAFF_75(ItemID.AHRIMS_STAFF_75, 7500, ItemID.AHRIMS_STAFF_0), - AHRIMS_STAFF_100(ItemID.AHRIMS_STAFF_100, 10000, ItemID.AHRIMS_STAFF_0), - - KARILS_COIF_25(ItemID.KARILS_COIF_25, 2500, ItemID.KARILS_COIF_0), - KARILS_COIF_50(ItemID.KARILS_COIF_50, 5000, ItemID.KARILS_COIF_0), - KARILS_COIF_75(ItemID.KARILS_COIF_75, 7500, ItemID.KARILS_COIF_0), - KARILS_COIF_100(ItemID.KARILS_COIF_100, 10000, ItemID.KARILS_COIF_0), - KARILS_LEATHERTOP_25(ItemID.KARILS_LEATHERTOP_25, 2500, ItemID.KARILS_LEATHERTOP_0), - KARILS_LEATHERTOP_50(ItemID.KARILS_LEATHERTOP_50, 5000, ItemID.KARILS_LEATHERTOP_0), - KARILS_LEATHERTOP_75(ItemID.KARILS_LEATHERTOP_75, 7500, ItemID.KARILS_LEATHERTOP_0), - KARILS_LEATHERTOP_100(ItemID.KARILS_LEATHERTOP_100, 10000, ItemID.KARILS_LEATHERTOP_0), - KARILS_LEATHERSKIRT_25(ItemID.KARILS_LEATHERSKIRT_25, 2500, ItemID.KARILS_LEATHERSKIRT_0), - KARILS_LEATHERSKIRT_50(ItemID.KARILS_LEATHERSKIRT_50, 5000, ItemID.KARILS_LEATHERSKIRT_0), - KARILS_LEATHERSKIRT_75(ItemID.KARILS_LEATHERSKIRT_75, 7500, ItemID.KARILS_LEATHERSKIRT_0), - KARILS_LEATHERSKIRT_100(ItemID.KARILS_LEATHERSKIRT_100, 10000, ItemID.KARILS_LEATHERSKIRT_0), - KARILS_CROSSBOW_25(ItemID.KARILS_CROSSBOW_25, 2500, ItemID.KARILS_CROSSBOW_0), - KARILS_CROSSBOW_50(ItemID.KARILS_CROSSBOW_50, 5000, ItemID.KARILS_CROSSBOW_0), - KARILS_CROSSBOW_75(ItemID.KARILS_CROSSBOW_75, 7500, ItemID.KARILS_CROSSBOW_0), - KARILS_CROSSBOW_100(ItemID.KARILS_CROSSBOW_100, 10000, ItemID.KARILS_CROSSBOW_0), - - DHAROKS_HELM_25(ItemID.DHAROKS_HELM_25, 2500, ItemID.DHAROKS_HELM_0), - DHAROKS_HELM_50(ItemID.DHAROKS_HELM_50, 5000, ItemID.DHAROKS_HELM_0), - DHAROKS_HELM_75(ItemID.DHAROKS_HELM_75, 7500, ItemID.DHAROKS_HELM_0), - DHAROKS_HELM_100(ItemID.DHAROKS_HELM_100, 10000, ItemID.DHAROKS_HELM_0), - DHAROKS_PLATEBODY_25(ItemID.DHAROKS_PLATEBODY_25, 2500, ItemID.DHAROKS_PLATEBODY_0), - DHAROKS_PLATEBODY_50(ItemID.DHAROKS_PLATEBODY_50, 5000, ItemID.DHAROKS_PLATEBODY_0), - DHAROKS_PLATEBODY_75(ItemID.DHAROKS_PLATEBODY_75, 7500, ItemID.DHAROKS_PLATEBODY_0), - DHAROKS_PLATEBODY_100(ItemID.DHAROKS_PLATEBODY_100, 10000, ItemID.DHAROKS_PLATEBODY_0), - DHAROKS_PLATELEGS_25(ItemID.DHAROKS_PLATELEGS_25, 2500, ItemID.DHAROKS_PLATELEGS_0), - DHAROKS_PLATELEGS_50(ItemID.DHAROKS_PLATELEGS_50, 5000, ItemID.DHAROKS_PLATELEGS_0), - DHAROKS_PLATELEGS_75(ItemID.DHAROKS_PLATELEGS_75, 7500, ItemID.DHAROKS_PLATELEGS_0), - DHAROKS_PLATELEGS_100(ItemID.DHAROKS_PLATELEGS_100, 10000, ItemID.DHAROKS_PLATELEGS_0), - DHAROKS_GREATAXE_25(ItemID.DHAROKS_GREATAXE_25, 2500, ItemID.DHAROKS_GREATAXE_0), - DHAROKS_GREATAXE_50(ItemID.DHAROKS_GREATAXE_50, 5000, ItemID.DHAROKS_GREATAXE_0), - DHAROKS_GREATAXE_75(ItemID.DHAROKS_GREATAXE_75, 7500, ItemID.DHAROKS_GREATAXE_0), - DHAROKS_GREATAXE_100(ItemID.DHAROKS_GREATAXE_100, 10000, ItemID.DHAROKS_GREATAXE_0), - - GUTHANS_HELM_25(ItemID.GUTHANS_HELM_25, 2500, ItemID.GUTHANS_HELM_0), - GUTHANS_HELM_50(ItemID.GUTHANS_HELM_50, 5000, ItemID.GUTHANS_HELM_0), - GUTHANS_HELM_75(ItemID.GUTHANS_HELM_75, 7500, ItemID.GUTHANS_HELM_0), - GUTHANS_HELM_100(ItemID.GUTHANS_HELM_100, 10000, ItemID.GUTHANS_HELM_0), - GUTHANS_PLATEBODY_25(ItemID.GUTHANS_PLATEBODY_25, 2500, ItemID.GUTHANS_PLATEBODY_0), - GUTHANS_PLATEBODY_50(ItemID.GUTHANS_PLATEBODY_50, 5000, ItemID.GUTHANS_PLATEBODY_0), - GUTHANS_PLATEBODY_75(ItemID.GUTHANS_PLATEBODY_75, 7500, ItemID.GUTHANS_PLATEBODY_0), - GUTHANS_PLATEBODY_100(ItemID.GUTHANS_PLATEBODY_100, 10000, ItemID.GUTHANS_PLATEBODY_0), - GUTHANS_CHAINSKIRT_25(ItemID.GUTHANS_CHAINSKIRT_25, 2500, ItemID.GUTHANS_CHAINSKIRT_0), - GUTHANS_CHAINSKIRT_50(ItemID.GUTHANS_CHAINSKIRT_50, 5000, ItemID.GUTHANS_CHAINSKIRT_0), - GUTHANS_CHAINSKIRT_75(ItemID.GUTHANS_CHAINSKIRT_75, 7500, ItemID.GUTHANS_CHAINSKIRT_0), - GUTHANS_CHAINSKIRT_100(ItemID.GUTHANS_CHAINSKIRT_100, 10000, ItemID.GUTHANS_CHAINSKIRT_0), - GUTHANS_WARSPEAR_25(ItemID.GUTHANS_WARSPEAR_25, 2500, ItemID.GUTHANS_WARSPEAR_0), - GUTHANS_WARSPEAR_50(ItemID.GUTHANS_WARSPEAR_50, 5000, ItemID.GUTHANS_WARSPEAR_0), - GUTHANS_WARSPEAR_75(ItemID.GUTHANS_WARSPEAR_75, 7500, ItemID.GUTHANS_WARSPEAR_0), - GUTHANS_WARSPEAR_100(ItemID.GUTHANS_WARSPEAR_100, 10000, ItemID.GUTHANS_WARSPEAR_0), - - TORAGS_HELM_25(ItemID.TORAGS_HELM_25, 2500, ItemID.TORAGS_HELM_0), - TORAGS_HELM_50(ItemID.TORAGS_HELM_50, 5000, ItemID.TORAGS_HELM_0), - TORAGS_HELM_75(ItemID.TORAGS_HELM_75, 7500, ItemID.TORAGS_HELM_0), - TORAGS_HELM_100(ItemID.TORAGS_HELM_100, 10000, ItemID.TORAGS_HELM_0), - TORAGS_PLATEBODY_25(ItemID.TORAGS_PLATEBODY_25, 2500, ItemID.TORAGS_PLATEBODY_0), - TORAGS_PLATEBODY_50(ItemID.TORAGS_PLATEBODY_50, 5000, ItemID.TORAGS_PLATEBODY_0), - TORAGS_PLATEBODY_75(ItemID.TORAGS_PLATEBODY_75, 7500, ItemID.TORAGS_PLATEBODY_0), - TORAGS_PLATEBODY_100(ItemID.TORAGS_PLATEBODY_100, 10000, ItemID.TORAGS_PLATEBODY_0), - TORAGS_PLATELEGS_25(ItemID.TORAGS_PLATELEGS_25, 2500, ItemID.TORAGS_PLATELEGS_0), - TORAGS_PLATELEGS_50(ItemID.TORAGS_PLATELEGS_50, 5000, ItemID.TORAGS_PLATELEGS_0), - TORAGS_PLATELEGS_75(ItemID.TORAGS_PLATELEGS_75, 7500, ItemID.TORAGS_PLATELEGS_0), - TORAGS_PLATELEGS_100(ItemID.TORAGS_PLATELEGS_100, 10000, ItemID.TORAGS_PLATELEGS_0), - TORAGS_HAMMERS_25(ItemID.TORAGS_HAMMERS_25, 2500, ItemID.TORAGS_HAMMERS_0), - TORAGS_HAMMERS_50(ItemID.TORAGS_HAMMERS_50, 5000, ItemID.TORAGS_HAMMERS_0), - TORAGS_HAMMERS_75(ItemID.TORAGS_HAMMERS_75, 7500, ItemID.TORAGS_HAMMERS_0), - TORAGS_HAMMERS_100(ItemID.TORAGS_HAMMERS_100, 10000, ItemID.TORAGS_HAMMERS_0), - - VERACS_HELM_25(ItemID.VERACS_HELM_25, 2500, ItemID.VERACS_HELM_0), - VERACS_HELM_50(ItemID.VERACS_HELM_50, 5000, ItemID.VERACS_HELM_0), - VERACS_HELM_75(ItemID.VERACS_HELM_75, 7500, ItemID.VERACS_HELM_0), - VERACS_HELM_100(ItemID.VERACS_HELM_100, 10000, ItemID.VERACS_HELM_0), - VERACS_BRASSARD_25(ItemID.VERACS_BRASSARD_25, 2500, ItemID.VERACS_BRASSARD_0), - VERACS_BRASSARD_50(ItemID.VERACS_BRASSARD_50, 5000, ItemID.VERACS_BRASSARD_0), - VERACS_BRASSARD_75(ItemID.VERACS_BRASSARD_75, 7500, ItemID.VERACS_BRASSARD_0), - VERACS_BRASSARD_100(ItemID.VERACS_BRASSARD_100, 10000, ItemID.VERACS_BRASSARD_0), - VERACS_PLATESKIRT_25(ItemID.VERACS_PLATESKIRT_25, 2500, ItemID.VERACS_PLATESKIRT_0), - VERACS_PLATESKIRT_50(ItemID.VERACS_PLATESKIRT_50, 5000, ItemID.VERACS_PLATESKIRT_0), - VERACS_PLATESKIRT_75(ItemID.VERACS_PLATESKIRT_75, 7500, ItemID.VERACS_PLATESKIRT_0), - VERACS_PLATESKIRT_100(ItemID.VERACS_PLATESKIRT_100, 10000, ItemID.VERACS_PLATESKIRT_0), - VERACS_FLAIL_25(ItemID.VERACS_FLAIL_25, 2500, ItemID.VERACS_FLAIL_0), - VERACS_FLAIL_50(ItemID.VERACS_FLAIL_50, 5000, ItemID.VERACS_FLAIL_0), - VERACS_FLAIL_75(ItemID.VERACS_FLAIL_75, 7500, ItemID.VERACS_FLAIL_0), - VERACS_FLAIL_100(ItemID.VERACS_FLAIL_100, 10000, ItemID.VERACS_FLAIL_0), - - AVERNIC_DEFENDER(ItemID.AVERNIC_DEFENDER, 4040000), - - ETERNAL_TELEPORT_CRYSTAL(ItemID.ETERNAL_TELEPORT_CRYSTAL, 78500), - ; - - private final int itemId; - private final int offset; - private final int baseId; - - private static final Map FIXED_ITEMS; - - static - { - final ImmutableMap.Builder map = ImmutableMap.builder(); - for (final FixedPriceItem p : values()) - { - map.put(p.itemId, p); - } - FIXED_ITEMS = map.build(); - } - - FixedPriceItem(final int itemId, final int offset, final int baseId) - { - this.itemId = itemId; - this.offset = offset; - this.baseId = baseId; - } - - FixedPriceItem(final int itemId, final int offset) - { - this(itemId, offset, -1); - } - - @Nullable - static FixedPriceItem find(int itemId) - { - return FIXED_ITEMS.get(itemId); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemStack.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemStack.java deleted file mode 100644 index d2f09dd856..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemStack.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2019, TheStonedTurtle - * 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.itemskeptondeath; - -import lombok.AllArgsConstructor; -import lombok.Data; - -@Data -@AllArgsConstructor -class ItemStack -{ - private int id; - private int qty; -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPlugin.java deleted file mode 100644 index afd0fe6602..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPlugin.java +++ /dev/null @@ -1,731 +0,0 @@ -/* - * Copyright (c) 2018, TheStonedTurtle - * Copyright (c) 2019, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.client.plugins.itemskeptondeath; - -import com.google.common.annotations.VisibleForTesting; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumSet; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import javax.inject.Inject; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import net.runelite.api.Client; -import net.runelite.api.Constants; -import net.runelite.api.FontID; -import net.runelite.api.InventoryID; -import net.runelite.api.Item; -import net.runelite.api.ItemComposition; -import net.runelite.api.ItemContainer; -import net.runelite.api.ItemID; -import net.runelite.api.ScriptID; -import net.runelite.api.SkullIcon; -import net.runelite.api.SpriteID; -import net.runelite.api.Varbits; -import net.runelite.api.WorldType; -import net.runelite.api.events.ScriptPostFired; -import net.runelite.api.vars.AccountType; -import net.runelite.api.widgets.Widget; -import net.runelite.api.widgets.WidgetInfo; -import net.runelite.api.widgets.WidgetType; -import net.runelite.client.eventbus.Subscribe; -import net.runelite.client.game.ItemManager; -import net.runelite.client.game.ItemMapping; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.util.QuantityFormatter; - -@PluginDescriptor( - name = "Items Kept on Death", - description = "Updates the Items Kept on Death interface to be more accurate", - enabledByDefault = false -) -@Slf4j -public class ItemsKeptOnDeathPlugin extends Plugin -{ - private static final int DEEP_WILDY = 20; - - private static final Pattern WILDERNESS_LEVEL_PATTERN = Pattern.compile("^Level: (\\d+).*"); - - @AllArgsConstructor - @Getter - @VisibleForTesting - static class DeathItems - { - private final List keptItems; - private final List lostItems; - private final boolean hasAlwaysLost; - } - - // Item Container helpers - private static final int MAX_ROW_ITEMS = 8; - private static final int ITEM_X_OFFSET = 5; - private static final int ITEM_Y_OFFSET = 25; - private static final int ITEM_X_STRIDE = 38; - private static final int ITEM_Y_STRIDE = 38; - private static final int ORIGINAL_LOST_HEIGHT = 209; - private static final int ORIGINAL_LOST_Y = 107; - - // Information panel text helpers - private static final String LINE_BREAK = "
"; - private static final int INFORMATION_CONTAINER_HEIGHT = 183; - private static final int FONT_COLOR = 0xFF981F; - - // Button Images - private static final int PROTECT_ITEM_SPRITE_ID = SpriteID.PRAYER_PROTECT_ITEM; - private static final int SKULL_SPRITE_ID = SpriteID.PLAYER_KILLER_SKULL_523; - private static final int SWORD_SPRITE_ID = SpriteID.MULTI_COMBAT_ZONE_CROSSED_SWORDS; - private static final int SKULL_2_SPRITE_ID = SpriteID.FIGHT_PITS_WINNER_SKULL_RED; - - @Inject - private Client client; - - @Inject - private ItemManager itemManager; - - private WidgetButton deepWildyButton; - private WidgetButton lowWildyButton; - - @VisibleForTesting - boolean isSkulled; - @VisibleForTesting - boolean protectingItem; - @VisibleForTesting - int wildyLevel; - - @Subscribe - public void onScriptPostFired(ScriptPostFired event) - { - if (event.getScriptId() == ScriptID.DEATH_KEEP_BUILD) - { - // The script in charge of building the Items Kept on Death interface has finished running. - // Make all necessary changes now. - - // Players inside Safe Areas (POH/Clan Wars) or playing DMM see the default interface - if (isInSafeArea() || client.getWorldType().contains(WorldType.DEADMAN)) - { - return; - } - - syncSettings(); - createWidgetButtons(); - rebuildItemsKeptOnDeathInterface(); - - final Widget keptText = client.getWidget(WidgetInfo.ITEMS_KEPT_ON_DEATH_TEXT); - keptText.setText("Items you will keep on death:"); - - final Widget lostText = client.getWidget(WidgetInfo.ITEMS_LOST_ON_DEATH_TEXT); - lostText.setText("Items you will lose on death:"); - } - } - - // Sync user settings - private void syncSettings() - { - final SkullIcon s = client.getLocalPlayer().getSkullIcon(); - // Ultimate iron men deaths are treated like they are always skulled - isSkulled = s == SkullIcon.SKULL || isUltimateIronman(); - protectingItem = client.getVar(Varbits.PRAYER_PROTECT_ITEM) == 1; - syncWildernessLevel(); - } - - private void syncWildernessLevel() - { - if (client.getVar(Varbits.IN_WILDERNESS) != 1) - { - // if they are in a PvP world and not in a safe zone act like in lvl 1 wildy - if (isInPvpWorld() && !isInPvPSafeZone()) - { - wildyLevel = 1; - return; - } - wildyLevel = -1; - return; - } - - final Widget wildernessLevelWidget = client.getWidget(WidgetInfo.PVP_WILDERNESS_LEVEL); - if (wildernessLevelWidget == null) - { - wildyLevel = -1; - return; - } - - final String wildernessLevelText = wildernessLevelWidget.getText(); - final Matcher m = WILDERNESS_LEVEL_PATTERN.matcher(wildernessLevelText); - if (!m.matches()) - { - wildyLevel = -1; - return; - } - - wildyLevel = Integer.parseInt(m.group(1)); - } - - private boolean isInPvpWorld() - { - final EnumSet world = client.getWorldType(); - return world.contains(WorldType.PVP); - } - - private boolean isProtectItemAllowed() - { - return !client.getWorldType().contains(WorldType.HIGH_RISK) - && !isUltimateIronman(); - } - - private boolean isInPvPSafeZone() - { - final Widget w = client.getWidget(WidgetInfo.PVP_WORLD_SAFE_ZONE); - return w != null && !w.isHidden(); - } - - private boolean isInSafeArea() - { - final Widget w = client.getWidget(WidgetInfo.ITEMS_KEPT_SAFE_ZONE_CONTAINER); - return w != null && !w.isHidden(); - } - - private boolean isUltimateIronman() - { - return client.getAccountType() == AccountType.ULTIMATE_IRONMAN; - } - - private int getDefaultItemsKept() - { - final int count = isSkulled ? 0 : 3; - return count + (protectingItem ? 1 : 0); - } - - private void rebuildItemsKeptOnDeathInterface() - { - final Widget lost = client.getWidget(WidgetInfo.ITEMS_LOST_ON_DEATH_CONTAINER); - final Widget kept = client.getWidget(WidgetInfo.ITEMS_KEPT_ON_DEATH_CONTAINER); - if (lost == null || kept == null) - { - return; - } - - lost.deleteAllChildren(); - kept.deleteAllChildren(); - - // Grab all items on player - final ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY); - final Item[] inv = inventory == null ? new Item[0] : inventory.getItems(); - final ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT); - final Item[] equip = equipment == null ? new Item[0] : equipment.getItems(); - - final DeathItems deathItems = calculateKeptLostItems(inv, equip); - - final List keptItems = deathItems.getKeptItems().stream() - .map(item -> createItemWidget(kept, item, true)).collect(Collectors.toList()); - final List lostItems = deathItems.getLostItems().stream() - .map(item -> createItemWidget(lost, item, false)).collect(Collectors.toList()); - - int rows = (keptItems.size() + MAX_ROW_ITEMS - 1) / MAX_ROW_ITEMS; - // Show an empty row if there isn't anything - if (rows > 0) - { - // ORIGINAL_LOST_Y/HEIGHT includes a row already - rows--; - } - // Adjust items lost container position if new rows were added to kept items container - lost.setOriginalY(ORIGINAL_LOST_Y + (rows * ITEM_Y_STRIDE)); - lost.setOriginalHeight(ORIGINAL_LOST_HEIGHT - (rows * ITEM_Y_STRIDE)); - positionWidgetItems(kept, keptItems); - positionWidgetItems(lost, lostItems); - - updateKeptWidgetInfoText(deathItems.isHasAlwaysLost(), keptItems, lostItems); - } - - /** - * Calculates which items will be kept/lost. first list is kept items, second is lost. - * - * @param inv players inventory - * @param equip players equipement - * @return list of items kept followed by a list of items lost - */ - @VisibleForTesting - DeathItems calculateKeptLostItems(final Item[] inv, final Item[] equip) - { - final List items = new ArrayList<>(); - Collections.addAll(items, inv); - Collections.addAll(items, equip); - - // Sort by item price - items.sort(Comparator.comparing(this::getDeathPrice).reversed()); - - boolean hasClueBox = false; - boolean hasAlwaysLost = false; - int keepCount = getDefaultItemsKept(); - - final List keptItems = new ArrayList<>(); - final List lostItems = new ArrayList<>(); - - for (final Item i : items) - { - final int id = i.getId(); - int qty = i.getQuantity(); - if (id == -1) - { - continue; - } - - // Bonds are always kept and do not count towards the limit. - if (id == ItemID.OLD_SCHOOL_BOND || id == ItemID.OLD_SCHOOL_BOND_UNTRADEABLE) - { - keptItems.add(new ItemStack(id, qty)); - continue; - } - - final AlwaysLostItem alwaysLostItem = AlwaysLostItem.getByItemID(id); - if (alwaysLostItem != null && (!alwaysLostItem.isKeptOutsideOfWilderness() || wildyLevel > 0)) - { - hasAlwaysLost = true; - hasClueBox = hasClueBox || id == ItemID.CLUE_BOX; - lostItems.add(new ItemStack(id, qty)); - continue; - } - - if (keepCount > 0) - { - // Keep most valuable items regardless of trade-ability. - if (i.getQuantity() > keepCount) - { - keptItems.add(new ItemStack(id, keepCount)); - qty -= keepCount; - keepCount = 0; - // Fall through to determine if the rest of the stack should drop - } - else - { - keptItems.add(new ItemStack(id, qty)); - keepCount -= qty; - continue; - } - } - - // Items are kept if: - // 1) is not tradeable - // 2) is under the deep wilderness line - // 3) is outside of the wilderness, or item has a broken form - if (!Pets.isPet(id) - && !LostIfNotProtected.isLostIfNotProtected(id) - && !isTradeable(itemManager.getItemComposition(id)) && wildyLevel <= DEEP_WILDY - && (wildyLevel <= 0 || BrokenOnDeathItem.getRepairPrice(i.getId()) != null)) - { - keptItems.add(new ItemStack(id, qty)); - } - else - { - // Otherwise, the item is lost - lostItems.add(new ItemStack(id, qty)); - } - } - - if (hasClueBox) - { - boolean alreadyProtectingClue = false; - for (final ItemStack item : keptItems) - { - if (isClueBoxable(item.getId())) - { - alreadyProtectingClue = true; - break; - } - } - - if (!alreadyProtectingClue) - { - int clueId = -1; - // Clue box protects the last clue in your inventory so loop over the players inv - for (final Item i : inv) - { - final int id = i.getId(); - if (id != -1 && isClueBoxable(id)) - { - clueId = id; - } - } - - if (clueId != -1) - { - // Move the boxed item to the kept items container and remove it from the lost items container - for (final ItemStack boxableItem : lostItems) - { - if (boxableItem.getId() == clueId) - { - if (boxableItem.getQty() > 1) - { - boxableItem.setQty(boxableItem.getQty() - 1); - keptItems.add(new ItemStack(clueId, 1)); - } - else - { - lostItems.remove(boxableItem); - keptItems.add(boxableItem); - } - break; - } - } - } - } - } - - return new DeathItems(keptItems, lostItems, hasAlwaysLost); - } - - @VisibleForTesting - boolean isClueBoxable(final int itemID) - { - final String name = itemManager.getItemComposition(itemID).getName(); - return name.contains("Clue scroll (") || name.contains("Reward casket ("); - } - - /** - * Get the price of an item - * - * @param item - * @return - */ - @VisibleForTesting - int getDeathPrice(Item item) - { - // 1) Check if the death price is dynamically calculated, if so return that value - // 2) If death price is based off another item default to that price, otherwise apply normal ItemMapping GE price - // 3) If still no price, default to store price - // 4) Apply fixed price offset if applicable - - int itemId = item.getId(); - // Unnote/unplaceholder item - int canonicalizedItemId = itemManager.canonicalize(itemId); - int exchangePrice = 0; - - final DynamicPriceItem dynamicPrice = DynamicPriceItem.find(canonicalizedItemId); - if (dynamicPrice != null) - { - final int basePrice = itemManager.getItemPrice(dynamicPrice.getChargedId(), true); - return dynamicPrice.calculateDeathPrice(basePrice); - } - - // Some items have artificially offset death prices - such as ring imbues - // which are +2k over the non imbues. Check if the item has a fixed price offset - final FixedPriceItem fixedPrice = FixedPriceItem.find(canonicalizedItemId); - if (fixedPrice != null && fixedPrice.getBaseId() != -1) - { - // Grab base item price - exchangePrice = itemManager.getItemPrice(fixedPrice.getBaseId(), true); - } - - // Jagex uses the repair price when determining which items are kept on death. - final Integer repairPrice = BrokenOnDeathItem.getRepairPrice(canonicalizedItemId); - if (repairPrice != null) - { - exchangePrice = repairPrice; - } - - if (exchangePrice == 0) - { - // Account for items whose death value comes from their tradeable variant (barrows) or components (ornate kits) - // ItemMapping.map will always return a collection with at least the passed ID - for (final int mappedID : ItemMapping.map(canonicalizedItemId)) - { - exchangePrice += itemManager.getItemPrice(mappedID, true); - } - - // If for some reason it still has no price default to the items store price - if (exchangePrice == 0) - { - final ItemComposition c1 = itemManager.getItemComposition(canonicalizedItemId); - exchangePrice = c1.getPrice(); - } - } - - // Apply fixed price offset - exchangePrice += fixedPrice == null ? 0 : fixedPrice.getOffset(); - - return exchangePrice; - } - - /** - * Position a list of widget items in the parent container - */ - private static void positionWidgetItems(final Widget parent, final List widgets) - { - int startingIndex = 0; - for (final Widget w : widgets) - { - final int originalX = ITEM_X_OFFSET + ((startingIndex % MAX_ROW_ITEMS) * ITEM_X_STRIDE); - final int originalY = ITEM_Y_OFFSET + ((startingIndex / MAX_ROW_ITEMS) * ITEM_Y_STRIDE); - - w.setOriginalX(originalX); - w.setOriginalY(originalY); - w.revalidate(); - - ++startingIndex; - } - - parent.revalidate(); - } - - /** - * Creates the text to be displayed in the right side of the interface based on current selections - */ - private String getInfoText(final boolean hasAlwaysLost) - { - final StringBuilder sb = new StringBuilder(); - if (isUltimateIronman()) - { - sb.append("You are an UIM which means 0 items are protected by default"); - } - else - { - sb.append("3 items protected by default"); - - if (isSkulled) - { - sb.append(LINE_BREAK) - .append("PK skull -3"); - } - - if (protectingItem) - { - sb.append(LINE_BREAK) - .append("Protect Item prayer +1"); - } - - sb.append(LINE_BREAK) - .append(String.format("Actually protecting %s items", getDefaultItemsKept())); - } - - - if (wildyLevel < 1) - { - sb.append(LINE_BREAK) - .append(LINE_BREAK) - .append("You will have 1 hour to retrieve your lost items."); - } - - if (hasAlwaysLost) - { - sb.append(LINE_BREAK) - .append(LINE_BREAK) - .append("Items with a white outline will always be lost."); - } - - sb.append(LINE_BREAK) - .append(LINE_BREAK) - .append("Untradeable items are kept on death in non-pvp scenarios."); - - return sb.toString(); - } - - /** - * Updates the information panel based on the item containers - */ - private void updateKeptWidgetInfoText(final boolean hasAlwaysLost, final List keptItems, final List lostItems) - { - // Add Information text widget - final Widget textWidget = findOrCreateInfoText(); - textWidget.setText(getInfoText(hasAlwaysLost)); - textWidget.revalidate(); - - // Update Items lost total value - long total = 0; - for (final Widget w : lostItems) - { - int cid = itemManager.canonicalize(w.getItemId()); - int price = itemManager.getItemPrice(cid); - if (price == 0) - { - // Default to alch price - price = (int) (itemManager.getItemComposition(cid).getPrice() * Constants.HIGH_ALCHEMY_MULTIPLIER); - } - total += (long) price * w.getItemQuantity(); - } - final Widget lostValue = client.getWidget(WidgetInfo.ITEMS_LOST_VALUE); - lostValue.setText(QuantityFormatter.quantityToStackSize(total) + " gp"); - - // Update Max items kept - final Widget max = client.getWidget(WidgetInfo.ITEMS_KEPT_MAX); - final int keptQty = keptItems.stream().mapToInt(Widget::getItemQuantity).sum(); - max.setText(String.format("Max items kept on death:

~ %d ~", keptQty)); - } - - /** - * Check if an item is tradeable to another player - * - * @param c The item - * @return - */ - private static boolean isTradeable(final ItemComposition c) - { - // ItemComposition:: isTradeable checks if they are traded on the grand exchange, some items are trade-able but not via GE - if (c.getNote() != -1 - || c.getLinkedNoteId() != -1 - || c.isTradeable()) - { - return true; - } - - final int id = c.getId(); - switch (id) - { - case ItemID.COINS_995: - case ItemID.PLATINUM_TOKEN: - return true; - default: - return false; - } - } - - private Widget findOrCreateInfoText() - { - // The text was on the ITEMS_KEPT_INFORMATION_CONTAINER widget - but now that it is a layer, - // we need to create a child widget to hold the text - final Widget parent = client.getWidget(WidgetInfo.ITEMS_KEPT_INFORMATION_CONTAINER); - - // Use the text TEXT widget if it already exists. It should be the last child of the parent - final Widget[] children = parent.getChildren(); - if (children != null && children.length > 0) - { - final Widget w = parent.getChild(children.length - 1); - if (w != null && w.getType() == WidgetType.TEXT) - { - log.debug("Reusing old text widget"); - return w; - } - } - - log.debug("Creating new text widget"); - - final Widget w = parent.createChild(-1, WidgetType.TEXT); - // Position under buttons taking remaining space - w.setOriginalWidth(parent.getOriginalWidth()); - w.setOriginalHeight(INFORMATION_CONTAINER_HEIGHT - parent.getOriginalHeight()); - w.setOriginalY(parent.getOriginalHeight()); - - w.setFontId(FontID.PLAIN_11); - w.setTextShadowed(true); - w.setTextColor(FONT_COLOR); - - // Need to adjust parent height so text is visible - parent.setOriginalHeight(INFORMATION_CONTAINER_HEIGHT); - parent.revalidate(); - - return w; - } - - private void createWidgetButtons() - { - final Widget parent = client.getWidget(WidgetInfo.ITEMS_KEPT_INFORMATION_CONTAINER); - // Change the information container from a text widget to a layer - parent.setType(WidgetType.LAYER); - parent.deleteAllChildren(); - - // Ultimate Iron men are always skulled and can't use the protect item prayer - WidgetButton protectItemButton = isProtectItemAllowed() - ? new WidgetButton(parent, "Protect Item Prayer", PROTECT_ITEM_SPRITE_ID, protectingItem, selected -> - { - protectingItem = selected; - rebuildItemsKeptOnDeathInterface(); - }) : null; - - WidgetButton skulledButton = !isUltimateIronman() - ? new WidgetButton(parent, "Skulled", SKULL_SPRITE_ID, isSkulled, selected -> - { - isSkulled = selected; - rebuildItemsKeptOnDeathInterface(); - }) : null; - - lowWildyButton = new WidgetButton(parent, "Low Wildy (1-20)", SWORD_SPRITE_ID, wildyLevel > 0 && wildyLevel <= DEEP_WILDY, selected -> - { - if (!selected) - { - syncWildernessLevel(); - } - else - { - wildyLevel = 1; - deepWildyButton.setSelected(false); - } - - rebuildItemsKeptOnDeathInterface(); - }); - - deepWildyButton = new WidgetButton(parent, "Deep Wildy (21+)", SKULL_2_SPRITE_ID, wildyLevel > DEEP_WILDY, selected -> - { - if (!selected) - { - syncWildernessLevel(); - } - else - { - wildyLevel = DEEP_WILDY + 1; - lowWildyButton.setSelected(false); - } - - rebuildItemsKeptOnDeathInterface(); - }); - - parent.revalidate(); - WidgetButton.layoutButtonsToContainer(parent, protectItemButton, skulledButton, lowWildyButton, deepWildyButton); - } - - /** - * Creates an Item Widget for use inside the Kept on Death Interface - * - * @param parent Widget to add element too as a child - * @param item the TempItem representing the item - * @param kept is the item being shown in the kept items container - * @return the Widget that was added to the `parent` - */ - private Widget createItemWidget(final Widget parent, final ItemStack item, boolean kept) - { - final int id = item.getId(); - final int qty = item.getQty(); - final ItemComposition c = itemManager.getItemComposition(id); - - final Widget itemWidget = parent.createChild(-1, WidgetType.GRAPHIC); - itemWidget.setOriginalWidth(Constants.ITEM_SPRITE_WIDTH); - itemWidget.setOriginalHeight(Constants.ITEM_SPRITE_HEIGHT); - itemWidget.setItemId(id); - itemWidget.setItemQuantity(qty); - itemWidget.setAction(1, String.format("Item: %s", c.getName())); - itemWidget.setOnOpListener(ScriptID.DEATH_KEEP_ITEM_EXAMINE, kept ? 1 : 0, qty, c.getName()); - itemWidget.setHasListener(true); - - final AlwaysLostItem alwaysLostItem = AlwaysLostItem.getByItemID(id); - final boolean whiteBorder = alwaysLostItem != null && (!alwaysLostItem.isKeptOutsideOfWilderness() || wildyLevel > 0); - itemWidget.setBorderType(whiteBorder ? 2 : 1); - - return itemWidget; - } -} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/LostIfNotProtected.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/LostIfNotProtected.java deleted file mode 100644 index 56a12c4b79..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/LostIfNotProtected.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2019, TheStonedTurtle - * 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.itemskeptondeath; - -import com.google.common.collect.ImmutableSet; -import java.util.Set; -import net.runelite.api.ItemID; - -final class LostIfNotProtected -{ - private static final Set ITEMS = ImmutableSet.of( - ItemID.AMULET_OF_THE_DAMNED, - ItemID.RING_OF_CHAROS, ItemID.RING_OF_CHAROSA, - ItemID.LUNAR_STAFF, - ItemID.SHADOW_SWORD, - ItemID.KERIS, ItemID.KERISP, ItemID.KERISP_10583, ItemID.KERISP_10584 - ); - - public static boolean isLostIfNotProtected(int id) - { - return ITEMS.contains(id); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/Pets.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/Pets.java deleted file mode 100644 index 6a4592e6be..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/Pets.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2018 Abex - * 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.itemskeptondeath; - -import com.google.common.collect.ImmutableSet; -import java.util.Set; -import static net.runelite.api.ItemID.*; - -final class Pets -{ - private Pets() - { - } - - private static final Set PETS = ImmutableSet.of( - BABY_MOLE, - PRINCE_BLACK_DRAGON, - PET_CORPOREAL_CRITTER, PET_DARK_CORE, - JALNIBREK, TZREKZUK, - KALPHITE_PRINCESS, KALPHITE_PRINCESS_12654, - LIL_ZIK, - SKOTOS, - PET_SNAKELING, PET_SNAKELING_12939, PET_SNAKELING_12940, - TZREKJAD, - VORKI, - - OLMLET, PUPPADILE, TEKTINY, VANGUARD, VASA_MINIRIO, VESPINA, - - PET_DAGANNOTH_PRIME, PET_DAGANNOTH_REX, PET_DAGANNOTH_SUPREME, - - PET_GENERAL_GRAARDOR, PET_KRIL_TSUTSAROTH, PET_KREEARRA, PET_ZILYANA, - - ABYSSAL_ORPHAN, - HELLPUPPY, - PET_KRAKEN, - MIDNIGHT, NOON, - PET_SMOKE_DEVIL, PET_SMOKE_DEVIL_22663, - IKKLE_HYDRA, IKKLE_HYDRA_22748, IKKLE_HYDRA_22750, IKKLE_HYDRA_22752, - - CALLISTO_CUB, - PET_CHAOS_ELEMENTAL, - SCORPIAS_OFFSPRING, - VENENATIS_SPIDERLING, - VETION_JR, VETION_JR_13180, - - BABY_CHINCHOMPA, BABY_CHINCHOMPA_13324, BABY_CHINCHOMPA_13325, BABY_CHINCHOMPA_13326, - BEAVER, - GIANT_SQUIRREL, DARK_SQUIRREL, - HERON, - RIFT_GUARDIAN, RIFT_GUARDIAN_20667, RIFT_GUARDIAN_20669, RIFT_GUARDIAN_20671, RIFT_GUARDIAN_20673, RIFT_GUARDIAN_20675, - RIFT_GUARDIAN_20677, RIFT_GUARDIAN_20679, RIFT_GUARDIAN_20681, RIFT_GUARDIAN_20683, RIFT_GUARDIAN_20685, RIFT_GUARDIAN_20687, - RIFT_GUARDIAN_20689, RIFT_GUARDIAN_20691, RIFT_GUARDIAN_21990, - ROCK_GOLEM, ROCK_GOLEM_21187, ROCK_GOLEM_21188, ROCK_GOLEM_21189, ROCK_GOLEM_21190, ROCK_GOLEM_21191, ROCK_GOLEM_21192, - ROCK_GOLEM_21193, ROCK_GOLEM_21194, ROCK_GOLEM_21195, ROCK_GOLEM_21196, ROCK_GOLEM_21197, ROCK_GOLEM_21340, ROCK_GOLEM_21358, - ROCK_GOLEM_21359, ROCK_GOLEM_21360, - ROCKY, - TANGLEROOT, - - PET_KITTEN, PET_KITTEN_1556, PET_KITTEN_1557, PET_KITTEN_1558, PET_KITTEN_1559, PET_KITTEN_1560, - PET_CAT, PET_CAT_1562, PET_CAT_1563, PET_CAT_1564, PET_CAT_1565, PET_CAT_1566, PET_CAT_1567, PET_CAT_1568, PET_CAT_1569, - PET_CAT_1570, PET_CAT_1571, PET_CAT_1572, - LAZY_CAT, LAZY_CAT_6550, LAZY_CAT_6551, LAZY_CAT_6552, LAZY_CAT_6553, LAZY_CAT_6554, - WILY_CAT, WILY_CAT_6556, WILY_CAT_6557, WILY_CAT_6558, WILY_CAT_6559, WILY_CAT_6560, - OVERGROWN_HELLCAT, HELL_CAT, HELLKITTEN, LAZY_HELL_CAT, WILY_HELLCAT, - - BLOODHOUND, - CHOMPY_CHICK, - HERBI, - PET_PENANCE_QUEEN, - PHOENIX - ); - - public static boolean isPet(int id) - { - return PETS.contains(id); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/WidgetButton.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/WidgetButton.java deleted file mode 100644 index 93cb27e41c..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemskeptondeath/WidgetButton.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2018, TheStonedTurtle - * 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.itemskeptondeath; - -import net.runelite.api.ScriptEvent; -import net.runelite.api.SpriteID; -import net.runelite.api.widgets.JavaScriptCallback; -import net.runelite.api.widgets.Widget; -import net.runelite.api.widgets.WidgetType; - -class WidgetButton -{ - private static final int ICON_HEIGHT = 26; - private static final int ICON_WIDTH = 26; - private static final int BACKGROUND_HEIGHT = 32; - private static final int BACKGROUND_WIDTH = 32; - private static final int PADDING = 5; - private static final int ICON_PADDING = (BACKGROUND_HEIGHT - ICON_HEIGHT) / 2; - - private static final int BACKGROUND_SPRITE_ID = SpriteID.EQUIPMENT_SLOT_TILE; - private static final int SELECTED_BACKGROUND_SPRITE_ID = SpriteID.EQUIPMENT_SLOT_SELECTED; - - @FunctionalInterface - public interface WidgetButtonCallback - { - void run(boolean newState); - } - - private final Widget parent; - private final String name; - private final int spriteID; - private boolean selected; - private final WidgetButtonCallback callback; - - private Widget icon; - private Widget background; - - WidgetButton( - final Widget parent, - final String name, - final int spriteID, - final boolean selectedStartState, - final WidgetButtonCallback callback) - { - this.parent = parent; - this.name = name; - this.spriteID = spriteID; - this.selected = selectedStartState; - this.callback = callback; - createBackgroundWidget(); - createIconWidget(); - } - - private void createBackgroundWidget() - { - background = createWidget(); - background.setOriginalWidth(BACKGROUND_WIDTH); - background.setOriginalHeight(BACKGROUND_HEIGHT); - syncBackgroundSprite(); - } - - private void createIconWidget() - { - icon = createWidget(); - icon.setAction(1, "Toggle:"); - icon.setOnOpListener((JavaScriptCallback) this::onButtonClicked); - icon.setOnMouseRepeatListener((JavaScriptCallback) e -> e.getSource().setOpacity(120)); - icon.setOnMouseLeaveListener((JavaScriptCallback) e -> e.getSource().setOpacity(0)); - icon.setHasListener(true); - icon.setSpriteId(spriteID); - } - - private Widget createWidget() - { - final Widget w = parent.createChild(-1, WidgetType.GRAPHIC); - w.setOriginalWidth(ICON_WIDTH); - w.setOriginalHeight(ICON_HEIGHT); - w.setName("" + this.name); - return w; - } - - public void setSelected(boolean selected) - { - this.selected = selected; - syncBackgroundSprite(); - } - - private void syncBackgroundSprite() - { - background.setSpriteId(selected ? SELECTED_BACKGROUND_SPRITE_ID : BACKGROUND_SPRITE_ID); - } - - /** - * Adds the collection of WidgetButtons to the container overriding any existing children. - * - * @param container Widget to add buttons too - * @param buttons buttons to add - */ - static void layoutButtonsToContainer(final Widget container, final WidgetButton... buttons) - { - // Each button has two widgets, Icon and Background - final int xIncrement = BACKGROUND_WIDTH + PADDING; - final int yIncrement = BACKGROUND_HEIGHT + PADDING; - int maxRowItems = container.getWidth() / xIncrement; - // Ensure at least 1 button per row - maxRowItems = maxRowItems < 1 ? 1 : maxRowItems; - - int index = 0; - for (final WidgetButton w : buttons) - { - if (w == null) - { - continue; - } - - final int originalX = ((index % maxRowItems) * xIncrement); - final int originalY = ((index / maxRowItems) * yIncrement); - w.background.setOriginalX(originalX); - w.background.setOriginalY(originalY); - w.background.revalidate(); - - // Icon must be padded to center inside image - w.icon.setOriginalX(originalX + ICON_PADDING); - w.icon.setOriginalY(originalY + ICON_PADDING); - w.icon.revalidate(); - - index++; - } - - final int numButtons = index; - final int rows = 1 + (numButtons > maxRowItems ? numButtons / maxRowItems : 0); - container.setOriginalHeight(yIncrement * rows); - container.revalidate(); - } - - private void onButtonClicked(ScriptEvent scriptEvent) - { - setSelected(!selected); - callback.run(selected); - } -} diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPluginTest.java deleted file mode 100644 index d9e15ae9a7..0000000000 --- a/runelite-client/src/test/java/net/runelite/client/plugins/itemskeptondeath/ItemsKeptOnDeathPluginTest.java +++ /dev/null @@ -1,659 +0,0 @@ -/* - * Copyright (c) 2019, TheStonedTurtle - * 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.itemskeptondeath; - -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.util.Arrays; -import java.util.Collections; -import java.util.List; -import net.runelite.api.Client; -import net.runelite.api.Item; -import net.runelite.api.ItemComposition; -import net.runelite.api.ItemID; -import net.runelite.client.game.ItemManager; -import static net.runelite.client.plugins.itemskeptondeath.ItemsKeptOnDeathPlugin.DeathItems; -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 ItemsKeptOnDeathPluginTest -{ - @Mock - @Bind - private Client client; - - @Mock - @Bind - private ItemManager itemManager; - - @Inject - private ItemsKeptOnDeathPlugin plugin; - - @Before - public void before() - { - Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this); - resetBuffs(); - } - - private void resetBuffs() - { - plugin.isSkulled = false; - plugin.protectingItem = false; - plugin.wildyLevel = -1; - } - - // Mocks an item and the necessary itemManager functions for it - private Item mItem(final int id, final int qty, final String name, final boolean tradeable, final int price) - { - // Mock Item Composition and necessary ItemManager methods for this item - ItemComposition c = mock(ItemComposition.class); - when(c.getId()) - .thenReturn(id); - when(c.getName()) - .thenReturn(name); - when(c.isTradeable()) - .thenReturn(tradeable); - when(c.getPrice()) - .thenReturn(price); - - if (!tradeable) - { - when(c.getNote()).thenReturn(-1); - when(c.getLinkedNoteId()).thenReturn(-1); - } - - when(itemManager.getItemComposition(id)).thenReturn(c); - when(itemManager.canonicalize(id)).thenReturn(id); - when(itemManager.getItemPrice(id, true)).thenReturn(price); - - return item(id, qty); - } - - // Creates a new item - private static Item item(final int id, final int qty) - { - return new Item(id, qty); - } - - @Test - public void deathPriceTestRegularItems() - { - final Item acs = mItem(ItemID.ARMADYL_CHAINSKIRT, 1, "Armadyl chainskirt", true, 27837495); - assertEquals(27837495, plugin.getDeathPrice(acs)); - - final Item karambwan = mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608); - assertEquals(608, plugin.getDeathPrice(karambwan)); - - final Item defender = mItem(ItemID.RUNE_DEFENDER, 1, "Rune defender", false, 35000); - assertEquals(35000, plugin.getDeathPrice(defender)); - } - - @Test - public void deathPriceTestItemMapping() - { - mItem(ItemID.OCCULT_NECKLACE, 1, "Occult necklace", true, 1000000); - mItem(ItemID.OCCULT_ORNAMENT_KIT, 1, "Occult ornament kit", true, 3000000); - final Item occult = mItem(ItemID.OCCULT_NECKLACE_OR, 1, "Occult necklace (or)", false, 0); - assertEquals(4000000, plugin.getDeathPrice(occult)); - - mItem(ItemID.BLACK_MASK, 1, "Black mask", true, 1000000); - final Item blackMask8 = mItem(ItemID.BLACK_MASK_8, 1, "Black mask (8)", false, 0); - assertEquals(1000000, plugin.getDeathPrice(blackMask8)); - final Item slayerHelm = mItem(ItemID.SLAYER_HELMET, 1, "Slayer helmet", false, 0); - assertEquals(1000000, plugin.getDeathPrice(slayerHelm)); - } - - @Test - public void deathPriceTestFixedPriceItems() - { - mItem(ItemID.KARILS_COIF_0, 1, "Karil's coif 0", true, 35000); - final Item coif = mItem(ItemID.KARILS_COIF_100, 1, "Karil's coif 100", false, 0); - final int coifOffset = FixedPriceItem.KARILS_COIF_100.getOffset(); - assertEquals(35000 + coifOffset, plugin.getDeathPrice(coif)); - - mItem(ItemID.AHRIMS_ROBETOP_0, 1, "Ahrim's robetop 0", true, 2500000); - final Item robetop = mItem(ItemID.AHRIMS_ROBETOP_25, 1, "Ahrim's robetop 100", false, 0); - final int robetopOffset = FixedPriceItem.AHRIMS_ROBETOP_25.getOffset(); - assertEquals(2500000 + robetopOffset, plugin.getDeathPrice(robetop)); - - mItem(ItemID.AMULET_OF_GLORY, 1, "Amulet of glory", true, 13000); - final Item glory = mItem(ItemID.AMULET_OF_GLORY3, 1, "Amulet of glory(3)", true, 0); - final int gloryOffset = FixedPriceItem.AMULET_OF_GLORY3.getOffset(); - assertEquals(13000 + gloryOffset, plugin.getDeathPrice(glory)); - - mItem(ItemID.COMBAT_BRACELET, 1, "Combat bracelet", true, 13500); - final Item brace = mItem(ItemID.COMBAT_BRACELET1, 1, "Combat bracelet(1)", true, 0); - final int braceletOffset = FixedPriceItem.COMBAT_BRACELET1.getOffset(); - assertEquals(13500 + braceletOffset, plugin.getDeathPrice(brace)); - - final Item amulet = mItem(ItemID.SALVE_AMULETEI, 1, "Salve Amulet(ei)", false, 300); - assertEquals(210200, plugin.getDeathPrice(amulet)); - } - - @Test - public void deathPriceTestDynamicPriceItems() - { - final Item rod8 = mItem(ItemID.RING_OF_DUELING8, 1, "Ring of dueling(8)", true, 725); - final Item rod3 = mItem(ItemID.RING_OF_DUELING3, 1, "Ring of dueling(3)", true, 0); - final Item rod1 = mItem(ItemID.RING_OF_DUELING1, 1, "Ring of dueling(1)", true, 0); - // Dynamic price items - final int rodPrice = 725 / 8; - assertEquals(rodPrice, plugin.getDeathPrice(rod1)); - assertEquals(725, plugin.getDeathPrice(rod8)); - assertEquals(rodPrice * 3, plugin.getDeathPrice(rod3)); - - final Item nop5 = mItem(ItemID.NECKLACE_OF_PASSAGE5, 1, "Necklace of passage(5)", true, 1250); - final Item nop4 = mItem(ItemID.NECKLACE_OF_PASSAGE4, 1, "Necklace of passage(4)", true, 0); - final Item nop2 = mItem(ItemID.NECKLACE_OF_PASSAGE2, 1, "Necklace of passage(2)", true, 0); - - final int nopPrice = 1250 / 5; - assertEquals(nopPrice * 2, plugin.getDeathPrice(nop2)); - assertEquals(nopPrice * 4, plugin.getDeathPrice(nop4)); - assertEquals(1250, plugin.getDeathPrice(nop5)); - } - - private Item[] getFourExpensiveItems() - { - return new Item[] - { - mItem(ItemID.TWISTED_BOW, 1, "Twister bow", true, Integer.MAX_VALUE), - mItem(ItemID.SCYTHE_OF_VITUR, 1, "Scythe of vitur", true, Integer.MAX_VALUE), - mItem(ItemID.ELYSIAN_SPIRIT_SHIELD, 1, "Elysian spirit shield", true, 800000000), - mItem(ItemID.ARCANE_SPIRIT_SHIELD, 1, "Arcane spirit shield", true, 250000000) - }; - } - - @Test - public void alwaysLostTestRunePouch() - { - final Item[] inv = getFourExpensiveItems(); - final Item[] equip = new Item[] - { - mItem(ItemID.RUNE_POUCH, 1, "Rune pouch", false, 1) - }; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - assertFalse(deathItems.isHasAlwaysLost()); - } - - @Test - public void alwaysLostTestRunePouchWildy() - { - final Item[] inv = getFourExpensiveItems(); - final Item[] equip = new Item[] - { - mItem(ItemID.RUNE_POUCH, 1, "Rune pouch", false, 1) - }; - - plugin.wildyLevel = 1; - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - assertTrue(deathItems.isHasAlwaysLost()); - } - - @Test - public void alwaysLostTestLootBag() - { - final Item[] inv = getFourExpensiveItems(); - final Item[] equip = new Item[] - { - mItem(ItemID.LOOTING_BAG, 1, "Looting bag", false, 1) - }; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - assertTrue(deathItems.isHasAlwaysLost()); - - } - - @Test - public void alwaysLostTestLootBagWildy() - { - final Item[] inv = getFourExpensiveItems(); - final Item[] equip = new Item[] - { - mItem(ItemID.LOOTING_BAG, 1, "Looting bag", false, 1) - }; - - plugin.wildyLevel = 1; - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - assertTrue(deathItems.isHasAlwaysLost()); - } - - private Item[] getClueBoxTestInventory() - { - return new Item[] - { - mItem(ItemID.BLACK_DHIDE_BODY, 1, "Black d'hide body", true, 7552), - mItem(ItemID.ARMADYL_CHAINSKIRT, 1, "Armadyl chainskirt", true, 27837495), - mItem(ItemID.PEGASIAN_BOOTS, 1, "Pegasian boots", true, 30542187), - mItem(ItemID.DRAGON_SCIMITAR, 1, "Dragon scimitar", true, 63123), - - mItem(ItemID.HELM_OF_NEITIZNOT, 1, "Helm of neitiznot", true, 45519), - mItem(ItemID.RUNE_DEFENDER, 1, "Rune defender", false, 35000), - mItem(ItemID.SPADE, 1, "Spade", true, 104), - mItem(ItemID.CLUE_SCROLL_EASY, 1, "Clue scroll (easy)", false, 50), - - mItem(ItemID.CLUE_BOX, 1, "Clue box", false, 50), - mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608), - mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608), - mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608), - - mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608), - mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608), - mItem(ItemID.LAW_RUNE, 200, "Law rune", true, 212), - mItem(ItemID.DUST_RUNE, 200, "Dust rune", true, 3), - - mItem(ItemID.CLUE_SCROLL_MASTER, 1, "Clue scroll (master)", false, 50), - mItem(ItemID.CLUELESS_SCROLL, 1, "Clueless scroll", false, 50), - }; - } - - @Test - public void isClueBoxableTest() - { - getClueBoxTestInventory(); - mItem(ItemID.REWARD_CASKET_EASY, 1, "Reward casket (easy)", false, 50); - - assertTrue(plugin.isClueBoxable(ItemID.CLUE_SCROLL_EASY)); - assertTrue(plugin.isClueBoxable(ItemID.CLUE_SCROLL_MASTER)); - assertTrue(plugin.isClueBoxable(ItemID.REWARD_CASKET_EASY)); - - assertFalse(plugin.isClueBoxable(ItemID.CLUELESS_SCROLL)); - assertFalse(plugin.isClueBoxable(ItemID.LAW_RUNE)); - assertFalse(plugin.isClueBoxable(ItemID.SPADE)); - } - - @Test - public void clueBoxTestDefault() - { - final Item[] inv = getClueBoxTestInventory(); - final Item[] equip = new Item[0]; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Arrays.asList( - new ItemStack(ItemID.PEGASIAN_BOOTS, 1), - new ItemStack(ItemID.ARMADYL_CHAINSKIRT, 1), - new ItemStack(ItemID.DRAGON_SCIMITAR, 1), - new ItemStack(ItemID.RUNE_DEFENDER, 1), - new ItemStack(ItemID.CLUE_SCROLL_EASY, 1), - new ItemStack(ItemID.CLUE_SCROLL_MASTER, 1), - new ItemStack(ItemID.CLUELESS_SCROLL, 1) - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - assertEquals((inv.length + equip.length) - expectedKept.size(), lost.size()); - } - - @Test - public void clueBoxTestDeepWildy() - { - final Item[] inv = getClueBoxTestInventory(); - final Item[] equip = new Item[0]; - - plugin.wildyLevel = 21; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Arrays.asList( - new ItemStack(ItemID.PEGASIAN_BOOTS, 1), - new ItemStack(ItemID.ARMADYL_CHAINSKIRT, 1), - new ItemStack(ItemID.DRAGON_SCIMITAR, 1), - new ItemStack(ItemID.CLUE_SCROLL_MASTER, 1) - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - final int keptOffset = expectedKept.size(); - assertEquals((inv.length + equip.length) - keptOffset, lost.size()); - } - - @Test - public void clueBoxTestDeepWildyProtectItem() - { - final Item[] inv = getClueBoxTestInventory(); - final Item[] equip = new Item[0]; - - plugin.wildyLevel = 21; - plugin.protectingItem = true; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Arrays.asList( - new ItemStack(ItemID.PEGASIAN_BOOTS, 1), - new ItemStack(ItemID.ARMADYL_CHAINSKIRT, 1), - new ItemStack(ItemID.DRAGON_SCIMITAR, 1), - new ItemStack(ItemID.HELM_OF_NEITIZNOT, 1), - new ItemStack(ItemID.CLUE_SCROLL_MASTER, 1) // Clue box - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - final int keptOffset = expectedKept.size(); - assertEquals((inv.length + equip.length) - keptOffset, lost.size()); - } - - @Test - public void clueBoxTestDeepWildySkulled() - { - final Item[] inv = getClueBoxTestInventory(); - final Item[] equip = new Item[0]; - - plugin.wildyLevel = 21; - plugin.isSkulled = true; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Collections.singletonList( - new ItemStack(ItemID.CLUE_SCROLL_MASTER, 1) - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - final int keptOffset = expectedKept.size(); - assertEquals(lost.size(), (inv.length + equip.length) - keptOffset); - } - - @Test - public void clueBoxTestLowWildy() - { - final Item[] inv = getClueBoxTestInventory(); - final Item[] equip = new Item[0]; - - plugin.wildyLevel = 1; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Arrays.asList( - new ItemStack(ItemID.PEGASIAN_BOOTS, 1), - new ItemStack(ItemID.ARMADYL_CHAINSKIRT, 1), - new ItemStack(ItemID.DRAGON_SCIMITAR, 1), - new ItemStack(ItemID.RUNE_DEFENDER, 1), // Rune defender protected because of broken variant - new ItemStack(ItemID.CLUE_SCROLL_MASTER, 1) - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - final int keptOffset = expectedKept.size(); - assertEquals(lost.size(), (inv.length + equip.length) - keptOffset); - } - - @Test - public void clueBoxTestLowWildyProtectItem() - { - final Item[] inv = getClueBoxTestInventory(); - final Item[] equip = new Item[0]; - - plugin.wildyLevel = 1; - plugin.protectingItem = true; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Arrays.asList( - new ItemStack(ItemID.PEGASIAN_BOOTS, 1), - new ItemStack(ItemID.ARMADYL_CHAINSKIRT, 1), - new ItemStack(ItemID.DRAGON_SCIMITAR, 1), - new ItemStack(ItemID.HELM_OF_NEITIZNOT, 1), - new ItemStack(ItemID.RUNE_DEFENDER, 1), // Rune defender protected because of broken variant - new ItemStack(ItemID.CLUE_SCROLL_MASTER, 1) - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - final int keptOffset = expectedKept.size(); - assertEquals((inv.length + equip.length) - keptOffset, lost.size()); - } - - @Test - public void clueBoxTestLowWildySkulled() - { - final Item[] inv = getClueBoxTestInventory(); - final Item[] equip = new Item[0]; - - plugin.wildyLevel = 1; - plugin.isSkulled = true; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Arrays.asList( - new ItemStack(ItemID.RUNE_DEFENDER, 1), // Rune defender protected because of broken variant - new ItemStack(ItemID.CLUE_SCROLL_MASTER, 1) - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - final int keptOffset = expectedKept.size(); - assertEquals((inv.length + equip.length) - keptOffset, lost.size()); - } - - private Item[] getClueBoxCasketTestInventory() - { - // Reward caskets can stack but the clue box should only protect one - return new Item[] - { - mItem(ItemID.BLACK_DHIDE_BODY, 1, "Black d'hide body", true, 7552), - mItem(ItemID.ARMADYL_CHAINSKIRT, 1, "Armadyl chainskirt", true, 27837495), - mItem(ItemID.PEGASIAN_BOOTS, 1, "Pegasian boots", true, 30542187), - mItem(ItemID.DRAGON_SCIMITAR, 1, "Dragon scimitar", true, 63123), - - mItem(ItemID.SPADE, 1, "Spade", true, 104), - mItem(ItemID.CLUE_SCROLL_EASY, 1, "Clue scroll (easy)", false, 50), - mItem(ItemID.REWARD_CASKET_EASY, 20, "Reward casket (easy)", false, 50), - mItem(ItemID.CLUE_BOX, 1, "Clue box", false, 50), - - mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608), - mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608), - mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608), - mItem(ItemID.COOKED_KARAMBWAN, 1, "Cooked karambwan", true, 608), - - mItem(ItemID.LAW_RUNE, 200, "Law rune", true, 212), - mItem(ItemID.DUST_RUNE, 200, "Dust rune", true, 3), - }; - } - - @Test - public void clueBoxTestCasketProtect() - { - final Item[] inv = getClueBoxCasketTestInventory(); - final Item[] equip = new Item[0]; - - plugin.wildyLevel = 1; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Arrays.asList( - new ItemStack(ItemID.PEGASIAN_BOOTS, 1), - new ItemStack(ItemID.ARMADYL_CHAINSKIRT, 1), - new ItemStack(ItemID.DRAGON_SCIMITAR, 1), - new ItemStack(ItemID.REWARD_CASKET_EASY, 1) // Clue box - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - final int keptOffset = expectedKept.size() - 1; // We are still losing some reward caskets. - assertEquals((inv.length + equip.length) - keptOffset, lost.size()); - } - - private Item[] getFullGracefulItems() - { - return new Item[] - { - mItem(ItemID.GRACEFUL_HOOD, 1, "Graceful hood", false, 35), - mItem(ItemID.GRACEFUL_CAPE, 1, "Graceful cape", false, 40), - mItem(ItemID.GRACEFUL_TOP, 1, "Graceful top", false, 55), - mItem(ItemID.GRACEFUL_LEGS, 1, "Graceful legs", false, 60), - mItem(ItemID.GRACEFUL_BOOTS, 1, "Graceful boots", false, 40), - mItem(ItemID.GRACEFUL_GLOVES, 1, "Graceful gloves", false, 30), - }; - } - - @Test - public void gracefulValueTest() - { - final Item[] inv = getFullGracefulItems(); - final Item[] equip = new Item[] - { - mItem(ItemID.AMULET_OF_GLORY6, 1, "Amulet of glory (6)", true, 20000) - }; - - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Arrays.asList( - new ItemStack(ItemID.AMULET_OF_GLORY6, 1), - new ItemStack(ItemID.GRACEFUL_CAPE, 1), - new ItemStack(ItemID.GRACEFUL_TOP, 1), - new ItemStack(ItemID.GRACEFUL_LEGS, 1), - new ItemStack(ItemID.GRACEFUL_BOOTS, 1), - new ItemStack(ItemID.GRACEFUL_HOOD, 1), - new ItemStack(ItemID.GRACEFUL_GLOVES, 1) - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - assertEquals((inv.length + equip.length) - expectedKept.size(), lost.size()); - } - - @Test - public void gracefulValueTestWildy() - { - final Item[] inv = getFullGracefulItems(); - final Item[] equip = new Item[] - { - mItem(ItemID.AMULET_OF_GLORY6, 1, "Amulet of glory (6)", true, 20000) - }; - - plugin.wildyLevel = 1; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - final List expectedKept = Arrays.asList( - new ItemStack(ItemID.AMULET_OF_GLORY6, 1), - new ItemStack(ItemID.GRACEFUL_CAPE, 1), - new ItemStack(ItemID.GRACEFUL_TOP, 1) - ); - assertEquals(expectedKept, kept); - - final List lost = deathItems.getLostItems(); - assertEquals((inv.length + equip.length) - expectedKept.size(), lost.size()); - } - - @Test - public void lostIfNotProtectedTestLost() - { - final Item[] inv = getFourExpensiveItems(); - final Item[] equip = new Item[] - { - mItem(ItemID.SHADOW_SWORD, 1, "Shadow sword", false, 1) - }; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List lost = deathItems.getLostItems(); - assertTrue(lost.contains(new ItemStack(ItemID.SHADOW_SWORD, 1))); - } - - @Test - public void lostIfNotProtectedTestKept() - { - final Item[] inv = new Item[] - { - mItem(ItemID.SHADOW_SWORD, 1, "Shadow sword", false, 1) - }; - final Item[] equip = new Item[0]; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, equip); - - final List kept = deathItems.getKeptItems(); - assertTrue(kept.contains(new ItemStack(ItemID.SHADOW_SWORD, 1))); - } - - @Test - public void brokenOnDeathTestRepairPrice() - { - // Dragon defender price should actually be pulled from BrokenOnDeathItem, and be lost on death - final Item[] inv = new Item[] - { - mItem(ItemID.BARROWS_GLOVES, 1, "Barrows gloves", false, 130000), - mItem(ItemID.DRAGON_DEFENDER, 1, "Dragon defender", false, 68007), - mItem(ItemID.DRAGON_SCIMITAR, 1, "Dragon scimitar", true, 63123), - mItem(ItemID.HELM_OF_NEITIZNOT, 1, "Helm of neitiznot", true, 45519), - }; - - plugin.wildyLevel = 21; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, new Item[0]); - - final List lost = deathItems.getLostItems(); - assertTrue(lost.contains(new ItemStack(ItemID.DRAGON_DEFENDER, 1))); - } - - @Test - public void avernicDefenderPriceTest() - { - final Item defender = mItem(ItemID.AVERNIC_DEFENDER, 1, "Avernic defender", false, 0); - final int defenderOffset = FixedPriceItem.AVERNIC_DEFENDER.getOffset(); - final Integer defenderBrokenPrice = BrokenOnDeathItem.getRepairPrice(ItemID.AVERNIC_DEFENDER); - final int defenderExpectedPrice = (defenderBrokenPrice == null ? 0 : defenderBrokenPrice) + defenderOffset; - assertEquals(defenderExpectedPrice, plugin.getDeathPrice(defender)); - - final Item[] inv = new Item[] - { - defender, - mItem(ItemID.BERSERKER_RING_I, 1, "Berserker Ring (i)", false, 3042579) - }; - - plugin.isSkulled = true; - plugin.protectingItem = true; - plugin.wildyLevel = 21; - - final DeathItems deathItems = plugin.calculateKeptLostItems(inv, new Item[0]); - - final List kept = deathItems.getKeptItems(); - assertTrue(kept.contains(new ItemStack(ItemID.AVERNIC_DEFENDER, 1))); - } -} From 6aa9990594385de59972fc3e0b3dd5480e54d2d0 Mon Sep 17 00:00:00 2001 From: Xortrox Date: Wed, 24 Jun 2020 10:40:02 -0400 Subject: [PATCH 27/45] clientui: remember sidebar state across restarts Co-authored-by: Adam --- .../java/net/runelite/client/ui/ClientUI.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java index 9fdd9d60ae..448c3179a6 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java @@ -107,6 +107,7 @@ public class ClientUI private static final String CONFIG_GROUP = "runelite"; private static final String CONFIG_CLIENT_BOUNDS = "clientBounds"; private static final String CONFIG_CLIENT_MAXIMIZED = "clientMaximized"; + private static final String CONFIG_CLIENT_SIDEBAR_CLOSED = "clientSidebarClosed"; private static final int CLIENT_WELL_HIDDEN_MARGIN = 160; private static final int CLIENT_WELL_HIDDEN_MARGIN_TOP = 10; public static final BufferedImage ICON = ImageUtil.getResourceStreamFromClass(ClientUI.class, "/runelite.png"); @@ -477,7 +478,8 @@ public class ClientUI sidebarNavigationButton = NavigationButton .builder() .priority(100) - .icon(sidebarClosedIcon) + .icon(sidebarOpenIcon) + .tooltip("Open SideBar") .onClick(this::toggleSidebar) .build(); @@ -487,7 +489,12 @@ public class ClientUI null); titleToolbar.addComponent(sidebarNavigationButton, sidebarNavigationJButton); - toggleSidebar(); + + // Open sidebar if the config closed state is unset + if (configManager.getConfiguration(CONFIG_GROUP, CONFIG_CLIENT_SIDEBAR_CLOSED) == null) + { + toggleSidebar(); + } }); } @@ -875,6 +882,7 @@ public class ClientUI { sidebarNavigationJButton.setIcon(new ImageIcon(sidebarOpenIcon)); sidebarNavigationJButton.setToolTipText("Open SideBar"); + configManager.setConfiguration(CONFIG_GROUP, CONFIG_CLIENT_SIDEBAR_CLOSED, true); contract(); @@ -885,6 +893,7 @@ public class ClientUI { sidebarNavigationJButton.setIcon(new ImageIcon(sidebarClosedIcon)); sidebarNavigationJButton.setToolTipText("Close SideBar"); + configManager.unsetConfiguration(CONFIG_GROUP, CONFIG_CLIENT_SIDEBAR_CLOSED); // Try to restore last panel expand(currentNavButton); @@ -1097,15 +1106,8 @@ public class ClientUI } else { - // Try to expand sidebar - if (!sidebarOpen) - { - bounds.width += pluginToolbar.getWidth(); - } - if (config.automaticResizeType() == ExpandResizeType.KEEP_GAME_SIZE) { - // Try to contract plugin panel if (pluginPanel != null) { From 8e1252ba5d6149c8a3ba70717446d42f5d36293f Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 24 Jun 2020 12:43:23 -0400 Subject: [PATCH 28/45] chat commands: name pb matcher groups --- .../plugins/chatcommands/ChatCommandsPlugin.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 7549d22106..5876051940 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -93,13 +93,13 @@ public class ChatCommandsPlugin extends Plugin { private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest|lap|completion) count is: (\\d+)"); private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: (\\d+)"); - private static final Pattern RAIDS_PB_PATTERN = Pattern.compile("Congratulations - your raid is complete!
Team size: (?:[0-9]+ players|Solo) Duration: ([0-9:]+) \\(new personal best\\)"); - private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: ([0-9:]+) \\(Personal best!\\)"); - private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: [0-9:]+
Personal best: ([0-9:]+)"); + private static final Pattern RAIDS_PB_PATTERN = Pattern.compile("Congratulations - your raid is complete!
Team size: (?:[0-9]+ players|Solo) Duration: (?[0-9:]+) \\(new personal best\\)"); + private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: (?[0-9:]+) \\(Personal best!\\)"); + private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: [0-9:]+
Personal best: (?[0-9:]+)"); private static final Pattern WINTERTODT_PATTERN = Pattern.compile("Your subdued Wintertodt count is: (\\d+)"); private static final Pattern BARROWS_PATTERN = Pattern.compile("Your Barrows chest count is: (\\d+)"); - private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: [0-9:]+\\. Personal best: ([0-9:]+)"); - private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: ([0-9:]+) \\(new personal best\\)"); + private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: [0-9:]+\\. Personal best: (?[0-9:]+)"); + private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: (?[0-9:]+) \\(new personal best\\)"); private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?"); private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?"); private static final Pattern ADVENTURE_LOG_TITLE_PATTERN = Pattern.compile("The Exploits of (.+)"); @@ -430,7 +430,7 @@ public class ChatCommandsPlugin extends Plugin private void matchPb(Matcher matcher) { - int seconds = timeStringToSeconds(matcher.group(1)); + int seconds = timeStringToSeconds(matcher.group("pb")); if (lastBossKill != null) { // Most bosses sent boss kill message, and then pb message, so we From d3e7998e99d69f14416e60a33d54adbda4c6fa0e Mon Sep 17 00:00:00 2001 From: melkypie <5113962+melkypie@users.noreply.github.com> Date: Sat, 6 Jun 2020 23:52:35 +0300 Subject: [PATCH 29/45] chatcommands: fix cox pb tracking for 24+ players team size --- .../client/plugins/chatcommands/ChatCommandsPlugin.java | 4 ++-- .../client/plugins/chatcommands/ChatCommandsPluginTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 5876051940..5cbaec8c6a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -93,7 +93,7 @@ public class ChatCommandsPlugin extends Plugin { private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest|lap|completion) count is: (\\d+)"); private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: (\\d+)"); - private static final Pattern RAIDS_PB_PATTERN = Pattern.compile("Congratulations - your raid is complete!
Team size: (?:[0-9]+ players|Solo) Duration: (?[0-9:]+) \\(new personal best\\)"); + private static final Pattern RAIDS_PB_PATTERN = Pattern.compile("Congratulations - your raid is complete!
Team size: (?:[0-9]+\\+? players|Solo) Duration: (?[0-9:]+) \\(new personal best\\)"); private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: (?[0-9:]+) \\(Personal best!\\)"); private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: [0-9:]+
Personal best: (?[0-9:]+)"); private static final Pattern WINTERTODT_PATTERN = Pattern.compile("Your subdued Wintertodt count is: (\\d+)"); @@ -103,7 +103,7 @@ public class ChatCommandsPlugin extends Plugin private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?"); private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?"); private static final Pattern ADVENTURE_LOG_TITLE_PATTERN = Pattern.compile("The Exploits of (.+)"); - private static final Pattern ADVENTURE_LOG_COX_PB_PATTERN = Pattern.compile("Fastest (?:kill|run)(?: - \\(Team size: (?:[0-9]+ players|Solo)\\))?: ([0-9:]+)"); + private static final Pattern ADVENTURE_LOG_COX_PB_PATTERN = Pattern.compile("Fastest (?:kill|run)(?: - \\(Team size: (?:[0-9]+\\+? players|Solo)\\))?: ([0-9:]+)"); private static final Pattern ADVENTURE_LOG_BOSS_PB_PATTERN = Pattern.compile("[a-zA-Z]+(?: [a-zA-Z]+)*"); private static final Pattern ADVENTURE_LOG_PB_PATTERN = Pattern.compile("(" + ADVENTURE_LOG_BOSS_PB_PATTERN + "(?: - " + ADVENTURE_LOG_BOSS_PB_PATTERN + ")*) (?:" + ADVENTURE_LOG_COX_PB_PATTERN + "( )*)+"); private static final Pattern HS_PB_PATTERN = Pattern.compile("Floor (?\\d) time: (?[0-9:]+)(?: \\(new personal best\\)|. Personal best: (?[0-9:]+))" + diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java index 8c45359e61..8419a215af 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java @@ -400,7 +400,7 @@ public class ChatCommandsPluginTest @Test public void testCoXKill() { - ChatMessage chatMessage = new ChatMessage(null, FRIENDSCHATNOTIFICATION, "", "Congratulations - your raid is complete!
Team size: 4 players Duration: 37:04 (new personal best)>", null, 0); + ChatMessage chatMessage = new ChatMessage(null, FRIENDSCHATNOTIFICATION, "", "Congratulations - your raid is complete!
Team size: 24+ players Duration: 37:04 (new personal best)>", null, 0); chatCommandsPlugin.onChatMessage(chatMessage); chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your completed Chambers of Xeric count is: 51.", null, 0); @@ -459,7 +459,7 @@ public class ChatCommandsPluginTest "

Hespori
Fastest kill: 0:57

Nightmare
" + "Fastest kill: 3:30

The Gauntlet
Fastest run: -" + "

The Corrupted Gauntlet
Fastest run: -

Fragment of Seren
Fastest kill: -" + - "

Chambers of Xeric
Fastest run - (Team size: 4 players): 24:17" + + "

Chambers of Xeric
Fastest run - (Team size: 24+ players): 24:17" + "

Chambers of Xeric - Challenge mode
Fastest run - (Team size: Solo): 22:15" + "

Barbarian Assault
High-level gambles: 0

Fremennik spirits rested: 0"; From 90aa9ecc099c3c3628bdeb8862c560b9353814f5 Mon Sep 17 00:00:00 2001 From: melkypie <5113962+melkypie@users.noreply.github.com> Date: Sat, 6 Jun 2020 23:59:09 +0300 Subject: [PATCH 30/45] chatcommands: allow cox pb to look at previous pb times from jagex --- .../plugins/chatcommands/ChatCommandsPlugin.java | 7 +++++++ .../chatcommands/ChatCommandsPluginTest.java | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 5cbaec8c6a..bfe3e3479d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -94,6 +94,7 @@ public class ChatCommandsPlugin extends Plugin private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest|lap|completion) count is: (\\d+)"); private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: (\\d+)"); private static final Pattern RAIDS_PB_PATTERN = Pattern.compile("Congratulations - your raid is complete!
Team size: (?:[0-9]+\\+? players|Solo) Duration: (?[0-9:]+) \\(new personal best\\)"); + private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("Congratulations - your raid is complete!
Team size: (?:[0-9]+\\+? players|Solo) Duration: [0-9:]+ Personal best: (?[0-9:]+)"); private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: (?[0-9:]+) \\(Personal best!\\)"); private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: [0-9:]+
Personal best: (?[0-9:]+)"); private static final Pattern WINTERTODT_PATTERN = Pattern.compile("Your subdued Wintertodt count is: (\\d+)"); @@ -365,6 +366,12 @@ public class ChatCommandsPlugin extends Plugin matchPb(matcher); } + matcher = RAIDS_DURATION_PATTERN.matcher(message); + if (matcher.find()) + { + matchPb(matcher); + } + matcher = TOB_WAVE_PB_PATTERN.matcher(message); if (matcher.find()) { diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java index 8419a215af..97c40c0cc3 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java @@ -410,6 +410,21 @@ public class ChatCommandsPluginTest verify(configManager).setConfiguration(eq("personalbest.adam"), eq("chambers of xeric"), eq(37 * 60 + 4)); } + @Test + public void testCoXKillUnknownPb() + { + when(configManager.getConfiguration("personalbest.adam", "chambers of xeric", int.class)).thenReturn(25 * 60 + 14); + + ChatMessage chatMessage = new ChatMessage(null, FRIENDSCHATNOTIFICATION, "", "Congratulations - your raid is complete!
Team size: 3 players Duration: 23:25 Personal best: 20:19", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your completed Chambers of Xeric count is: 52.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setConfiguration("killcount.adam", "chambers of xeric", 52); + verify(configManager).setConfiguration("personalbest.adam", "chambers of xeric", 20 * 60 + 19); + } + @Test public void testCoXKillNoPb() { From 48705635a2fa3ccb988495a1a402dcd32d8fa543 Mon Sep 17 00:00:00 2001 From: leejt Date: Mon, 8 Jun 2020 21:51:48 -0700 Subject: [PATCH 31/45] loottracker: add standard Casket --- .../client/plugins/loottracker/LootTrackerPlugin.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index 807e96172d..e20e250cea 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -198,6 +198,8 @@ public class LootTrackerPlugin extends Plugin "H.A.M. Member", "Woman" ); + private static final String CASKET_EVENT = "Casket"; + private static final Set VOWELS = ImmutableSet.of('a', 'e', 'i', 'o', 'u'); @Inject @@ -685,6 +687,7 @@ public class LootTrackerPlugin extends Plugin || HERBIBOAR_EVENT.equals(eventType) || HESPORI_EVENT.equals(eventType) || SEEDPACK_EVENT.equals(eventType) + || CASKET_EVENT.equals(eventType) || lootRecordType == LootRecordType.PICKPOCKET) { WorldPoint playerLocation = client.getLocalPlayer().getWorldLocation(); @@ -719,6 +722,13 @@ public class LootTrackerPlugin extends Plugin lootRecordType = LootRecordType.EVENT; takeInventorySnapshot(); } + + if (event.getMenuOption().equals("Open") && event.getId() == ItemID.CASKET) + { + eventType = CASKET_EVENT; + lootRecordType = LootRecordType.EVENT; + takeInventorySnapshot(); + } } @Schedule( From e60d603a07abdd7a44ca5a7ed3edd0d28f8be129 Mon Sep 17 00:00:00 2001 From: Jacob Scanlon Date: Wed, 24 Jun 2020 15:08:36 -0400 Subject: [PATCH 32/45] friends chat plugin: add configuration for join/leave timeout Co-authored-by: Adam --- .../friendschat/FriendsChatConfig.java | 23 ++++++++++++++----- .../friendschat/FriendsChatPlugin.java | 15 ++++++++---- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatConfig.java index 0859a6c35a..17ce7b0098 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatConfig.java @@ -106,11 +106,22 @@ public interface FriendsChatConfig extends Config return FriendsChatRank.UNRANKED; } + @ConfigItem( + keyName = "joinLeaveTimeout", + name = "Join/Leave timeout", + description = "Set the timeout duration of join/leave messages. A value of 0 will make the messages permanent.", + position = 6 + ) + default int joinLeaveTimeout() + { + return 20; + } + @ConfigItem( keyName = "privateMessageIcons", name = "Private Message Icons", description = "Add rank icons to private messages received from members.", - position = 6 + position = 7 ) default boolean privateMessageIcons() { @@ -121,7 +132,7 @@ public interface FriendsChatConfig extends Config keyName = "publicChatIcons", name = "Public Chat Icons", description = "Add rank icons to public chat messages from members.", - position = 7 + position = 8 ) default boolean publicChatIcons() { @@ -132,7 +143,7 @@ public interface FriendsChatConfig extends Config keyName = "clanTabChat", name = "Tab Chat", description = "Message friends chat without appending '/' when the friends chat tab is selected.", - position = 8 + position = 9 ) default boolean friendsChatTabChat() { @@ -143,7 +154,7 @@ public interface FriendsChatConfig extends Config keyName = "confirmKicks", name = "Confirm Kicks", description = "Shows a chat prompt to confirm kicks", - position = 9 + position = 10 ) default boolean confirmKicks() { @@ -154,7 +165,7 @@ public interface FriendsChatConfig extends Config keyName = "showIgnores", name = "Recolor ignored players", description = "Recolor members who are on your ignore list", - position = 10 + position = 11 ) default boolean showIgnores() { @@ -165,7 +176,7 @@ public interface FriendsChatConfig extends Config keyName = "showIgnoresColor", name = "Ignored color", description = "Allows you to change the color of the ignored players in your friends chat", - position = 11 + position = 12 ) default Color showIgnoresColor() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatPlugin.java index e442606192..87cb324c8d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendschat/FriendsChatPlugin.java @@ -42,10 +42,10 @@ import java.util.Map; import javax.inject.Inject; import net.runelite.api.ChatLineBuffer; import net.runelite.api.ChatMessageType; -import net.runelite.api.FriendsChatMember; -import net.runelite.api.FriendsChatManager; -import net.runelite.api.FriendsChatRank; import net.runelite.api.Client; +import net.runelite.api.FriendsChatManager; +import net.runelite.api.FriendsChatMember; +import net.runelite.api.FriendsChatRank; import net.runelite.api.GameState; import net.runelite.api.Ignore; import net.runelite.api.MessageNode; @@ -96,7 +96,6 @@ public class FriendsChatPlugin extends Plugin private static final int MAX_CHATS = 10; private static final String TITLE = "FC"; private static final String RECENT_TITLE = "Recent FCs"; - private static final int JOIN_LEAVE_DURATION = 20; private static final int MESSAGE_DELAY = 10; @Inject @@ -315,6 +314,12 @@ public class FriendsChatPlugin extends Plugin return; } + final int joinLeaveTimeout = config.joinLeaveTimeout(); + if (joinLeaveTimeout == 0) + { + return; + } + boolean removed = false; for (Iterator it = joinMessages.iterator(); it.hasNext(); ) @@ -323,7 +328,7 @@ public class FriendsChatPlugin extends Plugin MessageNode messageNode = joinMessage.getMessageNode(); final int createdTick = joinMessage.getTick(); - if (client.getTickCount() > createdTick + JOIN_LEAVE_DURATION) + if (client.getTickCount() > createdTick + joinLeaveTimeout) { it.remove(); From c5a698f8525b9da40d73ae409e9fbda55f8385c9 Mon Sep 17 00:00:00 2001 From: Mitchell Kovacs Date: Tue, 26 May 2020 23:57:34 -0400 Subject: [PATCH 33/45] Add Pyramid Plunder plugin Co-authored-by: Adam --- .../main/java/net/runelite/api/Varbits.java | 2 + .../pyramidplunder/PyramidPlunderConfig.java | 154 ++++++++++++ .../pyramidplunder/PyramidPlunderOverlay.java | 168 +++++++++++++ .../pyramidplunder/PyramidPlunderPlugin.java | 222 ++++++++++++++++++ .../pyramidplunder/PyramidPlunderTimer.java | 74 ++++++ 5 files changed, 620 insertions(+) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderConfig.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderOverlay.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderPlugin.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderTimer.java diff --git a/runelite-api/src/main/java/net/runelite/api/Varbits.java b/runelite-api/src/main/java/net/runelite/api/Varbits.java index 77fd2e191e..73e12683dd 100644 --- a/runelite-api/src/main/java/net/runelite/api/Varbits.java +++ b/runelite-api/src/main/java/net/runelite/api/Varbits.java @@ -356,7 +356,9 @@ public enum Varbits /** * Pyramid plunder */ + PYRAMID_PLUNDER_ROOM_LOCATION(2365), PYRAMID_PLUNDER_TIMER(2375), + PYRAMID_PLUNDER_THIEVING_LEVEL(2376), PYRAMID_PLUNDER_ROOM(2377), /** diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderConfig.java new file mode 100644 index 0000000000..107f7ee4c1 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderConfig.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2020 Mitchell + * 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.pyramidplunder; +import java.awt.Color; +import net.runelite.client.config.Config; +import net.runelite.client.config.ConfigGroup; +import net.runelite.client.config.ConfigItem; + +@ConfigGroup("pyramidplunder") +public interface PyramidPlunderConfig extends Config +{ + @ConfigItem( + position = 0, + keyName = "hideTimer", + name = "Hide default timer", + description = "Hides the default pyramid plunder timer" + ) + default boolean hideTimer() + { + return true; + } + + @ConfigItem( + position = 1, + keyName = "showExactTimer", + name = "Show exact timer", + description = "Displays the amount of time remaining as an infobox" + ) + default boolean showExactTimer() + { + return true; + } + + @ConfigItem( + position = 2, + keyName = "timerLowWarning", + name = "Timer low warning", + description = "Determines the time when the timers color will change" + ) + default int timerLowWarning() + { + return 30; + } + + @ConfigItem( + position = 3, + keyName = "highlightDoorsColor", + name = "Highlight doors color", + description = "Selects the color for highlighting tomb doors" + ) + default Color highlightDoorsColor() + { + return Color.green; + } + + @ConfigItem( + position = 4, + keyName = "highlightDoors", + name = "Highlight doors", + description = "Highlights the four tomb doors in each room" + ) + default boolean highlightDoors() + { + return true; + } + + @ConfigItem( + position = 5, + keyName = "highlightSpeartrapColor", + name = "Highlight speartrap color", + description = "Selects the color for highlighting speartraps" + ) + default Color highlightSpeartrapsColor() + { + return Color.orange; + } + + @ConfigItem( + position = 6, + keyName = "highlightSpeartraps", + name = "Highlight speartraps", + description = "Highlight the spear traps at the entrance of each room" + ) + default boolean highlightSpeartraps() + { + return true; + } + + @ConfigItem( + position = 7, + keyName = "highlightContainersColor", + name = "Highlight containers color", + description = "Selects the color for highlighting urns, chests and sarcophagus" + ) + default Color highlightContainersColor() + { + return Color.yellow; + } + + @ConfigItem( + position = 8, + keyName = "highlightUrnsFloor", + name = "Highlight urns floor", + description = "Highlight the urns starting at selected floor and up" + ) + default int highlightUrnsFloor() + { + return 9; + } + + @ConfigItem( + position = 9, + keyName = "highlightedChestFloor", + name = "Highlight chest floor", + description = "Highlight the Grand Gold Chest starting at selected floor and up" + ) + default int highlightChestFloor() + { + return 9; + } + + @ConfigItem( + position = 10, + keyName = "highlightedSarcophagusFloor", + name = "Highlight sarcophagus floor", + description = "Highlight the sarcophagus starting at selected floor and up" + ) + default int highlightSarcophagusFloor() + { + return 9; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderOverlay.java new file mode 100644 index 0000000000..aee5406f19 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderOverlay.java @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2020 Mitchell + * 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.pyramidplunder; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Shape; +import javax.inject.Inject; +import net.runelite.api.Client; +import net.runelite.api.GameObject; +import net.runelite.api.ObjectComposition; +import net.runelite.api.Point; +import net.runelite.api.Varbits; +import net.runelite.api.coords.LocalPoint; +import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetInfo; +import static net.runelite.client.plugins.pyramidplunder.PyramidPlunderPlugin.GRAND_GOLD_CHEST_CLOSED_ID; +import static net.runelite.client.plugins.pyramidplunder.PyramidPlunderPlugin.GRAND_GOLD_CHEST_ID; +import static net.runelite.client.plugins.pyramidplunder.PyramidPlunderPlugin.SARCOPHAGUS_CLOSED_ID; +import static net.runelite.client.plugins.pyramidplunder.PyramidPlunderPlugin.SARCOPHAGUS_ID; +import static net.runelite.client.plugins.pyramidplunder.PyramidPlunderPlugin.SPEARTRAP_ID; +import static net.runelite.client.plugins.pyramidplunder.PyramidPlunderPlugin.TOMB_DOOR_CLOSED_ID; +import static net.runelite.client.plugins.pyramidplunder.PyramidPlunderPlugin.TOMB_DOOR_WALL_IDS; +import static net.runelite.client.plugins.pyramidplunder.PyramidPlunderPlugin.URN_CLOSED_IDS; +import static net.runelite.client.plugins.pyramidplunder.PyramidPlunderPlugin.URN_IDS; +import net.runelite.client.ui.overlay.Overlay; +import net.runelite.client.ui.overlay.OverlayLayer; +import net.runelite.client.ui.overlay.OverlayPosition; +import net.runelite.client.ui.overlay.OverlayUtil; + +class PyramidPlunderOverlay extends Overlay +{ + private static final int MAX_DISTANCE = 2350; + + private final Client client; + private final PyramidPlunderPlugin plugin; + private final PyramidPlunderConfig config; + + @Inject + private PyramidPlunderOverlay(Client client, PyramidPlunderPlugin plugin, PyramidPlunderConfig config) + { + super(plugin); + setPosition(OverlayPosition.DYNAMIC); + setLayer(OverlayLayer.ABOVE_SCENE); + this.client = client; + this.plugin = plugin; + this.config = config; + } + + @Override + public Dimension render(Graphics2D graphics) + { + Widget ppWidget = client.getWidget(WidgetInfo.PYRAMID_PLUNDER_DATA); + if (ppWidget == null) + { + return null; + } + + ppWidget.setHidden(config.hideTimer()); + + LocalPoint playerLocation = client.getLocalPlayer().getLocalLocation(); + + // Highlight convex hulls of urns, chests, and sarcophagus + int currentFloor = client.getVar(Varbits.PYRAMID_PLUNDER_ROOM); + for (GameObject object : plugin.getObjectsToHighlight()) + { + if (config.highlightUrnsFloor() > currentFloor && URN_IDS.contains(object.getId()) + || config.highlightChestFloor() > currentFloor && GRAND_GOLD_CHEST_ID == object.getId() + || config.highlightSarcophagusFloor() > currentFloor && SARCOPHAGUS_ID == object.getId() + || object.getLocalLocation().distanceTo(playerLocation) >= MAX_DISTANCE) + { + continue; + } + + ObjectComposition imposter = client.getObjectDefinition(object.getId()).getImpostor(); + if (URN_CLOSED_IDS.contains(imposter.getId()) + || GRAND_GOLD_CHEST_CLOSED_ID == imposter.getId() + || SARCOPHAGUS_CLOSED_ID == imposter.getId()) + { + Shape shape = object.getConvexHull(); + + if (shape != null) + { + OverlayUtil.renderPolygon(graphics, shape, config.highlightContainersColor()); + } + } + } + + Point mousePosition = client.getMouseCanvasPosition(); + + // Highlight clickboxes of speartraps and tomb doors + plugin.getTilesToHighlight().forEach((object, tile) -> + { + if (!config.highlightDoors() && TOMB_DOOR_WALL_IDS.contains(object.getId()) + || !config.highlightSpeartraps() && SPEARTRAP_ID == object.getId() + || tile.getPlane() != client.getPlane() + || object.getLocalLocation().distanceTo(playerLocation) >= MAX_DISTANCE) + { + return; + } + + Color highlightColor; + if (SPEARTRAP_ID == object.getId()) + { + // this varbit is set to 1 when you enter a room and 0 once you get passed the spike traps + if (client.getVar(Varbits.PYRAMID_PLUNDER_ROOM_LOCATION) != 1) + { + return; + } + + highlightColor = config.highlightSpeartrapsColor(); + } + else + { + ObjectComposition imposter = client.getObjectDefinition(object.getId()).getImpostor(); + if (imposter.getId() != TOMB_DOOR_CLOSED_ID) + { + return; + } + + highlightColor = config.highlightDoorsColor(); + } + + Shape objectClickbox = object.getClickbox(); + if (objectClickbox != null) + { + if (objectClickbox.contains(mousePosition.getX(), mousePosition.getY())) + { + graphics.setColor(highlightColor.darker()); + } + else + { + graphics.setColor(highlightColor); + } + + graphics.draw(objectClickbox); + graphics.setColor(new Color(highlightColor.getRed(), highlightColor.getGreen(), + highlightColor.getBlue(), 50)); + graphics.fill(objectClickbox); + } + }); + + return null; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderPlugin.java new file mode 100644 index 0000000000..ef8c04e481 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderPlugin.java @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2020 Mitchell + * 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.pyramidplunder; + +import com.google.common.collect.ImmutableSet; +import com.google.inject.Provides; +import java.time.Duration; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.inject.Inject; +import lombok.Getter; +import net.runelite.api.Client; +import net.runelite.api.GameObject; +import net.runelite.api.GameState; +import static net.runelite.api.ItemID.PHARAOHS_SCEPTRE; +import static net.runelite.api.NullObjectID.*; +import static net.runelite.api.ObjectID.GRAND_GOLD_CHEST; +import static net.runelite.api.ObjectID.SARCOPHAGUS_21255; +import static net.runelite.api.ObjectID.SPEARTRAP_21280; +import static net.runelite.api.ObjectID.TOMB_DOOR_20948; +import static net.runelite.api.ObjectID.URN_21261; +import static net.runelite.api.ObjectID.URN_21262; +import static net.runelite.api.ObjectID.URN_21263; +import net.runelite.api.Tile; +import net.runelite.api.TileObject; +import net.runelite.api.Varbits; +import net.runelite.api.WallObject; +import net.runelite.api.events.GameObjectSpawned; +import net.runelite.api.events.GameStateChanged; +import net.runelite.api.events.GameTick; +import net.runelite.api.events.WallObjectSpawned; +import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetInfo; +import net.runelite.client.callback.ClientThread; +import net.runelite.client.config.ConfigManager; +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.OverlayManager; +import net.runelite.client.ui.overlay.infobox.InfoBoxManager; +import net.runelite.client.util.RSTimeUnit; + +@PluginDescriptor( + name = "Pyramid Plunder", + description = "Show custom overlay for Pyramid Plunder", + tags = {"minigame", "thieving", "pp"}, + enabledByDefault = false +) +public class PyramidPlunderPlugin extends Plugin +{ + // Total time of a pyramid plunder game (5 minutes) + private static final Duration PYRAMID_PLUNDER_DURATION = Duration.of(501, RSTimeUnit.GAME_TICKS); + private static final int PYRAMID_PLUNDER_REGION = 7749; + + static final Set TOMB_DOOR_WALL_IDS = ImmutableSet.of(NULL_26618, NULL_26619, NULL_26620, NULL_26621); + static final int TOMB_DOOR_CLOSED_ID = TOMB_DOOR_20948; + + static final int SPEARTRAP_ID = SPEARTRAP_21280; + + static final Set URN_IDS = ImmutableSet.of(NULL_26580, NULL_26600, NULL_26601, NULL_26602, + NULL_26603, NULL_26604, NULL_26605, NULL_26606, NULL_26607, NULL_26608, NULL_26609, NULL_26610, NULL_26611, + NULL_26612, NULL_26613); + static final Set URN_CLOSED_IDS = ImmutableSet.of(URN_21261, URN_21262, URN_21263); + + static final int GRAND_GOLD_CHEST_ID = NULL_26616; + static final int GRAND_GOLD_CHEST_CLOSED_ID = GRAND_GOLD_CHEST; + + static final int SARCOPHAGUS_ID = NULL_26626; + static final int SARCOPHAGUS_CLOSED_ID = SARCOPHAGUS_21255; + + @Inject + private Client client; + + @Inject + private PyramidPlunderConfig config; + + @Inject + private OverlayManager overlayManager; + + @Inject + private PyramidPlunderOverlay overlay; + + @Inject + private InfoBoxManager infoBoxManager; + + @Inject + private ItemManager itemManager; + + @Inject + private ClientThread clientThread; + + @Getter + private final Map tilesToHighlight = new HashMap<>(); + + @Getter + private final List objectsToHighlight = new ArrayList<>(); + + private PyramidPlunderTimer timer; + + @Provides + PyramidPlunderConfig getConfig(ConfigManager configManager) + { + return configManager.getConfig(PyramidPlunderConfig.class); + } + + @Override + protected void startUp() throws Exception + { + overlayManager.add(overlay); + } + + @Override + protected void shutDown() throws Exception + { + tilesToHighlight.clear(); + objectsToHighlight.clear(); + overlayManager.remove(overlay); + timer = null; + infoBoxManager.removeIf(PyramidPlunderTimer.class::isInstance); + + clientThread.invoke(() -> + { + Widget ppWidget = client.getWidget(WidgetInfo.PYRAMID_PLUNDER_DATA); + if (ppWidget != null) + { + ppWidget.setHidden(false); + } + }); + } + + @Subscribe + public void onGameStateChanged(GameStateChanged event) + { + if (event.getGameState() == GameState.LOADING) + { + tilesToHighlight.clear(); + objectsToHighlight.clear(); + } + } + + @Subscribe + public void onGameTick(GameTick tick) + { + if (isInPyramidPlunder()) + { + if (timer == null) + { + int ppTimer = client.getVar(Varbits.PYRAMID_PLUNDER_TIMER); + Duration remaining = PYRAMID_PLUNDER_DURATION.minus(ppTimer, RSTimeUnit.GAME_TICKS); + timer = new PyramidPlunderTimer(remaining, itemManager.getImage(PHARAOHS_SCEPTRE), this, + config, client); + infoBoxManager.addInfoBox(timer); + } + } + else if (timer != null) + { + infoBoxManager.removeInfoBox(timer); + timer = null; + } + } + + @Subscribe + public void onWallObjectSpawned(WallObjectSpawned event) + { + WallObject object = event.getWallObject(); + + if (TOMB_DOOR_WALL_IDS.contains(object.getId())) + { + tilesToHighlight.put(object, event.getTile()); + } + } + + @Subscribe + public void onGameObjectSpawned(GameObjectSpawned event) + { + GameObject object = event.getGameObject(); + + if (SPEARTRAP_ID == object.getId()) + { + tilesToHighlight.put(object, event.getTile()); + } + else if (URN_IDS.contains(object.getId()) + || GRAND_GOLD_CHEST_ID == object.getId() + || SARCOPHAGUS_ID == object.getId()) + { + objectsToHighlight.add(object); + } + } + + public boolean isInPyramidPlunder() + { + return client.getLocalPlayer() != null + && PYRAMID_PLUNDER_REGION == client.getLocalPlayer().getWorldLocation().getRegionID() + && client.getVar(Varbits.PYRAMID_PLUNDER_TIMER) > 0; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderTimer.java b/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderTimer.java new file mode 100644 index 0000000000..b1b9e35493 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/pyramidplunder/PyramidPlunderTimer.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2020 Mitchell + * 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.pyramidplunder; + +import java.awt.Color; +import java.awt.image.BufferedImage; +import java.time.Duration; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import net.runelite.api.Client; +import net.runelite.api.Varbits; +import net.runelite.client.ui.overlay.infobox.Timer; + +class PyramidPlunderTimer extends Timer +{ + private final PyramidPlunderConfig config; + private final Client client; + + public PyramidPlunderTimer( + Duration duration, + BufferedImage image, + PyramidPlunderPlugin plugin, + PyramidPlunderConfig config, + Client client + ) + { + super(duration.toMillis(), ChronoUnit.MILLIS, image, plugin); + this.config = config; + this.client = client; + } + + @Override + public Color getTextColor() + { + long secondsLeft = Duration.between(Instant.now(), getEndTime()).getSeconds(); + return secondsLeft < config.timerLowWarning() ? Color.RED.brighter() : Color.white; + } + + @Override + public String getTooltip() + { + int floor = client.getVar(Varbits.PYRAMID_PLUNDER_ROOM); + int thievingLevel = client.getVar(Varbits.PYRAMID_PLUNDER_THIEVING_LEVEL); + return String.format("Time remaining. Floor: %d. Thieving level: %d", floor, thievingLevel); + } + + @Override + public boolean render() + { + return config.showExactTimer(); + } +} From 86ddd6ebd42114a0b954e09e1055b788d2edf76b Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 24 Jun 2020 16:20:29 -0400 Subject: [PATCH 34/45] client: remove death indicator plugin The gane update tomorrow will contain a timer & map waypoint --- .../deathindicator/DeathIndicatorConfig.java | 155 ------- .../deathindicator/DeathIndicatorPlugin.java | 380 ------------------ .../deathindicator/DeathWorldMapPoint.java | 74 ---- 3 files changed, 609 deletions(-) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorConfig.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathWorldMapPoint.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorConfig.java deleted file mode 100644 index e35b7cc93f..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorConfig.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2018, Danny - * 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.deathindicator; - -import java.time.Instant; -import net.runelite.client.config.Config; -import net.runelite.client.config.ConfigGroup; -import net.runelite.client.config.ConfigItem; - -@ConfigGroup("deathIndicator") -public interface DeathIndicatorConfig extends Config -{ - @ConfigItem( - position = 1, - keyName = "deathHintArrow", - name = "Death Hint Arrow", - description = "Configures whether or not to show a hint arrow to death location" - ) - default boolean showDeathHintArrow() - { - return true; - } - - @ConfigItem( - position = 2, - keyName = "deathInfoBox", - name = "Death InfoBox", - description = "Configures whether or not to show item reclaim timer and death world infobox" - ) - default boolean showDeathInfoBox() - { - return true; - } - - @ConfigItem( - position = 3, - keyName = "deathOnWorldMap", - name = "Mark on World Map", - description = "Configures whether or not to show death location on the world map" - ) - default boolean showDeathOnWorldMap() - { - return true; - } - - // Stored Data - @ConfigItem( - keyName = "deathWorld", - name = "", - description = "", - hidden = true - ) - default int deathWorld() - { - return -1; - } - - @ConfigItem( - keyName = "deathWorld", - name = "", - description = "" - ) - void deathWorld(int deathWorld); - - @ConfigItem( - keyName = "deathLocationX", - name = "", - description = "", - hidden = true - ) - default int deathLocationX() - { - return -1; - } - - @ConfigItem( - keyName = "deathLocationX", - name = "", - description = "" - ) - void deathLocationX(int deathLocationX); - - @ConfigItem( - keyName = "deathLocationY", - name = "", - description = "", - hidden = true - ) - default int deathLocationY() - { - return -1; - } - - @ConfigItem( - keyName = "deathLocationY", - name = "", - description = "" - ) - void deathLocationY(int deathLocationY); - - @ConfigItem( - keyName = "deathLocationPlane", - name = "", - description = "", - hidden = true - ) - default int deathLocationPlane() - { - return -1; - } - - @ConfigItem( - keyName = "deathLocationPlane", - name = "", - description = "" - ) - void deathLocationPlane(int deathLocationPlane); - - @ConfigItem( - keyName = "timeOfDeath", - name = "", - description = "", - hidden = true - ) - Instant timeOfDeath(); - - @ConfigItem( - keyName = "timeOfDeath", - name = "", - description = "" - ) - void timeOfDeath(Instant timeOfDeath); -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java deleted file mode 100644 index 72608ec7a9..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathIndicatorPlugin.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright (c) 2018, Danny - * 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.deathindicator; - -import com.google.common.collect.ImmutableSet; -import com.google.inject.Provides; -import java.awt.image.BufferedImage; -import java.time.Duration; -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.Set; -import javax.inject.Inject; -import javax.inject.Named; -import lombok.extern.slf4j.Slf4j; -import net.runelite.api.Client; -import net.runelite.api.GameState; -import net.runelite.api.ItemID; -import net.runelite.api.MenuAction; -import net.runelite.api.coords.WorldPoint; -import net.runelite.api.events.CommandExecuted; -import net.runelite.api.events.GameStateChanged; -import net.runelite.api.events.GameTick; -import net.runelite.api.events.PlayerDeath; -import net.runelite.client.config.ConfigManager; -import net.runelite.client.eventbus.Subscribe; -import net.runelite.client.events.ConfigChanged; -import net.runelite.client.events.InfoBoxMenuClicked; -import net.runelite.client.game.ItemManager; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.ui.overlay.OverlayMenuEntry; -import net.runelite.client.ui.overlay.infobox.InfoBoxManager; -import net.runelite.client.ui.overlay.infobox.Timer; -import net.runelite.client.ui.overlay.worldmap.WorldMapPointManager; -import net.runelite.client.util.ImageUtil; - -@PluginDescriptor( - name = "Death Indicator", - description = "Show where you last died, and on what world", - tags = {"arrow", "hints", "world", "map", "overlay"} -) -@Slf4j -public class DeathIndicatorPlugin extends Plugin -{ - private static final String DEATH_TIMER_CLEAR = "Clear"; - private static final Set RESPAWN_REGIONS = ImmutableSet.of( - 6457, // Kourend - 12850, // Lumbridge - 11828, // Falador - 12342, // Edgeville - 11062, // Camelot - 13150, // Prifddinas (it's possible to spawn in 2 adjacent regions) - 12894 // Prifddinas - ); - - @Inject - private Client client; - - @Inject - private DeathIndicatorConfig config; - - @Inject - private WorldMapPointManager worldMapPointManager; - - @Inject - private InfoBoxManager infoBoxManager; - - @Inject - private ItemManager itemManager; - - @Inject - @Named("developerMode") - boolean developerMode; - - private BufferedImage mapArrow; - - private Timer deathTimer; - - private WorldPoint lastDeath; - private Instant lastDeathTime; - private int lastDeathWorld; - - @Provides - DeathIndicatorConfig deathIndicatorConfig(ConfigManager configManager) - { - return configManager.getConfig(DeathIndicatorConfig.class); - } - - @Override - protected void startUp() - { - if (!hasDied()) - { - return; - } - - resetInfobox(); - - if (client.getWorld() != config.deathWorld()) - { - return; - } - - if (config.showDeathHintArrow()) - { - if (!client.hasHintArrow()) - { - client.setHintArrow(new WorldPoint(config.deathLocationX(), config.deathLocationY(), config.deathLocationPlane())); - } - } - - if (config.showDeathOnWorldMap()) - { - worldMapPointManager.removeIf(DeathWorldMapPoint.class::isInstance); - worldMapPointManager.add(new DeathWorldMapPoint(new WorldPoint(config.deathLocationX(), config.deathLocationY(), config.deathLocationPlane()), this)); - } - } - - @Override - protected void shutDown() - { - if (client.hasHintArrow()) - { - client.clearHintArrow(); - } - - if (deathTimer != null) - { - infoBoxManager.removeInfoBox(deathTimer); - deathTimer = null; - } - - worldMapPointManager.removeIf(DeathWorldMapPoint.class::isInstance); - } - - @Subscribe - public void onPlayerDeath(PlayerDeath playerDeath) - { - if (client.isInInstancedRegion() || playerDeath.getPlayer() != client.getLocalPlayer()) - { - return; - } - - lastDeath = client.getLocalPlayer().getWorldLocation(); - lastDeathWorld = client.getWorld(); - lastDeathTime = Instant.now(); - } - - @Subscribe - public void onGameTick(GameTick event) - { - // Check if player respawned in a death respawn location - if (lastDeath != null && !client.getLocalPlayer().getWorldLocation().equals(lastDeath)) - { - if (!RESPAWN_REGIONS.contains(client.getLocalPlayer().getWorldLocation().getRegionID())) - { - log.debug("Died, but did not respawn in a known respawn location: {}", - client.getLocalPlayer().getWorldLocation().getRegionID()); - - lastDeath = null; - lastDeathTime = null; - return; - } - - log.debug("Died! Grave at {}", lastDeath); - - die(lastDeath, lastDeathTime, lastDeathWorld); - - lastDeath = null; - lastDeathTime = null; - } - - if (!hasDied() || client.getWorld() != config.deathWorld()) - { - return; - } - - // Check if the player is at their death location, or timer has passed - WorldPoint deathPoint = new WorldPoint(config.deathLocationX(), config.deathLocationY(), config.deathLocationPlane()); - if (deathPoint.equals(client.getLocalPlayer().getWorldLocation()) || (deathTimer != null && deathTimer.cull())) - { - reset(); - - resetDeathConfig(); - } - } - - @Subscribe - public void onCommandExecuted(CommandExecuted commandExecuted) - { - if (developerMode && commandExecuted.getCommand().equals("die")) - { - die(client.getLocalPlayer().getWorldLocation(), Instant.now(), client.getWorld()); - } - } - - private void die(WorldPoint location, Instant time, int world) - { - // Save death to config - config.deathLocationX(location.getX()); - config.deathLocationY(location.getY()); - config.deathLocationPlane(location.getPlane()); - config.timeOfDeath(time); - config.deathWorld(world); - - if (config.showDeathHintArrow()) - { - client.setHintArrow(location); - } - - if (config.showDeathOnWorldMap()) - { - worldMapPointManager.removeIf(DeathWorldMapPoint.class::isInstance); - worldMapPointManager.add(new DeathWorldMapPoint(location, this)); - } - - resetInfobox(); - } - - @Subscribe - public void onConfigChanged(ConfigChanged event) - { - if (event.getGroup().equals("deathIndicator")) - { - if (!config.showDeathHintArrow() && hasDied()) - { - client.clearHintArrow(); - } - - if (!config.showDeathInfoBox() && deathTimer != null) - { - infoBoxManager.removeInfoBox(deathTimer); - deathTimer = null; - } - - if (!config.showDeathOnWorldMap()) - { - worldMapPointManager.removeIf(DeathWorldMapPoint.class::isInstance); - } - - if (!hasDied()) - { - client.clearHintArrow(); - - resetInfobox(); - - worldMapPointManager.removeIf(DeathWorldMapPoint.class::isInstance); - } - } - } - - @Subscribe - public void onGameStateChanged(GameStateChanged event) - { - if (!hasDied()) - { - return; - } - - if (event.getGameState() == GameState.LOGGED_IN) - { - if (client.getWorld() == config.deathWorld()) - { - WorldPoint deathPoint = new WorldPoint(config.deathLocationX(), config.deathLocationY(), config.deathLocationPlane()); - - if (config.showDeathHintArrow()) - { - client.setHintArrow(deathPoint); - } - - if (config.showDeathOnWorldMap()) - { - worldMapPointManager.removeIf(DeathWorldMapPoint.class::isInstance); - worldMapPointManager.add(new DeathWorldMapPoint(deathPoint, this)); - } - } - else - { - worldMapPointManager.removeIf(DeathWorldMapPoint.class::isInstance); - } - } - } - - @Subscribe - public void onInfoBoxMenuClicked(InfoBoxMenuClicked infoBoxMenuClicked) - { - if (infoBoxMenuClicked.getInfoBox() == deathTimer) - { - reset(); - } - } - - private boolean hasDied() - { - return config.timeOfDeath() != null; - } - - private void reset() - { - client.clearHintArrow(); - - if (deathTimer != null) - { - infoBoxManager.removeInfoBox(deathTimer); - deathTimer = null; - } - - worldMapPointManager.removeIf(DeathWorldMapPoint.class::isInstance); - } - - private void resetDeathConfig() - { - config.deathLocationX(0); - config.deathLocationY(0); - config.deathLocationPlane(0); - config.deathWorld(0); - config.timeOfDeath(null); - } - - private void resetInfobox() - { - if (deathTimer != null) - { - infoBoxManager.removeInfoBox(deathTimer); - deathTimer = null; - } - - if (hasDied() && config.showDeathInfoBox()) - { - Instant now = Instant.now(); - Duration timeLeft = Duration.ofHours(1).minus(Duration.between(config.timeOfDeath(), now)); - if (!timeLeft.isNegative() && !timeLeft.isZero()) - { - deathTimer = new Timer(timeLeft.getSeconds(), ChronoUnit.SECONDS, getBonesImage(), this); - deathTimer.setTooltip("Died on world: " + config.deathWorld()); - deathTimer.getMenuEntries().add(new OverlayMenuEntry(MenuAction.RUNELITE_INFOBOX, DEATH_TIMER_CLEAR, "Death Timer")); - infoBoxManager.addInfoBox(deathTimer); - } - } - } - - BufferedImage getMapArrow() - { - if (mapArrow != null) - { - return mapArrow; - } - - mapArrow = ImageUtil.getResourceStreamFromClass(getClass(), "/util/clue_arrow.png"); - - return mapArrow; - } - - BufferedImage getBonesImage() - { - return itemManager.getImage(ItemID.BONES); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathWorldMapPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathWorldMapPoint.java deleted file mode 100644 index e6368d87ce..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/deathindicator/DeathWorldMapPoint.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2018, Danny - * 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.deathindicator; - -import java.awt.Graphics; -import java.awt.image.BufferedImage; -import net.runelite.api.Point; -import net.runelite.api.coords.WorldPoint; -import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; - -class DeathWorldMapPoint extends WorldMapPoint -{ - private final DeathIndicatorPlugin plugin; - private final BufferedImage worldmapHintArrow; - private final Point worldmapHintArrowPoint; - - DeathWorldMapPoint(final WorldPoint worldPoint, final DeathIndicatorPlugin plugin) - { - super(worldPoint, null); - - worldmapHintArrow = new BufferedImage(plugin.getMapArrow().getWidth(), plugin.getMapArrow().getHeight(), BufferedImage.TYPE_INT_ARGB); - Graphics graphics = worldmapHintArrow.getGraphics(); - graphics.drawImage(plugin.getMapArrow(), 0, 0, null); - graphics.drawImage(plugin.getBonesImage(), 0, 0, null); - worldmapHintArrowPoint = new Point( - worldmapHintArrow.getWidth() / 2, - worldmapHintArrow.getHeight()); - - this.plugin = plugin; - this.setSnapToEdge(true); - this.setJumpOnClick(true); - this.setImage(worldmapHintArrow); - this.setImagePoint(worldmapHintArrowPoint); - this.setTooltip("Death Location"); - } - - @Override - public void onEdgeSnap() - { - this.setImage(plugin.getBonesImage()); - this.setImagePoint(null); - this.setTooltip(null); - } - - @Override - public void onEdgeUnsnap() - { - this.setImage(worldmapHintArrow); - this.setImagePoint(worldmapHintArrowPoint); - this.setTooltip("Death Location"); - } -} From db917454e873aa11511ab73f6808a6570b636aed Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Tue, 23 Jun 2020 21:49:16 -0700 Subject: [PATCH 35/45] menuentryswapper: Fix birdhouse swap --- .../MenuEntrySwapperPlugin.java | 2 +- .../MenuEntrySwapperPluginTest.java | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index 59d971e57c..6353eebe11 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -252,7 +252,7 @@ public class MenuEntrySwapperPlugin extends Plugin swap("pick-up", "chase", config::swapChase); - swap("interact", "birdhouse", "empty", config::swapBirdhouseEmpty); + swap("interact", target -> target.endsWith("birdhouse"), "empty", config::swapBirdhouseEmpty); swap("enter", "the gauntlet", "enter-corrupted", config::swapGauntlet); diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPluginTest.java index 851e09c6f5..b1f77c708a 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPluginTest.java @@ -366,4 +366,35 @@ public class MenuEntrySwapperPluginTest menu("Deposit-All", "Rune arrow", MenuAction.CC_OP, 8), }, argumentCaptor.getValue()); } + + @Test + public void testBirdhouse() + { + when(config.swapBirdhouseEmpty()).thenReturn(true); + + entries = new MenuEntry[]{ + menu("Cancel", "", MenuAction.CANCEL), + menu("Examine", "Redwood birdhouse", MenuAction.EXAMINE_OBJECT), + menu("Walk here", "", MenuAction.WALK), + + menu("Empty", "Redwood birdhouse", MenuAction.GAME_OBJECT_THIRD_OPTION), + menu("Seeds", "Redwood birdhouse", MenuAction.GAME_OBJECT_SECOND_OPTION), + menu("Interact", "Redwood birdhouse", MenuAction.GAME_OBJECT_FIRST_OPTION), + }; + + menuEntrySwapperPlugin.onClientTick(new ClientTick()); + + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(MenuEntry[].class); + verify(client).setMenuEntries(argumentCaptor.capture()); + + assertArrayEquals(new MenuEntry[]{ + menu("Cancel", "", MenuAction.CANCEL), + menu("Examine", "Redwood birdhouse", MenuAction.EXAMINE_OBJECT), + menu("Walk here", "", MenuAction.WALK), + + menu("Interact", "Redwood birdhouse", MenuAction.GAME_OBJECT_FIRST_OPTION), + menu("Seeds", "Redwood birdhouse", MenuAction.GAME_OBJECT_SECOND_OPTION), + menu("Empty", "Redwood birdhouse", MenuAction.GAME_OBJECT_THIRD_OPTION), + }, argumentCaptor.getValue()); + } } \ No newline at end of file From 8d1f0287587722b3055bf6c196ec836bcdc45296 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Wed, 24 Jun 2020 21:01:34 -0700 Subject: [PATCH 36/45] TextComponent: Draw outline using one axis offset at a time This commit prevents fonts with thin and angled glyphs from having gaps between the characters and their outline by offsetting outline draws in one direction exclusively. --- .../ui/overlay/components/TextComponent.java | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java index 5c7f47bf2a..3b10b3561b 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java @@ -60,15 +60,19 @@ public class TextComponent implements RenderableEntity final String textWithoutCol = Text.removeTags(textSplitOnCol); final String colColor = textSplitOnCol.substring(textSplitOnCol.indexOf("=") + 1, textSplitOnCol.indexOf(">")); - // shadow graphics.setColor(Color.BLACK); - graphics.drawString(textWithoutCol, x + 1, position.y + 1); if (outline) { - graphics.drawString(textWithoutCol, x - 1, position.y - 1); - graphics.drawString(textWithoutCol, x - 1, position.y + 1); - graphics.drawString(textWithoutCol, x + 1, position.y - 1); + graphics.drawString(textWithoutCol, x, position.y + 1); + graphics.drawString(textWithoutCol, x, position.y - 1); + graphics.drawString(textWithoutCol, x + 1, position.y); + graphics.drawString(textWithoutCol, x - 1, position.y); + } + else + { + // shadow + graphics.drawString(textWithoutCol, x + 1, position.y + 1); } // actual text @@ -80,15 +84,19 @@ public class TextComponent implements RenderableEntity } else { - // shadow graphics.setColor(Color.BLACK); - graphics.drawString(text, position.x + 1, position.y + 1); if (outline) { - graphics.drawString(text, position.x - 1, position.y - 1); - graphics.drawString(text, position.x - 1, position.y + 1); - graphics.drawString(text, position.x + 1, position.y - 1); + graphics.drawString(text, position.x, position.y + 1); + graphics.drawString(text, position.x, position.y - 1); + graphics.drawString(text, position.x + 1, position.y); + graphics.drawString(text, position.x - 1, position.y); + } + else + { + // shadow + graphics.drawString(text, position.x + 1, position.y + 1); } // actual text From 003bda8745dad282942401ae2929cd6e6ce92c8a Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 25 Jun 2020 11:14:30 +0000 Subject: [PATCH 37/45] Update Item IDs to 2020-06-25-rev190 --- runelite-api/src/main/java/net/runelite/api/ItemID.java | 8 +++++++- .../src/main/java/net/runelite/api/NullItemID.java | 6 ++++-- 2 files changed, 11 insertions(+), 3 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 c105ce645a..3ed8668b67 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/ItemID.java @@ -11357,7 +11357,7 @@ public final class ItemID public static final int TWISTED_BANNER = 24413; public static final int RUNE_POUCH_L = 24416; public static final int INQUISITORS_MACE = 24417; - public static final int CABBAGE_24418 = 24418; + public static final int GRAVESTONE = 24418; public static final int INQUISITORS_GREAT_HELM = 24419; public static final int INQUISITORS_HAUBERK = 24420; public static final int INQUISITORS_PLATESKIRT = 24421; @@ -11406,6 +11406,8 @@ 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 DEATHS_COFFER = 24523; + public static final int GRAVESTONE_24524 = 24524; public static final int CAT_EARS = 24525; public static final int HELL_CAT_EARS = 24527; public static final int LAMP_OF_THE_GATHERER = 24528; @@ -11570,5 +11572,9 @@ public final class ItemID public static final int VYRE_NOBLE_DRESS_BOTTOM_24840 = 24840; public static final int A_TASTE_OF_HOPE = 24842; public static final int RING_OF_ENDURANCE_UNCHARGED_24844 = 24844; + public static final int RED = 24847; + public static final int ZIGGY = 24849; + public static final int SOFT_CLAY_PACK_24851 = 24851; + public static final int BAG_FULL_OF_GEMS_24853 = 24853; /* 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 9fbdbf4bcc..66cfc9b1df 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullItemID.java @@ -12906,8 +12906,6 @@ public final class NullItemID 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; public static final int NULL_24532 = 24532; @@ -13066,5 +13064,9 @@ public final class NullItemID public static final int NULL_24843 = 24843; public static final int NULL_24845 = 24845; public static final int NULL_24846 = 24846; + public static final int NULL_24848 = 24848; + public static final int NULL_24850 = 24850; + public static final int NULL_24852 = 24852; + public static final int NULL_24854 = 24854; /* This file is automatically generated. Do not edit. */ } From 3bc7e89a0c84fd3f73962a729d69b017209d6478 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 25 Jun 2020 11:14:30 +0000 Subject: [PATCH 38/45] Update Item variations to 2020-06-25-rev190 --- .../src/main/resources/item_variations.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/resources/item_variations.json b/runelite-client/src/main/resources/item_variations.json index ce14698513..ed6b8ac92e 100644 --- a/runelite-client/src/main/resources/item_variations.json +++ b/runelite-client/src/main/resources/item_variations.json @@ -2470,7 +2470,6 @@ 22519, 22520, 24367, - 24418, 24426 ], "empty cup": [ @@ -7904,7 +7903,8 @@ ], "soft clay pack": [ 12009, - 12010 + 12010, + 24851 ], "black wizard robe": [ 12449, @@ -8617,6 +8617,10 @@ 13652, 20784 ], + "bag of gems": [ + 19473, + 24853 + ], "heavy ballista": [ 19481, 23630 @@ -9752,6 +9756,10 @@ 24403, 24411 ], + "gravestone": [ + 24418, + 24524 + ], "iced gingerbread shield": [ 24438, 24439, From 3dfe3917879dcd91740884e834de55ebebdede0f Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 25 Jun 2020 11:14:30 +0000 Subject: [PATCH 39/45] Update Object IDs to 2020-06-25-rev190 --- .../java/net/runelite/api/NullObjectID.java | 54 +++++++++++++++++++ .../main/java/net/runelite/api/ObjectID.java | 23 ++++++++ 2 files changed, 77 insertions(+) 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 211d8cddf5..071ab447bf 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullObjectID.java @@ -19463,5 +19463,59 @@ public final class NullObjectID public static final int NULL_39543 = 39543; public static final int NULL_39544 = 39544; public static final int NULL_39545 = 39545; + public static final int NULL_39551 = 39551; + public static final int NULL_39552 = 39552; + public static final int NULL_39553 = 39553; + public static final int NULL_39554 = 39554; + public static final int NULL_39555 = 39555; + public static final int NULL_39556 = 39556; + public static final int NULL_39557 = 39557; + public static final int NULL_39558 = 39558; + public static final int NULL_39559 = 39559; + public static final int NULL_39560 = 39560; + public static final int NULL_39561 = 39561; + public static final int NULL_39562 = 39562; + public static final int NULL_39563 = 39563; + public static final int NULL_39564 = 39564; + public static final int NULL_39565 = 39565; + public static final int NULL_39566 = 39566; + public static final int NULL_39567 = 39567; + public static final int NULL_39568 = 39568; + public static final int NULL_39569 = 39569; + public static final int NULL_39582 = 39582; + public static final int NULL_39583 = 39583; + public static final int NULL_39584 = 39584; + public static final int NULL_39585 = 39585; + public static final int NULL_39586 = 39586; + public static final int NULL_39587 = 39587; + public static final int NULL_39588 = 39588; + public static final int NULL_39589 = 39589; + public static final int NULL_39590 = 39590; + public static final int NULL_39591 = 39591; + public static final int NULL_39592 = 39592; + public static final int NULL_39593 = 39593; + public static final int NULL_39594 = 39594; + public static final int NULL_39595 = 39595; + public static final int NULL_39596 = 39596; + public static final int NULL_39597 = 39597; + public static final int NULL_39598 = 39598; + public static final int NULL_39599 = 39599; + public static final int NULL_39600 = 39600; + public static final int NULL_39601 = 39601; + public static final int NULL_39602 = 39602; + public static final int NULL_39603 = 39603; + public static final int NULL_39604 = 39604; + public static final int NULL_39605 = 39605; + public static final int NULL_39606 = 39606; + public static final int NULL_39607 = 39607; + public static final int NULL_39610 = 39610; + public static final int NULL_39611 = 39611; + public static final int NULL_39612 = 39612; + public static final int NULL_39613 = 39613; + public static final int NULL_39614 = 39614; + public static final int NULL_39615 = 39615; + public static final int NULL_39616 = 39616; + public static final int NULL_39618 = 39618; + public static final int NULL_39619 = 39619; /* 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 54b91af481..d050738b5f 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/ObjectID.java @@ -19728,6 +19728,7 @@ public final class ObjectID public static final int WIZARD_STATUE_38423 = 38423; public static final int WIZARD_STATUE_38424 = 38424; public static final int WIZARD_STATUE_38425 = 38425; + public static final int DEATHS_DOMAIN = 38426; public static final int FIRE_38427 = 38427; public static final int KNIGHT_STATUE = 38428; public static final int KNIGHT_STATUE_38429 = 38429; @@ -20067,5 +20068,27 @@ public final class ObjectID public static final int GATE_39512 = 39512; public static final int GATE_39513 = 39513; public static final int CHAIR_39514 = 39514; + public static final int DEATHS_DOMAIN_39535 = 39535; + public static final int DEATHS_DOMAIN_39546 = 39546; + public static final int DEATHS_DOMAIN_39547 = 39547; + public static final int DEATHS_DOMAIN_39548 = 39548; + public static final int PORTAL_39549 = 39549; + public static final int DEATHS_COFFER = 39550; + public static final int DESK_39570 = 39570; + public static final int MUNCHER = 39571; + public static final int CHAIR_39572 = 39572; + public static final int CHAIR_39573 = 39573; + public static final int DEATHS_SCYTHE = 39574; + public static final int CHEST_39575 = 39575; + public static final int CHEST_39576 = 39576; + public static final int CHEST_39577 = 39577; + public static final int CHEST_39578 = 39578; + public static final int WEAPONS = 39579; + public static final int BOOKS_39580 = 39580; + public static final int BOOKS_39581 = 39581; + public static final int COFFIN_39608 = 39608; + public static final int STAIRS_39609 = 39609; + public static final int CRYPT = 39617; + public static final int COFFIN_39620 = 39620; /* This file is automatically generated. Do not edit. */ } From e180f44add8d9d52238b49f89915011f59ed3368 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 25 Jun 2020 11:14:30 +0000 Subject: [PATCH 40/45] Update Script arguments to 2020-06-25-rev190 --- runelite-api/src/main/java/net/runelite/api/ScriptID.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-api/src/main/java/net/runelite/api/ScriptID.java b/runelite-api/src/main/java/net/runelite/api/ScriptID.java index 35b159a198..58d7b9f0d0 100644 --- a/runelite-api/src/main/java/net/runelite/api/ScriptID.java +++ b/runelite-api/src/main/java/net/runelite/api/ScriptID.java @@ -284,7 +284,7 @@ public final class ScriptID /** * Called to build the combat interface */ - @ScriptArguments + @ScriptArguments() public static final int COMBAT_INTERFACE_SETUP = 420; /** From c85bbf8080d5e2000056c42939c8f6e0bdd4bc64 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 25 Jun 2020 11:14:31 +0000 Subject: [PATCH 41/45] Update NPC IDs to 2020-06-25-rev190 --- .../src/main/java/net/runelite/api/NpcID.java | 8 + .../main/java/net/runelite/api/NullNpcID.java | 511 ++++++++++++++++++ 2 files changed, 519 insertions(+) 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 4bf81dfd41..642de57dfb 100644 --- a/runelite-api/src/main/java/net/runelite/api/NpcID.java +++ b/runelite-api/src/main/java/net/runelite/api/NpcID.java @@ -8750,5 +8750,13 @@ public final class NpcID public static final int CHILD_9799 = 9799; public static final int SLEEPWALKER_9801 = 9801; public static final int SLEEPWALKER_9802 = 9802; + public static final int RED = 9850; + public static final int ZIGGY = 9851; + public static final int RED_9852 = 9852; + public static final int ZIGGY_9853 = 9853; + public static final int DEATH_9855 = 9855; + public static final int GRAVE = 9856; + public static final int GRAVE_9857 = 9857; + public static final int SQUIRE_10368 = 10368; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/NullNpcID.java b/runelite-api/src/main/java/net/runelite/api/NullNpcID.java index 49016c1c50..99e56e7411 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullNpcID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullNpcID.java @@ -1081,5 +1081,516 @@ public final class NullNpcID public static final int NULL_9847 = 9847; public static final int NULL_9848 = 9848; public static final int NULL_9849 = 9849; + public static final int NULL_9854 = 9854; + public static final int NULL_9858 = 9858; + public static final int NULL_9859 = 9859; + public static final int NULL_9860 = 9860; + public static final int NULL_9861 = 9861; + public static final int NULL_9862 = 9862; + public static final int NULL_9863 = 9863; + public static final int NULL_9864 = 9864; + public static final int NULL_9865 = 9865; + public static final int NULL_9866 = 9866; + public static final int NULL_9867 = 9867; + public static final int NULL_9868 = 9868; + public static final int NULL_9869 = 9869; + public static final int NULL_9870 = 9870; + public static final int NULL_9871 = 9871; + public static final int NULL_9872 = 9872; + public static final int NULL_9873 = 9873; + public static final int NULL_9874 = 9874; + public static final int NULL_9875 = 9875; + public static final int NULL_9876 = 9876; + public static final int NULL_9877 = 9877; + public static final int NULL_9878 = 9878; + public static final int NULL_9879 = 9879; + public static final int NULL_9880 = 9880; + public static final int NULL_9881 = 9881; + public static final int NULL_9882 = 9882; + public static final int NULL_9883 = 9883; + public static final int NULL_9884 = 9884; + public static final int NULL_9885 = 9885; + public static final int NULL_9886 = 9886; + public static final int NULL_9887 = 9887; + public static final int NULL_9888 = 9888; + public static final int NULL_9889 = 9889; + public static final int NULL_9890 = 9890; + public static final int NULL_9891 = 9891; + public static final int NULL_9892 = 9892; + public static final int NULL_9893 = 9893; + public static final int NULL_9894 = 9894; + public static final int NULL_9895 = 9895; + public static final int NULL_9896 = 9896; + public static final int NULL_9897 = 9897; + public static final int NULL_9898 = 9898; + public static final int NULL_9899 = 9899; + public static final int NULL_9900 = 9900; + public static final int NULL_9901 = 9901; + public static final int NULL_9902 = 9902; + public static final int NULL_9903 = 9903; + public static final int NULL_9904 = 9904; + public static final int NULL_9905 = 9905; + public static final int NULL_9906 = 9906; + public static final int NULL_9907 = 9907; + public static final int NULL_9908 = 9908; + public static final int NULL_9909 = 9909; + public static final int NULL_9910 = 9910; + public static final int NULL_9911 = 9911; + public static final int NULL_9912 = 9912; + public static final int NULL_9913 = 9913; + public static final int NULL_9914 = 9914; + public static final int NULL_9915 = 9915; + public static final int NULL_9916 = 9916; + public static final int NULL_9917 = 9917; + public static final int NULL_9918 = 9918; + public static final int NULL_9919 = 9919; + public static final int NULL_9920 = 9920; + public static final int NULL_9921 = 9921; + public static final int NULL_9922 = 9922; + public static final int NULL_9923 = 9923; + public static final int NULL_9924 = 9924; + public static final int NULL_9925 = 9925; + public static final int NULL_9926 = 9926; + public static final int NULL_9927 = 9927; + public static final int NULL_9928 = 9928; + public static final int NULL_9929 = 9929; + public static final int NULL_9930 = 9930; + public static final int NULL_9931 = 9931; + public static final int NULL_9932 = 9932; + public static final int NULL_9933 = 9933; + public static final int NULL_9934 = 9934; + public static final int NULL_9935 = 9935; + public static final int NULL_9936 = 9936; + public static final int NULL_9937 = 9937; + public static final int NULL_9938 = 9938; + public static final int NULL_9939 = 9939; + public static final int NULL_9940 = 9940; + public static final int NULL_9941 = 9941; + public static final int NULL_9942 = 9942; + public static final int NULL_9943 = 9943; + public static final int NULL_9944 = 9944; + public static final int NULL_9945 = 9945; + public static final int NULL_9946 = 9946; + public static final int NULL_9947 = 9947; + public static final int NULL_9948 = 9948; + public static final int NULL_9949 = 9949; + public static final int NULL_9950 = 9950; + public static final int NULL_9951 = 9951; + public static final int NULL_9952 = 9952; + public static final int NULL_9953 = 9953; + public static final int NULL_9954 = 9954; + public static final int NULL_9955 = 9955; + public static final int NULL_9956 = 9956; + public static final int NULL_9957 = 9957; + public static final int NULL_9958 = 9958; + public static final int NULL_9959 = 9959; + public static final int NULL_9960 = 9960; + public static final int NULL_9961 = 9961; + public static final int NULL_9962 = 9962; + public static final int NULL_9963 = 9963; + public static final int NULL_9964 = 9964; + public static final int NULL_9965 = 9965; + public static final int NULL_9966 = 9966; + public static final int NULL_9967 = 9967; + public static final int NULL_9968 = 9968; + public static final int NULL_9969 = 9969; + public static final int NULL_9970 = 9970; + public static final int NULL_9971 = 9971; + public static final int NULL_9972 = 9972; + public static final int NULL_9973 = 9973; + public static final int NULL_9974 = 9974; + public static final int NULL_9975 = 9975; + public static final int NULL_9976 = 9976; + public static final int NULL_9977 = 9977; + public static final int NULL_9978 = 9978; + public static final int NULL_9979 = 9979; + public static final int NULL_9980 = 9980; + public static final int NULL_9981 = 9981; + public static final int NULL_9982 = 9982; + public static final int NULL_9983 = 9983; + public static final int NULL_9984 = 9984; + public static final int NULL_9985 = 9985; + public static final int NULL_9986 = 9986; + public static final int NULL_9987 = 9987; + public static final int NULL_9988 = 9988; + public static final int NULL_9989 = 9989; + public static final int NULL_9990 = 9990; + public static final int NULL_9991 = 9991; + public static final int NULL_9992 = 9992; + public static final int NULL_9993 = 9993; + public static final int NULL_9994 = 9994; + public static final int NULL_9995 = 9995; + public static final int NULL_9996 = 9996; + public static final int NULL_9997 = 9997; + public static final int NULL_9998 = 9998; + public static final int NULL_9999 = 9999; + public static final int NULL_10000 = 10000; + public static final int NULL_10001 = 10001; + public static final int NULL_10002 = 10002; + public static final int NULL_10003 = 10003; + public static final int NULL_10004 = 10004; + public static final int NULL_10005 = 10005; + public static final int NULL_10006 = 10006; + public static final int NULL_10007 = 10007; + public static final int NULL_10008 = 10008; + public static final int NULL_10009 = 10009; + public static final int NULL_10010 = 10010; + public static final int NULL_10011 = 10011; + public static final int NULL_10012 = 10012; + public static final int NULL_10013 = 10013; + public static final int NULL_10014 = 10014; + public static final int NULL_10015 = 10015; + public static final int NULL_10016 = 10016; + public static final int NULL_10017 = 10017; + public static final int NULL_10018 = 10018; + public static final int NULL_10019 = 10019; + public static final int NULL_10020 = 10020; + public static final int NULL_10021 = 10021; + public static final int NULL_10022 = 10022; + public static final int NULL_10023 = 10023; + public static final int NULL_10024 = 10024; + public static final int NULL_10025 = 10025; + public static final int NULL_10026 = 10026; + public static final int NULL_10027 = 10027; + public static final int NULL_10028 = 10028; + public static final int NULL_10029 = 10029; + public static final int NULL_10030 = 10030; + public static final int NULL_10031 = 10031; + public static final int NULL_10032 = 10032; + public static final int NULL_10033 = 10033; + public static final int NULL_10034 = 10034; + public static final int NULL_10035 = 10035; + public static final int NULL_10036 = 10036; + public static final int NULL_10037 = 10037; + public static final int NULL_10038 = 10038; + public static final int NULL_10039 = 10039; + public static final int NULL_10040 = 10040; + public static final int NULL_10041 = 10041; + public static final int NULL_10042 = 10042; + public static final int NULL_10043 = 10043; + public static final int NULL_10044 = 10044; + public static final int NULL_10045 = 10045; + public static final int NULL_10046 = 10046; + public static final int NULL_10047 = 10047; + public static final int NULL_10048 = 10048; + public static final int NULL_10049 = 10049; + public static final int NULL_10050 = 10050; + public static final int NULL_10051 = 10051; + public static final int NULL_10052 = 10052; + public static final int NULL_10053 = 10053; + public static final int NULL_10054 = 10054; + public static final int NULL_10055 = 10055; + public static final int NULL_10056 = 10056; + public static final int NULL_10057 = 10057; + public static final int NULL_10058 = 10058; + public static final int NULL_10059 = 10059; + public static final int NULL_10060 = 10060; + public static final int NULL_10061 = 10061; + public static final int NULL_10062 = 10062; + public static final int NULL_10063 = 10063; + public static final int NULL_10064 = 10064; + public static final int NULL_10065 = 10065; + public static final int NULL_10066 = 10066; + public static final int NULL_10067 = 10067; + public static final int NULL_10068 = 10068; + public static final int NULL_10069 = 10069; + public static final int NULL_10070 = 10070; + public static final int NULL_10071 = 10071; + public static final int NULL_10072 = 10072; + public static final int NULL_10073 = 10073; + public static final int NULL_10074 = 10074; + public static final int NULL_10075 = 10075; + public static final int NULL_10076 = 10076; + public static final int NULL_10077 = 10077; + public static final int NULL_10078 = 10078; + public static final int NULL_10079 = 10079; + public static final int NULL_10080 = 10080; + public static final int NULL_10081 = 10081; + public static final int NULL_10082 = 10082; + public static final int NULL_10083 = 10083; + public static final int NULL_10084 = 10084; + public static final int NULL_10085 = 10085; + public static final int NULL_10086 = 10086; + public static final int NULL_10087 = 10087; + public static final int NULL_10088 = 10088; + public static final int NULL_10089 = 10089; + public static final int NULL_10090 = 10090; + public static final int NULL_10091 = 10091; + public static final int NULL_10092 = 10092; + public static final int NULL_10093 = 10093; + public static final int NULL_10094 = 10094; + public static final int NULL_10095 = 10095; + public static final int NULL_10096 = 10096; + public static final int NULL_10097 = 10097; + public static final int NULL_10098 = 10098; + public static final int NULL_10099 = 10099; + public static final int NULL_10100 = 10100; + public static final int NULL_10101 = 10101; + public static final int NULL_10102 = 10102; + public static final int NULL_10103 = 10103; + public static final int NULL_10104 = 10104; + public static final int NULL_10105 = 10105; + public static final int NULL_10106 = 10106; + public static final int NULL_10107 = 10107; + public static final int NULL_10108 = 10108; + public static final int NULL_10109 = 10109; + public static final int NULL_10110 = 10110; + public static final int NULL_10111 = 10111; + public static final int NULL_10112 = 10112; + public static final int NULL_10113 = 10113; + public static final int NULL_10114 = 10114; + public static final int NULL_10115 = 10115; + public static final int NULL_10116 = 10116; + public static final int NULL_10117 = 10117; + public static final int NULL_10118 = 10118; + public static final int NULL_10119 = 10119; + public static final int NULL_10120 = 10120; + public static final int NULL_10121 = 10121; + public static final int NULL_10122 = 10122; + public static final int NULL_10123 = 10123; + public static final int NULL_10124 = 10124; + public static final int NULL_10125 = 10125; + public static final int NULL_10126 = 10126; + public static final int NULL_10127 = 10127; + public static final int NULL_10128 = 10128; + public static final int NULL_10129 = 10129; + public static final int NULL_10130 = 10130; + public static final int NULL_10131 = 10131; + public static final int NULL_10132 = 10132; + public static final int NULL_10133 = 10133; + public static final int NULL_10134 = 10134; + public static final int NULL_10135 = 10135; + public static final int NULL_10136 = 10136; + public static final int NULL_10137 = 10137; + public static final int NULL_10138 = 10138; + public static final int NULL_10139 = 10139; + public static final int NULL_10140 = 10140; + public static final int NULL_10141 = 10141; + public static final int NULL_10142 = 10142; + public static final int NULL_10143 = 10143; + public static final int NULL_10144 = 10144; + public static final int NULL_10145 = 10145; + public static final int NULL_10146 = 10146; + public static final int NULL_10147 = 10147; + public static final int NULL_10148 = 10148; + public static final int NULL_10149 = 10149; + public static final int NULL_10150 = 10150; + public static final int NULL_10151 = 10151; + public static final int NULL_10152 = 10152; + public static final int NULL_10153 = 10153; + public static final int NULL_10154 = 10154; + public static final int NULL_10155 = 10155; + public static final int NULL_10156 = 10156; + public static final int NULL_10157 = 10157; + public static final int NULL_10158 = 10158; + public static final int NULL_10159 = 10159; + public static final int NULL_10160 = 10160; + public static final int NULL_10161 = 10161; + public static final int NULL_10162 = 10162; + public static final int NULL_10163 = 10163; + public static final int NULL_10164 = 10164; + public static final int NULL_10165 = 10165; + public static final int NULL_10166 = 10166; + public static final int NULL_10167 = 10167; + public static final int NULL_10168 = 10168; + public static final int NULL_10169 = 10169; + public static final int NULL_10170 = 10170; + public static final int NULL_10171 = 10171; + public static final int NULL_10172 = 10172; + public static final int NULL_10173 = 10173; + public static final int NULL_10174 = 10174; + public static final int NULL_10175 = 10175; + public static final int NULL_10176 = 10176; + public static final int NULL_10177 = 10177; + public static final int NULL_10178 = 10178; + public static final int NULL_10179 = 10179; + public static final int NULL_10180 = 10180; + public static final int NULL_10181 = 10181; + public static final int NULL_10182 = 10182; + public static final int NULL_10183 = 10183; + public static final int NULL_10184 = 10184; + public static final int NULL_10185 = 10185; + public static final int NULL_10186 = 10186; + public static final int NULL_10187 = 10187; + public static final int NULL_10188 = 10188; + public static final int NULL_10189 = 10189; + public static final int NULL_10190 = 10190; + public static final int NULL_10191 = 10191; + public static final int NULL_10192 = 10192; + public static final int NULL_10193 = 10193; + public static final int NULL_10194 = 10194; + public static final int NULL_10195 = 10195; + public static final int NULL_10196 = 10196; + public static final int NULL_10197 = 10197; + public static final int NULL_10198 = 10198; + public static final int NULL_10199 = 10199; + public static final int NULL_10200 = 10200; + public static final int NULL_10201 = 10201; + public static final int NULL_10202 = 10202; + public static final int NULL_10203 = 10203; + public static final int NULL_10204 = 10204; + public static final int NULL_10205 = 10205; + public static final int NULL_10206 = 10206; + public static final int NULL_10207 = 10207; + public static final int NULL_10208 = 10208; + public static final int NULL_10209 = 10209; + public static final int NULL_10210 = 10210; + public static final int NULL_10211 = 10211; + public static final int NULL_10212 = 10212; + public static final int NULL_10213 = 10213; + public static final int NULL_10214 = 10214; + public static final int NULL_10215 = 10215; + public static final int NULL_10216 = 10216; + public static final int NULL_10217 = 10217; + public static final int NULL_10218 = 10218; + public static final int NULL_10219 = 10219; + public static final int NULL_10220 = 10220; + public static final int NULL_10221 = 10221; + public static final int NULL_10222 = 10222; + public static final int NULL_10223 = 10223; + public static final int NULL_10224 = 10224; + public static final int NULL_10225 = 10225; + public static final int NULL_10226 = 10226; + public static final int NULL_10227 = 10227; + public static final int NULL_10228 = 10228; + public static final int NULL_10229 = 10229; + public static final int NULL_10230 = 10230; + public static final int NULL_10231 = 10231; + public static final int NULL_10232 = 10232; + public static final int NULL_10233 = 10233; + public static final int NULL_10234 = 10234; + public static final int NULL_10235 = 10235; + public static final int NULL_10236 = 10236; + public static final int NULL_10237 = 10237; + public static final int NULL_10238 = 10238; + public static final int NULL_10239 = 10239; + public static final int NULL_10240 = 10240; + public static final int NULL_10241 = 10241; + public static final int NULL_10242 = 10242; + public static final int NULL_10243 = 10243; + public static final int NULL_10244 = 10244; + public static final int NULL_10245 = 10245; + public static final int NULL_10246 = 10246; + public static final int NULL_10247 = 10247; + public static final int NULL_10248 = 10248; + public static final int NULL_10249 = 10249; + public static final int NULL_10250 = 10250; + public static final int NULL_10251 = 10251; + public static final int NULL_10252 = 10252; + public static final int NULL_10253 = 10253; + public static final int NULL_10254 = 10254; + public static final int NULL_10255 = 10255; + public static final int NULL_10256 = 10256; + public static final int NULL_10257 = 10257; + public static final int NULL_10258 = 10258; + public static final int NULL_10259 = 10259; + public static final int NULL_10260 = 10260; + public static final int NULL_10261 = 10261; + public static final int NULL_10262 = 10262; + public static final int NULL_10263 = 10263; + public static final int NULL_10264 = 10264; + public static final int NULL_10265 = 10265; + public static final int NULL_10266 = 10266; + public static final int NULL_10267 = 10267; + public static final int NULL_10268 = 10268; + public static final int NULL_10269 = 10269; + public static final int NULL_10270 = 10270; + public static final int NULL_10271 = 10271; + public static final int NULL_10272 = 10272; + public static final int NULL_10273 = 10273; + public static final int NULL_10274 = 10274; + public static final int NULL_10275 = 10275; + public static final int NULL_10276 = 10276; + public static final int NULL_10277 = 10277; + public static final int NULL_10278 = 10278; + public static final int NULL_10279 = 10279; + public static final int NULL_10280 = 10280; + public static final int NULL_10281 = 10281; + public static final int NULL_10282 = 10282; + public static final int NULL_10283 = 10283; + public static final int NULL_10284 = 10284; + public static final int NULL_10285 = 10285; + public static final int NULL_10286 = 10286; + public static final int NULL_10287 = 10287; + public static final int NULL_10288 = 10288; + public static final int NULL_10289 = 10289; + public static final int NULL_10290 = 10290; + public static final int NULL_10291 = 10291; + public static final int NULL_10292 = 10292; + public static final int NULL_10293 = 10293; + public static final int NULL_10294 = 10294; + public static final int NULL_10295 = 10295; + public static final int NULL_10296 = 10296; + public static final int NULL_10297 = 10297; + public static final int NULL_10298 = 10298; + public static final int NULL_10299 = 10299; + public static final int NULL_10300 = 10300; + public static final int NULL_10301 = 10301; + public static final int NULL_10302 = 10302; + public static final int NULL_10303 = 10303; + public static final int NULL_10304 = 10304; + public static final int NULL_10305 = 10305; + public static final int NULL_10306 = 10306; + public static final int NULL_10307 = 10307; + public static final int NULL_10308 = 10308; + public static final int NULL_10309 = 10309; + public static final int NULL_10310 = 10310; + public static final int NULL_10311 = 10311; + public static final int NULL_10312 = 10312; + public static final int NULL_10313 = 10313; + public static final int NULL_10314 = 10314; + public static final int NULL_10315 = 10315; + public static final int NULL_10316 = 10316; + public static final int NULL_10317 = 10317; + public static final int NULL_10318 = 10318; + public static final int NULL_10319 = 10319; + public static final int NULL_10320 = 10320; + public static final int NULL_10321 = 10321; + public static final int NULL_10322 = 10322; + public static final int NULL_10323 = 10323; + public static final int NULL_10324 = 10324; + public static final int NULL_10325 = 10325; + public static final int NULL_10326 = 10326; + public static final int NULL_10327 = 10327; + public static final int NULL_10328 = 10328; + public static final int NULL_10329 = 10329; + public static final int NULL_10330 = 10330; + public static final int NULL_10331 = 10331; + public static final int NULL_10332 = 10332; + public static final int NULL_10333 = 10333; + public static final int NULL_10334 = 10334; + public static final int NULL_10335 = 10335; + public static final int NULL_10336 = 10336; + public static final int NULL_10337 = 10337; + public static final int NULL_10338 = 10338; + public static final int NULL_10339 = 10339; + public static final int NULL_10340 = 10340; + public static final int NULL_10341 = 10341; + public static final int NULL_10342 = 10342; + public static final int NULL_10343 = 10343; + public static final int NULL_10344 = 10344; + public static final int NULL_10345 = 10345; + public static final int NULL_10346 = 10346; + public static final int NULL_10347 = 10347; + public static final int NULL_10348 = 10348; + public static final int NULL_10349 = 10349; + public static final int NULL_10350 = 10350; + public static final int NULL_10351 = 10351; + public static final int NULL_10352 = 10352; + public static final int NULL_10353 = 10353; + public static final int NULL_10354 = 10354; + public static final int NULL_10355 = 10355; + public static final int NULL_10356 = 10356; + public static final int NULL_10357 = 10357; + public static final int NULL_10358 = 10358; + public static final int NULL_10359 = 10359; + public static final int NULL_10360 = 10360; + public static final int NULL_10361 = 10361; + public static final int NULL_10362 = 10362; + public static final int NULL_10363 = 10363; + public static final int NULL_10364 = 10364; + public static final int NULL_10365 = 10365; + public static final int NULL_10366 = 10366; + public static final int NULL_10367 = 10367; /* This file is automatically generated. Do not edit. */ } From 51b609095e4820d6660b61ad62163b8437e03ae8 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 25 Jun 2020 11:14:35 +0000 Subject: [PATCH 42/45] Update Widget IDs to 2020-06-25-rev190 Lost widget 4.17 Lost widget 4.23 Lost widget 4.29 Lost widget 4.30 Lost widget 4.31 --- .../net/runelite/api/widgets/WidgetID.java | 177 ++++++++---------- .../net/runelite/api/widgets/WidgetInfo.java | 9 - 2 files changed, 82 insertions(+), 104 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 3dc8a98bf6..54723f2bd1 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 @@ -144,7 +144,6 @@ public class WidgetID public static final int BEGINNER_CLUE_MAP_NORTH_OF_FALADOR = 351; public static final int BEGINNER_CLUE_MAP_WIZARDS_TOWER = 356; public static final int SEED_BOX_GROUP_ID = 128; - public static final int ITEMS_KEPT_ON_DEATH_GROUP_ID = 4; public static final int SEED_VAULT_GROUP_ID = 631; public static final int EXPLORERS_RING_ALCH_GROUP_ID = 483; public static final int OPTIONS_GROUP_ID = 261; @@ -350,10 +349,10 @@ public class WidgetID { static final int MINIMAP_RESIZABLE_WIDGET = 19; static final int MINIMAP_RESIZABLE_CLICKBOX = 20; - static final int MINIMAP_RESIZABLE_DRAW_AREA = 27; - static final int MINIMAP_RESIZABLE_DECORATIONS = 29; - static final int MINIMAP_RESIZABLE_ORB_HOLDER = 30; - static final int MINIMAP_RESIZABLE_LOGOUT_BUTTON = 32; + static final int MINIMAP_RESIZABLE_DRAW_AREA = 28; + static final int MINIMAP_RESIZABLE_DECORATIONS = 30; + static final int MINIMAP_RESIZABLE_ORB_HOLDER = 31; + static final int MINIMAP_RESIZABLE_LOGOUT_BUTTON = 33; static final int FIXED_VIEWPORT = 17; static final int RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX = 14; static final int RESIZABLE_VIEWPORT_BOTTOM_LINE = 14; @@ -363,105 +362,105 @@ public class WidgetID { static final int MINIMAP = 3; static final int MINIMAP_DRAW_AREA = 8; - static final int FRIENDS_CHAT_TAB = 33; - static final int FRIENDS_TAB = 35; - static final int IGNORES_TAB = 34; - static final int LOGOUT_TAB = 36; - static final int OPTIONS_TAB = 37; - static final int EMOTES_TAB = 38; - static final int MUSIC_TAB = 39; - static final int FRIENDS_CHAT_ICON = 40; - static final int FRIENDS_ICON = 42; - static final int IGNORES_ICON = 41; - static final int LOGOUT_ICON = 43; - static final int OPTIONS_ICON = 44; - static final int EMOTES_ICON = 45; - static final int MUSIC_ICON = 46; - static final int COMBAT_TAB = 50; - static final int STATS_TAB = 51; - static final int QUESTS_TAB = 52; - static final int INVENTORY_TAB = 53; - static final int EQUIPMENT_TAB = 54; - static final int PRAYER_TAB = 55; - static final int MAGIC_TAB = 56; - static final int COMBAT_ICON = 57; - static final int STATS_ICON = 58; - static final int QUESTS_ICON = 59; - static final int INVENTORY_ICON = 60; - static final int EQUIPMENT_ICON = 61; - static final int PRAYER_ICON = 62; - static final int MAGIC_ICON = 63; - static final int ROOT_INTERFACE_CONTAINER = 64; - static final int BANK_CONTAINER = 66; - static final int INTERFACE_CONTAINER = 67; - static final int INVENTORY_CONTAINER = 71; + static final int FRIENDS_CHAT_TAB = 34; + static final int FRIENDS_TAB = 36; + static final int IGNORES_TAB = 35; + static final int LOGOUT_TAB = 37; + static final int OPTIONS_TAB = 38; + static final int EMOTES_TAB = 39; + static final int MUSIC_TAB = 40; + static final int FRIENDS_CHAT_ICON = 41; + static final int FRIENDS_ICON = 43; + static final int IGNORES_ICON = 42; + static final int LOGOUT_ICON = 44; + static final int OPTIONS_ICON = 45; + static final int EMOTES_ICON = 46; + static final int MUSIC_ICON = 47; + static final int COMBAT_TAB = 51; + static final int STATS_TAB = 52; + static final int QUESTS_TAB = 53; + static final int INVENTORY_TAB = 54; + static final int EQUIPMENT_TAB = 55; + static final int PRAYER_TAB = 56; + static final int MAGIC_TAB = 57; + static final int COMBAT_ICON = 58; + static final int STATS_ICON = 59; + static final int QUESTS_ICON = 60; + static final int INVENTORY_ICON = 61; + static final int EQUIPMENT_ICON = 62; + static final int PRAYER_ICON = 63; + static final int MAGIC_ICON = 64; + static final int ROOT_INTERFACE_CONTAINER = 65; + static final int BANK_CONTAINER = 67; + static final int INTERFACE_CONTAINER = 68; + static final int INVENTORY_CONTAINER = 72; } static class ResizableViewport { - static final int FRIENDS_CHAT_TAB = 37; - static final int FRIENDS_TAB = 39; - static final int IGNORES_TAB = 38; - static final int LOGOUT_TAB = 40; - static final int OPTIONS_TAB = 41; - static final int EMOTES_TAB = 42; - static final int MUSIC_TAB = 43; - static final int FRIENDS_CHAT_ICON = 44; - static final int FRIENDS_ICON = 46; - static final int IGNORES_ICON = 45; - static final int LOGOUT_ICON = 47; - static final int OPTIONS_ICON = 48; - static final int EMOTES_ICON = 49; - static final int MUSIC_ICON = 50; - static final int COMBAT_TAB = 53; - static final int STATS_TAB = 54; - static final int QUESTS_TAB = 55; - static final int INVENTORY_TAB = 56; - static final int EQUIPMENT_TAB = 57; - static final int PRAYER_TAB = 58; - static final int MAGIC_TAB = 59; - static final int COMBAT_ICON = 60; - static final int STATS_ICON = 61; - static final int QUESTS_ICON = 62; - static final int INVENTORY_ICON = 63; - static final int EQUIPMENT_ICON = 64; - static final int PRAYER_ICON = 65; - static final int MAGIC_ICON = 66; - static final int INTERFACE_CONTAINER = 67; - static final int INVENTORY_CONTAINER = 73; + static final int FRIENDS_CHAT_TAB = 38; + static final int FRIENDS_TAB = 40; + static final int IGNORES_TAB = 39; + static final int LOGOUT_TAB = 41; + static final int OPTIONS_TAB = 42; + static final int EMOTES_TAB = 43; + static final int MUSIC_TAB = 44; + static final int FRIENDS_CHAT_ICON = 45; + static final int FRIENDS_ICON = 47; + static final int IGNORES_ICON = 46; + static final int LOGOUT_ICON = 48; + static final int OPTIONS_ICON = 49; + static final int EMOTES_ICON = 50; + static final int MUSIC_ICON = 51; + static final int COMBAT_TAB = 54; + static final int STATS_TAB = 55; + static final int QUESTS_TAB = 56; + static final int INVENTORY_TAB = 57; + static final int EQUIPMENT_TAB = 58; + static final int PRAYER_TAB = 59; + static final int MAGIC_TAB = 60; + static final int COMBAT_ICON = 61; + static final int STATS_ICON = 62; + static final int QUESTS_ICON = 63; + static final int INVENTORY_ICON = 64; + static final int EQUIPMENT_ICON = 65; + static final int PRAYER_ICON = 66; + static final int MAGIC_ICON = 67; + static final int INTERFACE_CONTAINER = 68; + static final int INVENTORY_CONTAINER = 74; } static class ResizableViewportBottomLine { - static final int LOGOUT_BUTTON_OVERLAY = 31; + static final int LOGOUT_BUTTON_OVERLAY = 32; static final int CMB_TAB = 50; - static final int CMB_ICON = 59; + static final int CMB_ICON = 60; static final int SKILLS_TAB = 51; - static final int SKILLS_ICON = 60; + static final int SKILLS_ICON = 61; static final int QUESTS_TAB = 52; - static final int QUESTS_ICON = 61; - static final int INVENTORY_TAB = 55; - static final int INVENTORY_ICON = 62; + static final int QUESTS_ICON = 62; + static final int INVENTORY_TAB = 56; + static final int INVENTORY_ICON = 63; static final int EQUIP_TAB = 54; - static final int EQUIP_ICON = 63; - static final int PRAYER_TAB = 57; - static final int PRAYER_ICON = 64; + static final int EQUIP_ICON = 64; + static final int PRAYER_TAB = 58; + static final int PRAYER_ICON = 65; static final int SPELL_TAB = 56; static final int SPELL_ICON = 53; static final int FC_TAB = 35; - static final int FC_ICON = 43; + static final int FC_ICON = 44; static final int IGNORE_TAB = 36; static final int IGNORE_ICON = 42; static final int FRIEND_TAB = 37; - static final int FRIEND_ICON = 45; + static final int FRIEND_ICON = 46; static final int SETTINGS_TAB = 38; - static final int SETTINGS_ICON = 46; + static final int SETTINGS_ICON = 47; static final int EMOTE_TAB = 39; - static final int EMOTE_ICON = 47; + static final int EMOTE_ICON = 48; static final int MUSIC_TAB = 40; - static final int MUSIC_ICON = 48; - static final int MAGIC_ICON = 65; - static final int INVENTORY_CONTAINER = 73; + static final int MUSIC_ICON = 49; + static final int MAGIC_ICON = 66; + static final int INVENTORY_CONTAINER = 74; } static class Chatbox @@ -859,18 +858,6 @@ public class WidgetID static final int ANSWER3 = 17; } - static class KeptOnDeath - { - static final int KEPT_ITEMS_TEXT = 17; - static final int KEPT_ITEMS_CONTAINER = 18; - static final int LOST_ITEMS_TEXT = 20; - static final int LOST_ITEMS_CONTAINER = 21; - static final int LOST_ITEMS_VALUE = 23; - static final int INFORMATION_CONTAINER = 29; - static final int MAX_ITEMS_KEPT_ON_DEATH = 30; - static final int SAFE_ZONE_CONTAINER = 31; - } - static class SeedVault { static final int INVENTORY_ITEM_CONTAINER = 1; diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index e8b389b897..580e3b9f18 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -527,15 +527,6 @@ public enum WidgetInfo QUESTLIST_MEMBERS_CONTAINER(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.MEMBERS_CONTAINER), QUESTLIST_MINIQUEST_CONTAINER(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.MINIQUEST_CONTAINER), - ITEMS_KEPT_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_TEXT), - ITEMS_KEPT_ON_DEATH_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_CONTAINER), - ITEMS_LOST_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_TEXT), - ITEMS_LOST_ON_DEATH_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_CONTAINER), - ITEMS_KEPT_INFORMATION_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.INFORMATION_CONTAINER), - ITEMS_KEPT_SAFE_ZONE_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.SAFE_ZONE_CONTAINER), - ITEMS_LOST_VALUE(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_VALUE), - ITEMS_KEPT_MAX(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.MAX_ITEMS_KEPT_ON_DEATH), - SEED_VAULT_TITLE_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.TITLE_CONTAINER), SEED_VAULT_ITEM_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_CONTAINER), SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT), From ede5c558b35d8890ad127e53b8dadf357f06bc3a Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Thu, 25 Jun 2020 11:14:36 +0000 Subject: [PATCH 43/45] Update Scripts to 2020-06-25-rev190 --- .../src/main/scripts/ChatSplitBuilder.hash | 2 +- .../src/main/scripts/ChatSplitBuilder.rs2asm | 2 +- .../main/scripts/LayoutResizableStones.hash | 2 +- .../main/scripts/LayoutResizableStones.rs2asm | 56 +++++++++---------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/runelite-client/src/main/scripts/ChatSplitBuilder.hash b/runelite-client/src/main/scripts/ChatSplitBuilder.hash index d1af1933dc..2f0ba6651e 100644 --- a/runelite-client/src/main/scripts/ChatSplitBuilder.hash +++ b/runelite-client/src/main/scripts/ChatSplitBuilder.hash @@ -1 +1 @@ -62A149F6CCCF18FEEA3F247F12F10BBC349239EFD5F87CF83DC5629636D790ED \ No newline at end of file +85382CB95B13EA567E72410A58D18DAD6754D3361E584DFF0A1E417989E8214C \ No newline at end of file diff --git a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm index 04548b80b2..5d537772ea 100644 --- a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm +++ b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm @@ -62,7 +62,7 @@ LABEL49: iconst 73 iconst 73 iload 6 - iconst 10551327 + iconst 10551328 enum if_getheight add diff --git a/runelite-client/src/main/scripts/LayoutResizableStones.hash b/runelite-client/src/main/scripts/LayoutResizableStones.hash index 57f7195ac0..39d5e9cbbb 100644 --- a/runelite-client/src/main/scripts/LayoutResizableStones.hash +++ b/runelite-client/src/main/scripts/LayoutResizableStones.hash @@ -1 +1 @@ -8CD8829FDF85B9AD7748CE4EA9CA4DD31138ACA1AF4BB35038A982B75F32791C \ No newline at end of file +91023012B55ED61B5DA93FAD2CB6A92EBB9AA8C8633AC5AC6FB337C2AFC6365F \ No newline at end of file diff --git a/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm index 81d887a85f..5b69603382 100644 --- a/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm +++ b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm @@ -20,11 +20,11 @@ 1131: LABEL9 jump LABEL201 LABEL9: - iconst 10747938 + iconst 10747939 if_getwidth iconst 33 sub - iconst 10747938 + iconst 10747939 if_getheight istore 3 istore 2 @@ -33,7 +33,7 @@ LABEL9: iconst 73 iconst 73 iload 1 - iconst 10551327 + iconst 10551328 enum if_getwidth sub @@ -47,7 +47,7 @@ LABEL9: LABEL29: iconst 0 iload 3 - iconst 10747953 + iconst 10747954 if_getheight add iconst 2 @@ -55,14 +55,14 @@ LABEL29: iconst 73 iconst 73 iload 1 - iconst 10747970 + iconst 10747971 enum if_setposition iconst 0 iload 3 iconst 2 iconst 2 - iconst 10747953 + iconst 10747954 if_setposition jump LABEL65 LABEL49: @@ -73,14 +73,14 @@ LABEL49: iconst 73 iconst 73 iload 1 - iconst 10747970 + iconst 10747971 enum if_setposition iload 2 iconst 0 iconst 2 iconst 2 - iconst 10747953 + iconst 10747954 if_setposition LABEL65: get_varbit 4084 @@ -92,7 +92,7 @@ LABEL69: iconst 73 iconst 73 iload 1 - iconst 10551323 + iconst 10551324 enum 2122 jump LABEL84 @@ -101,7 +101,7 @@ LABEL77: iconst 73 iconst 73 iload 1 - iconst 10551323 + iconst 10551324 enum 2122 LABEL84: @@ -118,7 +118,7 @@ LABEL91: iconst 73 iconst 73 iload 1 - iconst 10551323 + iconst 10551324 enum 2122 jump LABEL106 @@ -127,7 +127,7 @@ LABEL99: iconst 73 iconst 73 iload 1 - iconst 10551323 + iconst 10551324 enum 2122 LABEL106: @@ -144,7 +144,7 @@ LABEL113: iconst 73 iconst 73 iload 1 - iconst 10551323 + iconst 10551324 enum 2122 jump LABEL128 @@ -153,7 +153,7 @@ LABEL121: iconst 73 iconst 73 iload 1 - iconst 10551323 + iconst 10551324 enum 2122 LABEL128: @@ -165,15 +165,15 @@ LABEL129: jump LABEL137 LABEL133: iconst 1 - iconst 39387168 + iconst 39387169 if_sethide jump LABEL192 LABEL137: iconst 0 - iconst 39387168 + iconst 39387169 if_sethide iconst 1 - iconst 39387168 + iconst 39387169 2308 get_varbit 6255 switch @@ -183,38 +183,38 @@ LABEL137: jump LABEL170 LABEL146: iconst 1718 - iconst 39387170 + iconst 39387171 if_setgraphic iconst 1 sconst "Toggle single-tap mode" - iconst 39387168 + iconst 39387169 if_setop jump LABEL177 LABEL154: iconst 1717 - iconst 39387170 + iconst 39387171 if_setgraphic iconst 1 sconst "Toggle tap-to-drop mode" - iconst 39387168 + iconst 39387169 if_setop jump LABEL177 LABEL162: iconst 1716 - iconst 39387170 + iconst 39387171 if_setgraphic iconst 1 sconst "Show Keyboard" - iconst 39387168 + iconst 39387169 if_setop jump LABEL177 LABEL170: iconst 1715 - iconst 39387170 + iconst 39387171 if_setgraphic iconst 1 sconst "" - iconst 39387168 + iconst 39387169 if_setop LABEL177: get_varbit 6255 @@ -228,18 +228,18 @@ LABEL181: jump LABEL189 LABEL185: iconst 155 - iconst 39387170 + iconst 39387171 if_settrans jump LABEL192 LABEL189: iconst 0 - iconst 39387170 + iconst 39387171 if_settrans LABEL192: invoke 2581 get_varbit 6254 invoke 633 - iconst 39387159 + iconst 39387160 if_sethide invoke 2526 pop_int From 9f97c5a54c03977f14f34f68c536dc2a9b013cbf Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Thu, 25 Jun 2020 11:47:31 +0000 Subject: [PATCH 44/45] Release 1.6.21 --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index d417f68a8f..06a9af36c4 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21-SNAPSHOT + 1.6.21 cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index 69bf02e01d..0b34a515d8 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.21-SNAPSHOT + 1.6.21 Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 7212c63e7c..fe970a158a 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21-SNAPSHOT + 1.6.21 cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 49d8aa82c4..4f99fc190c 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.21-SNAPSHOT + 1.6.21 Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index c6e5100600..667a5d64aa 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.21-SNAPSHOT + 1.6.21 Web Service diff --git a/pom.xml b/pom.xml index fce967d738..996e0dcc75 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.21-SNAPSHOT + 1.6.21 pom RuneLite @@ -61,7 +61,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - HEAD + runelite-parent-1.6.21 diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index a261e00392..18e75d6bc2 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21-SNAPSHOT + 1.6.21 runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 4faa616ba8..8788cdec9e 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21-SNAPSHOT + 1.6.21 client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index e7e874d27a..911f254cf5 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21-SNAPSHOT + 1.6.21 script-assembler-plugin From f7a233b90d7513646e4419edb3fa9f86fab78cd4 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Thu, 25 Jun 2020 11:47:39 +0000 Subject: [PATCH 45/45] Bump for 1.6.22-SNAPSHOT --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index 06a9af36c4..e4ad9c110e 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21 + 1.6.22-SNAPSHOT cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index 0b34a515d8..4ef55c6c0c 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.21 + 1.6.22-SNAPSHOT Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index fe970a158a..1858764382 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21 + 1.6.22-SNAPSHOT cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 4f99fc190c..8a52a759ff 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.21 + 1.6.22-SNAPSHOT Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index 667a5d64aa..f9b9b2ef1c 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.21 + 1.6.22-SNAPSHOT Web Service diff --git a/pom.xml b/pom.xml index 996e0dcc75..abd5bdceab 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.21 + 1.6.22-SNAPSHOT pom RuneLite @@ -61,7 +61,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - runelite-parent-1.6.21 + HEAD diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 18e75d6bc2..762eda5697 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21 + 1.6.22-SNAPSHOT runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 8788cdec9e..d37b581c7f 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21 + 1.6.22-SNAPSHOT client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 911f254cf5..76342015d2 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.21 + 1.6.22-SNAPSHOT script-assembler-plugin