From b5b64bc9ee05e2bf7e8d49be8821cfd463722632 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Wed, 27 Jan 2021 12:00:26 -0500 Subject: [PATCH 01/10] loottracker: add Gold Chest tracking (Shades of Mort'ton) --- .../client/plugins/loottracker/LootTrackerPlugin.java | 5 +++++ 1 file changed, 5 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 7bf83abca3..816041298a 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 @@ -186,6 +186,11 @@ public class LootTrackerPlugin extends Plugin put(ObjectID.SILVER_CHEST_4128, "Silver key crimson"). put(ObjectID.SILVER_CHEST_4129, "Silver key black"). put(ObjectID.SILVER_CHEST_4130, "Silver key purple"). + put(ObjectID.GOLD_CHEST, "Gold key red"). + put(ObjectID.GOLD_CHEST_41213, "Gold key brown"). + put(ObjectID.GOLD_CHEST_41214, "Gold key crimson"). + put(ObjectID.GOLD_CHEST_41215, "Gold key black"). + put(ObjectID.GOLD_CHEST_41216, "Gold key purple"). build(); // Hallow Sepulchre Coffin handling From e4d5450283685ca7c39498bf48b6649cb7c9c062 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Wed, 27 Jan 2021 12:02:46 -0500 Subject: [PATCH 02/10] worldmap: add Shades of Mort'ton minigame location --- .../net/runelite/client/plugins/worldmap/MinigameLocation.java | 1 + 1 file changed, 1 insertion(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java index a5f0b55ca0..cc387c4872 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java @@ -55,6 +55,7 @@ enum MinigameLocation PYRAMID_PLUNDER("Pyramid Plunder", new WorldPoint(3288, 2787, 0)), RANGING_GUILD("Ranging Guild", new WorldPoint(2671, 3419, 0)), ROGUES_DEN("Rogues' Den", new WorldPoint(2905, 3537, 0)), + SHADES_OF_MORTTON("Shades of Mort'ton", new WorldPoint(3505, 3315, 0)), SORCERESSS_GARDEN("Sorceress's Garden", new WorldPoint(3285, 3180, 0)), TROUBLE_BREWING("Trouble Brewing", new WorldPoint(3811, 3021, 0)), VOLCANIC_MINE("Volcanic Mine", new WorldPoint(3812, 3810, 0)), From 5e7242388daedef973ee3504a1831a093d42fc0a Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 2 Feb 2021 21:03:56 -0500 Subject: [PATCH 03/10] image component: support setPreferredSize --- .../ui/overlay/components/ImageComponent.java | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImageComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImageComponent.java index 39ec431697..46f07f0515 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImageComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImageComponent.java @@ -24,35 +24,37 @@ */ package net.runelite.client.ui.overlay.components; +import com.google.common.base.MoreObjects; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.image.BufferedImage; import lombok.Getter; +import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.Setter; +import net.runelite.client.util.ImageUtil; @RequiredArgsConstructor -@Setter public class ImageComponent implements LayoutableRenderableEntity { + @NonNull private final BufferedImage image; + private BufferedImage scaledImage; + @Getter private final Rectangle bounds = new Rectangle(); + @Setter private Point preferredLocation = new Point(); @Override public Dimension render(Graphics2D graphics) { - if (image == null) - { - return null; - } - - graphics.drawImage(image, preferredLocation.x, preferredLocation.y, null); + BufferedImage i = MoreObjects.firstNonNull(scaledImage, image); + graphics.drawImage(i, preferredLocation.x, preferredLocation.y, null); final Dimension dimension = new Dimension(image.getWidth(), image.getHeight()); bounds.setLocation(preferredLocation); bounds.setSize(dimension); @@ -60,8 +62,15 @@ public class ImageComponent implements LayoutableRenderableEntity } @Override - public void setPreferredSize(Dimension dimension) + public void setPreferredSize(Dimension preferredSize) { - // Just use image dimensions for now + if (preferredSize == null || (preferredSize.width == image.getWidth() && preferredSize.height == image.getHeight())) + { + scaledImage = null; + } + else + { + scaledImage = ImageUtil.resizeImage(image, preferredSize.width, preferredSize.height); + } } -} \ No newline at end of file +} From bbfa08f8b7d2343d97ef40be608fcfc69f52de43 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Mon, 25 Jan 2021 23:45:29 -0800 Subject: [PATCH 04/10] MenuOptionClicked: Add selectedItemIndex field --- .../main/java/net/runelite/api/events/MenuOptionClicked.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java index 8eb4707ae8..2cd15c48f9 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java +++ b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java @@ -67,6 +67,10 @@ public class MenuOptionClicked * @see net.runelite.api.widgets.WidgetID */ private int widgetId; + /** + * The selected item index at the time of the option click. + */ + private int selectedItemIndex; /** * Whether or not the event has been consumed by a subscriber. */ From a58b2d3fdfd6dcb6c5c98b52a01995da351005f9 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 2 Feb 2021 23:26:18 -0500 Subject: [PATCH 05/10] Revert "image component: support setPreferredSize" This reverts commit 5e7242388daedef973ee3504a1831a093d42fc0a. --- .../ui/overlay/components/ImageComponent.java | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImageComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImageComponent.java index 46f07f0515..39ec431697 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImageComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/ImageComponent.java @@ -24,37 +24,35 @@ */ package net.runelite.client.ui.overlay.components; -import com.google.common.base.MoreObjects; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.image.BufferedImage; import lombok.Getter; -import lombok.NonNull; import lombok.RequiredArgsConstructor; import lombok.Setter; -import net.runelite.client.util.ImageUtil; @RequiredArgsConstructor +@Setter public class ImageComponent implements LayoutableRenderableEntity { - @NonNull private final BufferedImage image; - private BufferedImage scaledImage; - @Getter private final Rectangle bounds = new Rectangle(); - @Setter private Point preferredLocation = new Point(); @Override public Dimension render(Graphics2D graphics) { - BufferedImage i = MoreObjects.firstNonNull(scaledImage, image); - graphics.drawImage(i, preferredLocation.x, preferredLocation.y, null); + if (image == null) + { + return null; + } + + graphics.drawImage(image, preferredLocation.x, preferredLocation.y, null); final Dimension dimension = new Dimension(image.getWidth(), image.getHeight()); bounds.setLocation(preferredLocation); bounds.setSize(dimension); @@ -62,15 +60,8 @@ public class ImageComponent implements LayoutableRenderableEntity } @Override - public void setPreferredSize(Dimension preferredSize) + public void setPreferredSize(Dimension dimension) { - if (preferredSize == null || (preferredSize.width == image.getWidth() && preferredSize.height == image.getHeight())) - { - scaledImage = null; - } - else - { - scaledImage = ImageUtil.resizeImage(image, preferredSize.width, preferredSize.height); - } + // Just use image dimensions for now } -} +} \ No newline at end of file From a6841c5cebca365bd71cfa610af9e5bc534c4e89 Mon Sep 17 00:00:00 2001 From: Jonathan Lee Date: Wed, 3 Feb 2021 07:29:48 -0800 Subject: [PATCH 06/10] loot tracker: add support for isle of souls chests They have the same description and behavior as stone chest. From melky test: 2021-02-03 13:54:03 [Client] DEBUG n.r.c.p.l.LootTrackerPlugin - Tick: 417 2021-02-03 13:54:04 [Client] DEBUG client-patch - Chat message type SPAM: You manage to unlock the chest. 2021-02-03 13:54:04 [Client] DEBUG n.r.c.p.l.LootTrackerPlugin - Tick: 418 2021-02-03 13:54:04 [Client] DEBUG client-patch - Chat message type SPAM: You steal some loot from the chest. 2021-02-03 13:54:04 [Client] DEBUG n.r.c.p.l.LootTrackerPlugin - Received icc: [Item(id=12791, quantity=1), Item(id=13068, quantity=1), Item(id=13222, quantity=1), Item(id=13069, quantity=1), Item(id=5698, quantity=1), Item(id=6705, quantity=1), Item(id=6705, quantity=1), Item(id=6705, quantity=1), Item(id=6705, quantity=1), Item(id=6705, quantity=1), Item(id=6705, quantity=1), Item(id=6705, quantity=1), Item(id=228, quantity=2), Item(id=12631, quantity=1), Item(id=11953, quantity=1), Item(id=1523, quantity=1), Item(id=1523, quantity=1), Item(id=1355, quantity=1), Item(id=314, quantity=121), Item(id=1621, quantity=1), Item(id=2510, quantity=8)] tick: 418 --- .../client/plugins/loottracker/LootTrackerPlugin.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 816041298a..f3802e230a 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 @@ -145,7 +145,8 @@ public class LootTrackerPlugin extends Plugin // Chest loot handling private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!"; private static final Pattern LARRAN_LOOTED_PATTERN = Pattern.compile("You have opened Larran's (big|small) chest .*"); - private static final String STONE_CHEST_LOOTED_MESSAGE = "You steal some loot from the chest."; + // Used by Stone Chest, Isle of Souls chest, Dark Chest + private static final String OTHER_CHEST_LOOTED_MESSAGE = "You steal some loot from the chest."; private static final String DORGESH_KAAN_CHEST_LOOTED_MESSAGE = "You find treasure inside!"; private static final String GRUBBY_CHEST_LOOTED_MESSAGE = "You have opened the Grubby Chest"; private static final Pattern HAM_CHEST_LOOTED_PATTERN = Pattern.compile("Your (?[a-z]+) key breaks in the lock.*"); @@ -161,6 +162,8 @@ public class LootTrackerPlugin extends Plugin put(10835, "Dorgesh-Kaan Chest"). put(10834, "Dorgesh-Kaan Chest"). put(7323, "Grubby Chest"). + put(8593, "Isle of Souls Chest"). + put(7827, "Dark Chest"). build(); // Shade chest loot handling @@ -630,7 +633,7 @@ public class LootTrackerPlugin extends Plugin final String message = event.getMessage(); - if (message.equals(CHEST_LOOTED_MESSAGE) || message.equals(STONE_CHEST_LOOTED_MESSAGE) + if (message.equals(CHEST_LOOTED_MESSAGE) || message.equals(OTHER_CHEST_LOOTED_MESSAGE) || message.equals(DORGESH_KAAN_CHEST_LOOTED_MESSAGE) || message.startsWith(GRUBBY_CHEST_LOOTED_MESSAGE) || LARRAN_LOOTED_PATTERN.matcher(message).matches()) { From 9381e62f6d321a0af215765101c370d621c4aa8e Mon Sep 17 00:00:00 2001 From: Jonatino Date: Thu, 14 Jan 2021 14:50:58 -0500 Subject: [PATCH 07/10] Fix incorrect named value when storing FlatStorage caches --- cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java b/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java index 92a82e26b7..c8d651bcf6 100644 --- a/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java +++ b/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java @@ -220,7 +220,7 @@ public class FlatStorage implements Storage br.printf("revision=%d\n", idx.getRevision()); br.printf("compression=%d\n", idx.getCompression()); br.printf("crc=%d\n", idx.getCrc()); - br.printf("named=%b\n", idx.getCompression()); + br.printf("named=%b\n", idx.isNamed()); idx.getArchives().sort(Comparator.comparing(Archive::getArchiveId)); for (Archive archive : idx.getArchives()) From 27fb56f5b8cdfc8b376b1d42b48953e6c348277f Mon Sep 17 00:00:00 2001 From: Taylor Abraham Date: Fri, 11 Dec 2020 10:08:47 -0500 Subject: [PATCH 08/10] music: Make volume percent visible when hovering handle --- .../java/net/runelite/client/plugins/music/MusicPlugin.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java index 6f3421b08a..b557cc18b3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java @@ -466,6 +466,7 @@ public class MusicPlugin extends Plugin public void update() { + handle.setNoClickThrough(false); handle.setOnDragListener((JavaScriptCallback) this::drag); handle.setOnDragCompleteListener((JavaScriptCallback) this::drag); handle.setHasListener(true); @@ -511,6 +512,9 @@ public class MusicPlugin extends Plugin int level = (x * channel.max) / getWidth(); level = Ints.constrainToRange(level, 0, channel.max); channel.setLevel(level); + + int percent = (int) Math.round((level * 100.0 / channel.getMax())); + sliderTooltip = new Tooltip(channel.getName() + ": " + percent + "%"); } protected int getWidth() From 263b02ac14ce1c298790915b46decac6445b06a9 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 3 Feb 2021 14:20:50 -0500 Subject: [PATCH 09/10] config manager: use createTempFile for config temp file With multiple clients with different configs saving at once, the same temp file was being used, which can cause it to not save or to move() a temp file from a different client --- .../src/main/java/net/runelite/client/config/ConfigManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java b/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java index 01d8ebfe1d..a2a4eef25c 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java +++ b/runelite-client/src/main/java/net/runelite/client/config/ConfigManager.java @@ -394,7 +394,7 @@ public class ConfigManager parent.mkdirs(); - File tempFile = new File(parent, RuneLite.DEFAULT_CONFIG_FILE.getName() + ".tmp"); + File tempFile = File.createTempFile("runelite", null, parent); try (FileOutputStream out = new FileOutputStream(tempFile)) { From 4f6f518a153e4424c27c4c15cbc444e72744d7e6 Mon Sep 17 00:00:00 2001 From: Usman Akhtar <60450353+akhtar-u@users.noreply.github.com> Date: Wed, 3 Feb 2021 17:18:16 -0500 Subject: [PATCH 10/10] worldmap: use boosted level for map icon tooltips --- .../net/runelite/client/plugins/worldmap/WorldMapPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java index 1114d56720..dcac0c700f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapPlugin.java @@ -186,7 +186,7 @@ public class WorldMapPlugin extends Plugin { case AGILITY: { - int newAgilityLevel = statChanged.getLevel(); + int newAgilityLevel = statChanged.getBoostedLevel(); if (newAgilityLevel != agilityLevel) { agilityLevel = newAgilityLevel; @@ -196,7 +196,7 @@ public class WorldMapPlugin extends Plugin } case WOODCUTTING: { - int newWoodcutLevel = statChanged.getLevel(); + int newWoodcutLevel = statChanged.getBoostedLevel(); if (newWoodcutLevel != woodcuttingLevel) { woodcuttingLevel = newWoodcutLevel;