From 4958165d8c6edd5e508fd5e6ebf98e858bed7e09 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Thu, 1 Oct 2020 02:49:10 -0600 Subject: [PATCH 01/40] experiencedrop: dont npe when trying to prayer highlight noncombat drops --- .../runelite/client/plugins/experiencedrop/XpDropPlugin.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java index 51498bd9f9..0f7d008131 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/experiencedrop/XpDropPlugin.java @@ -28,6 +28,7 @@ import com.google.inject.Provides; import java.util.Arrays; import java.util.EnumMap; import java.util.Map; +import java.util.Objects; import java.util.stream.IntStream; import javax.inject.Inject; import net.runelite.api.Client; @@ -107,6 +108,7 @@ public class XpDropPlugin extends Plugin final IntStream spriteIDs = Arrays.stream(children) .skip(1) // skip text + .filter(Objects::nonNull) .mapToInt(Widget::getSpriteId); int color = 0; From c88c094bcc52777e42e18ce33e14a37cad80c3bb Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Wed, 21 Oct 2020 10:39:38 +0000 Subject: [PATCH 02/40] Update 192 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7379cfe1f0..4919badfe5 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ true - 191 + 192 From 09a2e771da3875fc785e9be7ae866a257f6ea6b7 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Wed, 21 Oct 2020 11:16:52 +0000 Subject: [PATCH 03/40] Release 1.6.29 --- 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 b28ebd7468..9e0c8b9a40 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.29-SNAPSHOT + 1.6.29 cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index be7a38ed8f..45cd01d2ed 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.29-SNAPSHOT + 1.6.29 Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 6ff9dce234..355a502e50 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.29-SNAPSHOT + 1.6.29 cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 7ab9b099f0..cd4e9ec8a7 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.29-SNAPSHOT + 1.6.29 Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index f4f411a0d4..f19310c046 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.29-SNAPSHOT + 1.6.29 Web Service diff --git a/pom.xml b/pom.xml index 4919badfe5..c61a07ed97 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.29-SNAPSHOT + 1.6.29 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.29 diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 05c657f102..f75afac663 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.29-SNAPSHOT + 1.6.29 runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 72c6d34166..54cdf57e79 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.29-SNAPSHOT + 1.6.29 client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 97f4a47795..1a8df1ea04 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.29-SNAPSHOT + 1.6.29 script-assembler-plugin From 0e4cfaefa7f2c2deccb7af2cf731fa9e24e9e4ae Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Wed, 21 Oct 2020 11:17:01 +0000 Subject: [PATCH 04/40] Bump for 1.6.30-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 9e0c8b9a40..1ec4731562 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.29 + 1.6.30-SNAPSHOT cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index 45cd01d2ed..796a31240a 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.29 + 1.6.30-SNAPSHOT Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 355a502e50..283d9deb9b 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.29 + 1.6.30-SNAPSHOT cache diff --git a/http-api/pom.xml b/http-api/pom.xml index cd4e9ec8a7..106086753e 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.29 + 1.6.30-SNAPSHOT Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index f19310c046..9aa89e7815 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.29 + 1.6.30-SNAPSHOT Web Service diff --git a/pom.xml b/pom.xml index c61a07ed97..33cd81190d 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.29 + 1.6.30-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.29 + HEAD diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index f75afac663..9977cfb97a 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.29 + 1.6.30-SNAPSHOT runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 54cdf57e79..7b58466043 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.29 + 1.6.30-SNAPSHOT client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 1a8df1ea04..99fa981e02 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.29 + 1.6.30-SNAPSHOT script-assembler-plugin From 9fc8f19c327f2720e0f21810dc1c01ecfc88feea Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 21 Oct 2020 10:20:47 -0400 Subject: [PATCH 05/40] pluginhub controller: fix scheduled task delay This was meant to be 30 minutes --- .../runelite/http/service/pluginhub/PluginHubController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http-service/src/main/java/net/runelite/http/service/pluginhub/PluginHubController.java b/http-service/src/main/java/net/runelite/http/service/pluginhub/PluginHubController.java index fde79591e1..f9f424dca7 100644 --- a/http-service/src/main/java/net/runelite/http/service/pluginhub/PluginHubController.java +++ b/http-service/src/main/java/net/runelite/http/service/pluginhub/PluginHubController.java @@ -114,7 +114,7 @@ public class PluginHubController } } - @Scheduled(fixedDelay = 1_8000_000, initialDelay = 30_000) // 30 minutes with 30 second initial delay + @Scheduled(fixedDelay = 1_800_000, initialDelay = 30_000) // 30 minutes with 30 second initial delay public void rebuildCounts() { Map counts = new HashMap<>(); From 93adb7ca75b4fe02a68b33a693b6b0b27555b037 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 21 Oct 2020 23:36:44 -0400 Subject: [PATCH 06/40] xp tracker: default pause on logout to on --- .../net/runelite/client/plugins/xptracker/XpTrackerConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 21ed053398..3bedf3548d 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 @@ -60,7 +60,7 @@ public interface XpTrackerConfig extends Config ) default boolean pauseOnLogout() { - return false; + return true; } @ConfigItem( From 66b4d18126f09a58d0c148196c1d7d913277ac48 Mon Sep 17 00:00:00 2001 From: winterdaze <35933468+winterdaze-rs@users.noreply.github.com> Date: Wed, 21 Oct 2020 12:30:55 -0700 Subject: [PATCH 07/40] WidgetOverlay: make nightmare pillar health widget moveable --- .../src/main/java/net/runelite/api/widgets/WidgetID.java | 1 + .../src/main/java/net/runelite/api/widgets/WidgetInfo.java | 2 ++ .../main/java/net/runelite/client/ui/overlay/WidgetOverlay.java | 1 + 3 files changed, 4 insertions(+) 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 9d56b8d797..d5c1b1f630 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 @@ -95,6 +95,7 @@ public class WidgetID public static final int PUZZLE_BOX_GROUP_ID = 306; public static final int LIGHT_BOX_GROUP_ID = 322; public static final int NIGHTMARE_ZONE_GROUP_ID = 202; + public static final int NIGHTMARE_PILLAR_HEALTH_GROUP_ID = 413; public static final int BLAST_FURNACE_GROUP_ID = 474; public static final int WORLD_MAP_GROUP_ID = 595; public static final int PYRAMID_PLUNDER_GROUP_ID = 428; 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 079c57f448..7407cb71a2 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 @@ -430,6 +430,8 @@ public enum WidgetInfo NIGHTMARE_ZONE(WidgetID.NIGHTMARE_ZONE_GROUP_ID, 0), + NIGHTMARE_PILLAR_HEALTH(WidgetID.NIGHTMARE_PILLAR_HEALTH_GROUP_ID, 1), + RAIDS_POINTS_INFOBOX(WidgetID.RAIDS_GROUP_ID, WidgetID.Raids.POINTS_INFOBOX), TOB_PARTY_INTERFACE(WidgetID.TOB_PARTY_GROUP_ID, WidgetID.Tob.PARTY_INTERFACE), diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java index c578ca3ee8..c8d4858e63 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java @@ -61,6 +61,7 @@ public class WidgetOverlay extends Overlay .put(WidgetInfo.GAUNTLET_TIMER_CONTAINER, OverlayPosition.TOP_LEFT) .put(WidgetInfo.HALLOWED_SEPULCHRE_TIMER_CONTAINER, OverlayPosition.TOP_LEFT) .put(WidgetInfo.HEALTH_OVERLAY_BAR, OverlayPosition.TOP_CENTER) + .put(WidgetInfo.NIGHTMARE_PILLAR_HEALTH, OverlayPosition.TOP_LEFT) .build(); public static Collection createOverlays(final Client client) From 4dd413bf63230e1d01ae4cf53770552926d557dc Mon Sep 17 00:00:00 2001 From: Bram91 <7499230+Bram91@users.noreply.github.com> Date: Wed, 21 Oct 2020 21:32:23 +0200 Subject: [PATCH 08/40] Make Volcanic mine widgets layoutable --- .../src/main/java/net/runelite/api/widgets/WidgetID.java | 3 ++- .../src/main/java/net/runelite/api/widgets/WidgetInfo.java | 1 + .../java/net/runelite/client/ui/overlay/WidgetOverlay.java | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) 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 d5c1b1f630..563bc38161 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 @@ -586,7 +586,8 @@ public class WidgetID static final int POINTS = 10; static final int STABILITY = 12; static final int PLAYER_COUNT = 14; - static final int VENTS_INFOBOX_GROUP_ID = 15; + static final int STABILITY_INFOBOX_GROUP_ID = 5; + static final int VENTS_INFOBOX_GROUP_ID = 16; static final int VENT_A_PERCENTAGE = 19; static final int VENT_B_PERCENTAGE = 20; static final int VENT_C_PERCENTAGE = 21; 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 7407cb71a2..2f2a31fbed 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 @@ -96,6 +96,7 @@ public enum WidgetInfo VOLCANIC_MINE_STABILITY(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.STABILITY), VOLCANIC_MINE_PLAYER_COUNT(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.PLAYER_COUNT), VOLCANIC_MINE_VENTS_INFOBOX_GROUP(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.VENTS_INFOBOX_GROUP_ID), + VOLCANIC_MINE_STABILITY_INFOBOX_GROUP(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.STABILITY_INFOBOX_GROUP_ID), VOLCANIC_MINE_VENT_A_PERCENTAGE(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.VENT_A_PERCENTAGE), VOLCANIC_MINE_VENT_B_PERCENTAGE(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.VENT_B_PERCENTAGE), VOLCANIC_MINE_VENT_C_PERCENTAGE(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.VENT_C_PERCENTAGE), diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java index c8d4858e63..c10de61e55 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java @@ -62,6 +62,8 @@ public class WidgetOverlay extends Overlay .put(WidgetInfo.HALLOWED_SEPULCHRE_TIMER_CONTAINER, OverlayPosition.TOP_LEFT) .put(WidgetInfo.HEALTH_OVERLAY_BAR, OverlayPosition.TOP_CENTER) .put(WidgetInfo.NIGHTMARE_PILLAR_HEALTH, OverlayPosition.TOP_LEFT) + .put(WidgetInfo.VOLCANIC_MINE_VENTS_INFOBOX_GROUP, OverlayPosition.BOTTOM_RIGHT) + .put(WidgetInfo.VOLCANIC_MINE_STABILITY_INFOBOX_GROUP, OverlayPosition.BOTTOM_LEFT) .build(); public static Collection createOverlays(final Client client) From 0b221d3121af01bf9491e6cea9c2570a1f63954d Mon Sep 17 00:00:00 2001 From: Joona Date: Fri, 23 Oct 2020 20:15:01 +0300 Subject: [PATCH 09/40] grounditems: Render ground items tile overlay at correct height (#12586) --- .../java/net/runelite/api/Perspective.java | 40 +++++++++++++++++-- .../grounditems/GroundItemsOverlay.java | 2 +- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Perspective.java b/runelite-api/src/main/java/net/runelite/api/Perspective.java index ad052e27db..87b7b287eb 100644 --- a/runelite-api/src/main/java/net/runelite/api/Perspective.java +++ b/runelite-api/src/main/java/net/runelite/api/Perspective.java @@ -364,6 +364,20 @@ public class Perspective return getCanvasTileAreaPoly(client, localLocation, 1); } + /** + * Calculates a tile polygon from offset worldToScreen() points. + * + * @param client the game client + * @param localLocation local location of the tile + * @param zOffset offset from ground plane + * @return a {@link Polygon} on screen corresponding to the given + * localLocation. + */ + public static Polygon getCanvasTilePoly(@Nonnull Client client, @Nonnull LocalPoint localLocation, int zOffset) + { + return getCanvasTileAreaPoly(client, localLocation, 1, zOffset); + } + /** * Returns a polygon representing an area. * @@ -373,6 +387,24 @@ public class Perspective * @return a polygon representing the tiles in the area */ public static Polygon getCanvasTileAreaPoly(@Nonnull Client client, @Nonnull LocalPoint localLocation, int size) + { + return getCanvasTileAreaPoly(client, localLocation, size, 0); + } + + /** + * Returns a polygon representing an area. + * + * @param client the game client + * @param localLocation the center location of the AoE + * @param size the size of the area (ie. 3x3 AoE evaluates to size 3) + * @param zOffset offset from ground plane + * @return a polygon representing the tiles in the area + */ + public static Polygon getCanvasTileAreaPoly( + @Nonnull Client client, + @Nonnull LocalPoint localLocation, + int size, + int zOffset) { final int plane = client.getPlane(); @@ -404,10 +436,10 @@ public class Perspective tilePlane = plane + 1; } - final int swHeight = getHeight(client, swX, swY, tilePlane); - final int nwHeight = getHeight(client, nwX, nwY, tilePlane); - final int neHeight = getHeight(client, neX, neY, tilePlane); - final int seHeight = getHeight(client, seX, seY, tilePlane); + final int swHeight = getHeight(client, swX, swY, tilePlane) - zOffset; + final int nwHeight = getHeight(client, nwX, nwY, tilePlane) - zOffset; + final int neHeight = getHeight(client, neX, neY, tilePlane) - zOffset; + final int seHeight = getHeight(client, seX, seY, tilePlane) - zOffset; Point p1 = localToCanvas(client, swX, swY, swHeight); Point p2 = localToCanvas(client, nwX, nwY, nwHeight); 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 d38eb6a4bd..fd22bbe164 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 @@ -210,7 +210,7 @@ public class GroundItemsOverlay extends Overlay if (config.highlightTiles()) { - final Polygon poly = Perspective.getCanvasTilePoly(client, groundPoint); + final Polygon poly = Perspective.getCanvasTilePoly(client, groundPoint, item.getHeight()); if (poly != null) { From da6cb1bc65b598755b04ec6d1251fe9bbdb95152 Mon Sep 17 00:00:00 2001 From: Ron Young Date: Thu, 1 Oct 2020 11:11:20 -0500 Subject: [PATCH 10/40] banktags: don't allow colon in tagtab names The config server replaces periods in keys with colons. When the config is downloaded by the client, the colon is then replaced with a period. --- .../net/runelite/client/plugins/banktags/BankTagsPlugin.java | 2 +- .../net/runelite/client/plugins/banktags/tabs/TabInterface.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java index e00c3732e3..186ca422e9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java @@ -233,7 +233,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener return; } - String replaced = value.replaceAll("[<>/]", ""); + String replaced = value.replaceAll("[<>:/]", ""); if (!value.equals(replaced)) { replaced = Text.toCSV(Text.fromCSV(replaced)); 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 208a6fe1b0..1799b4f9f2 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 @@ -97,7 +97,7 @@ import net.runelite.client.util.Text; @Singleton public class TabInterface { - public static final IntPredicate FILTERED_CHARS = c -> "".indexOf(c) == -1; + public static final IntPredicate FILTERED_CHARS = c -> ":".indexOf(c) == -1; private static final Color HILIGHT_COLOR = JagexColors.MENU_TARGET; private static final String SCROLL_UP = "Scroll up"; From 46e9e930502efb6a460a271a215efa50a908138e Mon Sep 17 00:00:00 2001 From: Jacob Mischka Date: Fri, 23 Oct 2020 12:28:59 -0500 Subject: [PATCH 11/40] overlayrenderer: Make minimum overlay size configurable per-overlay (#12611) Halve the minimum for Screen Marker Overlay to "fix" #12267 (set to 16). Any smaller than 16 makes subsequent resizes impossible because the cursor type never changes from center (move mode). --- .../plugins/screenmarkers/ScreenMarkerOverlay.java | 1 + .../java/net/runelite/client/ui/overlay/Overlay.java | 1 + .../runelite/client/ui/overlay/OverlayRenderer.java | 10 +++++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenmarkers/ScreenMarkerOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenmarkers/ScreenMarkerOverlay.java index c82ac2aee8..7741eaeffd 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenmarkers/ScreenMarkerOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenmarkers/ScreenMarkerOverlay.java @@ -49,6 +49,7 @@ public class ScreenMarkerOverlay extends Overlay setLayer(OverlayLayer.ALWAYS_ON_TOP); setPriority(OverlayPriority.HIGH); setResizable(true); + setMinimumSize(16); setResettable(false); } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/Overlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/Overlay.java index a440108944..303b423a6a 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/Overlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/Overlay.java @@ -51,6 +51,7 @@ public abstract class Overlay implements LayoutableRenderableEntity private OverlayLayer layer = OverlayLayer.UNDER_WIDGETS; private final List menuEntries = new ArrayList<>(); private boolean resizable; + private int minimumSize = 32; private boolean resettable = true; /** diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java index 7a4d7f08c1..1b886f4ec9 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java @@ -70,7 +70,6 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener private static final int BORDER = 5; private static final int BORDER_TOP = BORDER + 15; private static final int PADDING = 2; - private static final int MIN_OVERLAY_SIZE = 32; private static final int OVERLAY_RESIZE_TOLERANCE = 5; private static final Dimension SNAP_CORNER_SIZE = new Dimension(80, 80); private static final Color SNAP_CORNER_COLOR = new Color(0, 255, 255, 50); @@ -536,8 +535,9 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener // center } - final int widthOverflow = Math.max(0, MIN_OVERLAY_SIZE - width); - final int heightOverflow = Math.max(0, MIN_OVERLAY_SIZE - height); + final int minOverlaySize = currentManagedOverlay.getMinimumSize(); + final int widthOverflow = Math.max(0, minOverlaySize - width); + final int heightOverflow = Math.max(0, minOverlaySize - height); final int dx = x - originalX; final int dy = y - originalY; @@ -545,7 +545,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener // dimensions and adjust the x/y position accordingly as needed if (widthOverflow > 0) { - width = MIN_OVERLAY_SIZE; + width = minOverlaySize; if (dx > 0) { @@ -554,7 +554,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener } if (heightOverflow > 0) { - height = MIN_OVERLAY_SIZE; + height = minOverlaySize; if (dy > 0) { From 10d36ea36ad99021d8d5bed56e96ccb8a201b158 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Mon, 21 Sep 2020 20:16:52 -0400 Subject: [PATCH 12/40] discord: add random events regions --- .../client/plugins/discord/DiscordGameEventType.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 75304be4e3..d1a808868e 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 @@ -332,9 +332,11 @@ enum DiscordGameEventType REGION_DIGSITE("Digsite", DiscordAreaType.REGIONS, 13365), REGION_DRAGONTOOTH("Dragontooth Island", DiscordAreaType.REGIONS, 15159), REGION_DRAYNOR_MANOR("Draynor Manor", DiscordAreaType.REGIONS, 12340), + REGION_DRILL_SERGEANT("Drill Sergeant's Training Camp", DiscordAreaType.REGIONS, 12619), REGION_EAGLES_PEAK("Eagles' Peak", DiscordAreaType.REGIONS, 9270), REGION_EARTH_ALTAR("Earth Altar", DiscordAreaType.REGIONS, 10571), REGION_ENCHANTED_VALLEY("Enchanted Valley", DiscordAreaType.REGIONS, 12102), + REGION_EVIL_TWIN("Evil Twin Crane Room", DiscordAreaType.REGIONS, 7504), REGION_EXAM_CENTRE("Exam Centre", DiscordAreaType.REGIONS, 13364), REGION_FALADOR_FARM("Falador Farm", DiscordAreaType.REGIONS, 12083), REGION_FARMING_GUILD("Farming Guild", DiscordAreaType.REGIONS, 4922), @@ -346,8 +348,10 @@ enum DiscordGameEventType REGION_FISHING_PLATFORM("Fishing Platform", DiscordAreaType.REGIONS, 11059), REGION_FORSAKEN_TOWER("The Forsaken Tower", DiscordAreaType.REGIONS, 5435), REGION_FOSSIL_ISLAND("Fossil Island", DiscordAreaType.REGIONS, 14650, 14651, 14652, 14906, 14907, 14908, 15162, 15163, 15164), + REGION_FREAKY_FORESTER("Freaky Forester's Clearing", DiscordAreaType.REGIONS, 10314), REGION_FREMENNIK("Fremennik Province", DiscordAreaType.REGIONS, 10296, 10552, 10808, 10809, 10810, 10811, 11064), REGION_FREMENNIK_ISLES("Fremennik Isles", DiscordAreaType.REGIONS, 9276, 9532), + REGION_FROGLAND("Frogland", DiscordAreaType.REGIONS, 9802), REGION_GALVEK_SHIPWRECKS("Galvek Shipwrecks", DiscordAreaType.REGIONS, 6486, 6487, 6488, 6489, 6742, 6743, 6744, 6745), REGION_GORAKS_PLANE("Gorak's Plane", DiscordAreaType.REGIONS, 12115), REGION_GRAND_EXCHANGE("Grand Exchange", DiscordAreaType.REGIONS, 12598), @@ -374,17 +378,21 @@ enum DiscordGameEventType REGION_LUMBRIDGE_SWAMP("Lumbridge Swamp", DiscordAreaType.REGIONS, 12593, 12849), REGION_MAX_ISLAND("Max Island", DiscordAreaType.REGIONS, 11063), REGION_MCGRUBORS_WOOD("McGrubor's Wood", DiscordAreaType.REGIONS, 10550), + REGION_MIME_STAGE("Mime's Stage", DiscordAreaType.REGIONS, 8010), REGION_MIND_ALTAR("Mind Altar", DiscordAreaType.REGIONS, 11083), REGION_MISTHALIN("Misthalin", DiscordAreaType.REGIONS, 12594, 12595), REGION_MOLCH("Molch", DiscordAreaType.REGIONS, 5177), REGION_MOLCH_ISLAND("Molch Island", DiscordAreaType.REGIONS, 5432), REGION_MORYTANIA("Morytania", DiscordAreaType.REGIONS, 13619, 13620, 13621, 13622, 13876, 13877, 13879, 14133, 14134, 14389, 14390, 14391, 14645, 14647), REGION_MOUNT_QUIDAMORTEM("Mount Quidamortem", DiscordAreaType.REGIONS, 4662, 4663, 4918, 4919), + REGION_MR_MORDAUTS_CLASSROOM("Mr. Mordaut's Classroom", DiscordAreaType.REGIONS, 7502), REGION_MUDSKIPPER("Mudskipper Point", DiscordAreaType.REGIONS, 11824), + REGION_MYSTERIOUS_OLD_MAN_MAZE("Mysterious Old Man's Maze", DiscordAreaType.REGIONS, 11590, 11591, 11846, 11847), REGION_MYTHS_GUILD("Myths' Guild", DiscordAreaType.REGIONS, 9772), REGION_NATURE_ALTAR("Nature Altar", DiscordAreaType.REGIONS, 9547), REGION_NORTHERN_TUNDRAS("Northern Tundras", DiscordAreaType.REGIONS, 6204, 6205, 6717), REGION_OBSERVATORY("Observatory", DiscordAreaType.REGIONS, 9777), + REGION_ODD_ONE_OUT("Odd One Out", DiscordAreaType.REGIONS, 7754), REGION_OTTOS_GROTTO("Otto's Grotto", DiscordAreaType.REGIONS, 10038), REGION_OURANIA_HUNTER("Ourania Hunter Area", DiscordAreaType.REGIONS, 9778), REGION_PIRATES_COVE("Pirates' Cove", DiscordAreaType.REGIONS, 8763), @@ -397,6 +405,9 @@ enum DiscordGameEventType REGION_RANGING_GUILD("Ranging Guild", DiscordAreaType.REGIONS, 10549), REGION_RATCATCHERS_MANSION("Ratcatchers Mansion", DiscordAreaType.REGIONS, 11343), REGION_RUNE_ESSENCE_MINE("Rune Essence Mine", DiscordAreaType.REGIONS, 11595), + // The Beekeper, Pinball, and Gravedigger randoms share a region (7758), and although they are not technically ScapeRune, that name is most commonly + // associated with random events, so those three have been denoted ScapeRune to avoid leaving multiple random event regions without an assigned name. + REGION_SCAPERUNE("ScapeRune", DiscordAreaType.REGIONS, 10058, 7758, 8261), REGION_SHIP_YARD("Ship Yard", DiscordAreaType.REGIONS, 11823), REGION_SILVAREA("Silvarea", DiscordAreaType.REGIONS, 13366), REGION_SINCLAR_MANSION("Sinclair Mansion", DiscordAreaType.REGIONS, 10807), From 5a863f358f1221a537282269e3946d7d12cabe70 Mon Sep 17 00:00:00 2001 From: Matthew C <66925241+Matthew-nop@users.noreply.github.com> Date: Sat, 24 Oct 2020 09:56:35 +0900 Subject: [PATCH 13/40] discord: Fix action timeout, add in game time elapsed option (#12471) Co-authored-by: Matthew C <66925241+Matthew-nop@users.noreply.github.com> Co-authored-by: Tomas Slusny Co-authored-by: Jordan Atwood --- .../client/plugins/discord/DiscordConfig.java | 45 +++++++--- .../plugins/discord/DiscordGameEventType.java | 40 ++++++++- .../client/plugins/discord/DiscordPlugin.java | 16 ++-- .../client/plugins/discord/DiscordState.java | 88 +++++++++++++++---- .../plugins/discord/DiscordStateTest.java | 42 ++++++++- 5 files changed, 187 insertions(+), 44 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordConfig.java index 62b04c7e97..770fe49cde 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordConfig.java @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.discord; +import lombok.AllArgsConstructor; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; @@ -32,11 +33,38 @@ import net.runelite.client.config.Units; @ConfigGroup("discord") public interface DiscordConfig extends Config { + @AllArgsConstructor + enum ElapsedTimeType + { + TOTAL("Total elapsed time"), + ACTIVITY("Per activity"), + HIDDEN("Hide elapsed time"); + + private final String value; + + @Override + public String toString() + { + return value; + } + } + + @ConfigItem( + keyName = "elapsedTime", + name = "Elapsed Time", + description = "Configures elapsed time shown.", + position = 1 + ) + default ElapsedTimeType elapsedTimeType() + { + return ElapsedTimeType.ACTIVITY; + } + @ConfigItem( keyName = "actionTimeout", - name = "Action timeout", - description = "Configures after how long of not updating status will be reset (in minutes)", - position = 1 + name = "Activity timeout", + description = "Configures after how long of not updating activity will be reset (in minutes)", + position = 2 ) @Units(Units.MINUTES) default int actionTimeout() @@ -44,17 +72,6 @@ public interface DiscordConfig extends Config return 5; } - @ConfigItem( - keyName = "hideElapsedTime", - name = "Hide elapsed time", - description = "Configures if the elapsed time of your activity should be hidden.", - position = 2 - ) - default boolean hideElapsedTime() - { - return false; - } - @ConfigItem( keyName = "showSkillActivity", name = "Skilling", 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 d1a808868e..e298743344 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 @@ -42,8 +42,8 @@ import net.runelite.api.Varbits; enum DiscordGameEventType { - IN_GAME("In Game", -3), - IN_MENU("In Menu", -3), + IN_MENU("In Menu", -3, true, true, true, false, true), + IN_GAME("In Game", -3, true, false, false, false, true), PLAYING_DEADMAN("Playing Deadman Mode", -3), PLAYING_PVP("Playing in a PVP world", -3), TRAINING_ATTACK(Skill.ATTACK), @@ -462,9 +462,32 @@ enum DiscordGameEventType private String details; private int priority; + + /** + * Marks this event as root event, e.g event that should be used for total time tracking + */ + private boolean root; + + /** + * Determines if event should clear other clearable events when triggered + */ private boolean shouldClear; + + /** + * Determines if event should be processed when it timeouts based on action timeout + */ private boolean shouldTimeout; + /** + * Determines if event start time should be reset when processed + */ + private boolean shouldRestart; + + /** + * Determines if event should be cleared when processed + */ + private boolean shouldBeCleared = true; + @Nullable private DiscordAreaType discordAreaType; @@ -496,11 +519,20 @@ enum DiscordGameEventType this.shouldClear = true; } - DiscordGameEventType(String state, int priority) + DiscordGameEventType(String state, int priority, boolean shouldClear, boolean shouldTimeout, boolean shouldRestart, boolean shouldBeCleared, boolean root) { this.state = state; this.priority = priority; - this.shouldClear = true; + this.shouldClear = shouldClear; + this.shouldTimeout = shouldTimeout; + this.shouldRestart = shouldRestart; + this.shouldBeCleared = shouldBeCleared; + this.root = root; + } + + DiscordGameEventType(String state, int priority) + { + this(state, priority, true, false, false, true, false); } DiscordGameEventType(String areaName, DiscordAreaType areaType, Varbits varbits) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordPlugin.java index 3b86dea2fe..e2b0cb157b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordPlugin.java @@ -106,7 +106,7 @@ public class DiscordPlugin extends Plugin @Inject private OkHttpClient okHttpClient; - private Map skillExp = new HashMap<>(); + private final Map skillExp = new HashMap<>(); private NavigationButton discordButton; private boolean loginFlag; @@ -129,6 +129,7 @@ public class DiscordPlugin extends Plugin .build(); clientToolbar.addNavigation(discordButton); + resetState(); checkForGameStateUpdate(); checkForAreaUpdate(); @@ -144,7 +145,7 @@ public class DiscordPlugin extends Plugin protected void shutDown() throws Exception { clientToolbar.removeNavigation(discordButton); - discordState.reset(); + resetState(); partyService.changeParty(null); wsClient.unregisterMessage(DiscordUserInfo.class); } @@ -155,6 +156,7 @@ public class DiscordPlugin extends Plugin switch (event.getGameState()) { case LOGIN_SCREEN: + resetState(); checkForGameStateUpdate(); return; case LOGGING_IN: @@ -164,9 +166,9 @@ public class DiscordPlugin extends Plugin if (loginFlag) { loginFlag = false; + resetState(); checkForGameStateUpdate(); } - break; } @@ -178,6 +180,7 @@ public class DiscordPlugin extends Plugin { if (event.getGroup().equalsIgnoreCase("discord")) { + resetState(); checkForGameStateUpdate(); checkForAreaUpdate(); } @@ -362,10 +365,13 @@ public class DiscordPlugin extends Plugin discordState.refresh(); } + private void resetState() + { + discordState.reset(); + } + private void checkForGameStateUpdate() { - // Game state update does also full reset of discord state - discordState.reset(); discordState.triggerEvent(client.getGameState() == GameState.LOGGED_IN ? DiscordGameEventType.IN_GAME : DiscordGameEventType.IN_MENU); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordState.java b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordState.java index 0b49445f52..671107833e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordState.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordState.java @@ -32,6 +32,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.UUID; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; import javax.inject.Inject; import lombok.Data; import net.runelite.client.RuneLiteProperties; @@ -49,7 +51,7 @@ class DiscordState private static class EventWithTime { private final DiscordGameEventType type; - private final Instant start; + private Instant start; private Instant updated; } @@ -57,7 +59,7 @@ class DiscordState private final List events = new ArrayList<>(); private final DiscordService discordService; private final DiscordConfig config; - private PartyService party; + private final PartyService party; private DiscordPresence lastPresence; @Inject @@ -115,7 +117,7 @@ class DiscordState void triggerEvent(final DiscordGameEventType eventType) { final Optional foundEvent = events.stream().filter(e -> e.type == eventType).findFirst(); - EventWithTime event; + final EventWithTime event; if (foundEvent.isPresent()) { @@ -123,8 +125,8 @@ class DiscordState } else { - event = new EventWithTime(eventType, Instant.now()); - + event = new EventWithTime(eventType); + event.setStart(Instant.now()); events.add(event); } @@ -132,7 +134,12 @@ class DiscordState if (event.getType().isShouldClear()) { - events.removeIf(e -> e.getType() != eventType && e.getType().isShouldClear()); + events.removeIf(e -> e.getType() != eventType && e.getType().isShouldBeCleared()); + } + + if (event.getType().isShouldRestart()) + { + event.setStart(Instant.now()); } events.sort((a, b) -> ComparisonChain.start() @@ -140,7 +147,18 @@ class DiscordState .compare(b.getUpdated(), a.getUpdated()) .result()); - event = events.get(0); + updatePresenceWithLatestEvent(); + } + + private void updatePresenceWithLatestEvent() + { + if (events.isEmpty()) + { + reset(); + return; + } + + final EventWithTime event = events.get(0); String imageKey = null; String state = null; @@ -176,11 +194,35 @@ class DiscordState .state(MoreObjects.firstNonNull(state, "")) .details(MoreObjects.firstNonNull(details, "")) .largeImageText(RuneLiteProperties.getTitle() + " v" + versionShortHand) - .startTimestamp(config.hideElapsedTime() ? null : event.getStart()) .smallImageKey(imageKey) .partyMax(PARTY_MAX) .partySize(party.getMembers().size()); + final Instant startTime; + switch (config.elapsedTimeType()) + { + case HIDDEN: + startTime = null; + break; + case TOTAL: + // We are tracking total time spent instead of per activity time so try to find + // root event as this indicates start of tracking and find last updated one + // to determine correct state we are in + startTime = events.stream() + .filter(e -> e.getType().isRoot()) + .sorted((a, b) -> b.getUpdated().compareTo(a.getUpdated())) + .map(EventWithTime::getStart) + .findFirst() + .orElse(event.getStart()); + break; + case ACTIVITY: + default: + startTime = event.getStart(); + break; + } + + presenceBuilder.startTimestamp(startTime); + if (!party.isInParty() || party.isPartyOwner()) { presenceBuilder.partyId(partyId.toString()); @@ -209,19 +251,29 @@ class DiscordState final Duration actionTimeout = Duration.ofMinutes(config.actionTimeout()); final Instant now = Instant.now(); - final EventWithTime eventWithTime = events.get(0); + final AtomicBoolean updatedAny = new AtomicBoolean(); - events.removeIf(event -> event.getType().isShouldTimeout() && now.isAfter(event.getUpdated().plus(actionTimeout))); + final boolean removedAny = events.removeAll(events.stream() + // Find only events that should time out + .filter(event -> event.getType().isShouldTimeout() && now.isAfter(event.getUpdated().plus(actionTimeout))) + // Reset start times on timed events that should restart + .peek(event -> + { + if (event.getType().isShouldRestart()) + { + event.setStart(null); + updatedAny.set(true); + } + }) + // Now filter out events that should restart as we do not want to remove them + .filter(event -> !event.getType().isShouldRestart()) + .filter(event -> event.getType().isShouldBeCleared()) + .collect(Collectors.toList()) + ); - assert DiscordGameEventType.IN_MENU.getState() != null; - if (DiscordGameEventType.IN_MENU.getState().equals(eventWithTime.getType().getState()) && now.isAfter(eventWithTime.getStart().plus(actionTimeout))) + if (removedAny || updatedAny.get()) { - final DiscordPresence presence = lastPresence - .toBuilder() - .startTimestamp(null) - .build(); - lastPresence = presence; - discordService.updatePresence(presence); + updatePresenceWithLatestEvent(); } } } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/discord/DiscordStateTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/discord/DiscordStateTest.java index 81c6e36dc8..8ce42350e6 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/discord/DiscordStateTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/discord/DiscordStateTest.java @@ -35,6 +35,7 @@ import net.runelite.api.Client; import net.runelite.client.discord.DiscordPresence; import net.runelite.client.discord.DiscordService; import net.runelite.client.ws.PartyService; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import org.junit.Before; import org.junit.Test; @@ -77,10 +78,10 @@ public class DiscordStateTest } @Test - public void testStatusTimeout() + public void testStatusReset() { - when(discordConfig.actionTimeout()).thenReturn(0); - when(discordConfig.hideElapsedTime()).thenReturn(false); + when(discordConfig.actionTimeout()).thenReturn(-1); + when(discordConfig.elapsedTimeType()).thenReturn(DiscordConfig.ElapsedTimeType.ACTIVITY); discordState.triggerEvent(DiscordGameEventType.IN_MENU); verify(discordService).updatePresence(any(DiscordPresence.class)); @@ -91,4 +92,39 @@ public class DiscordStateTest List captured = captor.getAllValues(); assertNull(captured.get(captured.size() - 1).getEndTimestamp()); } + + @Test + public void testStatusTimeout() + { + when(discordConfig.actionTimeout()).thenReturn(-1); + when(discordConfig.elapsedTimeType()).thenReturn(DiscordConfig.ElapsedTimeType.ACTIVITY); + + discordState.triggerEvent(DiscordGameEventType.TRAINING_AGILITY); + verify(discordService).updatePresence(any(DiscordPresence.class)); + + discordState.checkForTimeout(); + verify(discordService, times(1)).clearPresence(); + } + + @Test + public void testAreaChange() + { + when(discordConfig.elapsedTimeType()).thenReturn(DiscordConfig.ElapsedTimeType.TOTAL); + + // Start with state of IN_GAME + ArgumentCaptor captor = ArgumentCaptor.forClass(DiscordPresence.class); + discordState.triggerEvent(DiscordGameEventType.IN_GAME); + verify(discordService, times(1)).updatePresence(captor.capture()); + assertEquals(DiscordGameEventType.IN_GAME.getState(), captor.getValue().getState()); + + // IN_GAME -> CITY + discordState.triggerEvent(DiscordGameEventType.CITY_VARROCK); + verify(discordService, times(2)).updatePresence(captor.capture()); + assertEquals(DiscordGameEventType.CITY_VARROCK.getState(), captor.getValue().getState()); + + // CITY -> IN_GAME + discordState.triggerEvent(DiscordGameEventType.IN_GAME); + verify(discordService, times(3)).updatePresence(captor.capture()); + assertEquals(DiscordGameEventType.IN_GAME.getState(), captor.getValue().getState()); + } } From f970e61a5e8cfb7983547264fef56f974e55040b Mon Sep 17 00:00:00 2001 From: Malfuryent Date: Sat, 2 May 2020 20:30:20 -0700 Subject: [PATCH 14/40] statusbars: Display while in fixed viewport bank Co-authored-by: Jordan --- .../client/plugins/statusbars/StatusBarsOverlay.java | 8 +------- .../net/runelite/client/plugins/statusbars/Viewport.java | 2 ++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java index 529fa250a4..aea65d2872 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java @@ -101,12 +101,6 @@ class StatusBarsOverlay extends Overlay @Override public Dimension render(Graphics2D g) { - final Widget widgetBankTitleBar = client.getWidget(WidgetInfo.BANK_TITLE_BAR); - if (widgetBankTitleBar != null && !widgetBankTitleBar.isHidden()) - { - return null; - } - Viewport curViewport = null; Widget curWidget = null; @@ -121,7 +115,7 @@ class StatusBarsOverlay extends Overlay } } - if (curViewport == null || curWidget.isHidden()) + if (curViewport == null) { return null; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Viewport.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Viewport.java index 6161192c1d..8b32eb6723 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Viewport.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Viewport.java @@ -38,6 +38,8 @@ enum Viewport RESIZED_BOTTOM(WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE, WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_INTERFACE_CONTAINER, new Point(61, 8), new Point(35, -12)), FIXED(WidgetInfo.FIXED_VIEWPORT, WidgetInfo.FIXED_VIEWPORT_INTERFACE_CONTAINER, + new Point(20, -4), new Point(0, -4)), + FIXED_BANK(WidgetInfo.BANK_CONTAINER, WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER, new Point(20, -4), new Point(0, -4)); private WidgetInfo container; From 842749fe1566f6ba06f33b5f8008d0822ee8064a Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Mon, 4 May 2020 11:48:19 -0700 Subject: [PATCH 15/40] Move heart sprite recolors to public package --- .../client/game/AlternateSprites.java | 32 ++++++++++++++++++ .../client/plugins/poison/PoisonPlugin.java | 7 ++-- .../{plugins/poison => game}/1067-DISEASE.png | Bin .../{plugins/poison => game}/1067-POISON.png | Bin .../{plugins/poison => game}/1067-VENOM.png | Bin 5 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/game/AlternateSprites.java rename runelite-client/src/main/resources/net/runelite/client/{plugins/poison => game}/1067-DISEASE.png (100%) rename runelite-client/src/main/resources/net/runelite/client/{plugins/poison => game}/1067-POISON.png (100%) rename runelite-client/src/main/resources/net/runelite/client/{plugins/poison => game}/1067-VENOM.png (100%) diff --git a/runelite-client/src/main/java/net/runelite/client/game/AlternateSprites.java b/runelite-client/src/main/java/net/runelite/client/game/AlternateSprites.java new file mode 100644 index 0000000000..7455deed41 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/game/AlternateSprites.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 Jordan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.game; + +public class AlternateSprites +{ + public static final String DISEASE_HEART = "1067-DISEASE.png"; + public static final String POISON_HEART = "1067-POISON.png"; + public static final String VENOM_HEART = "1067-VENOM.png"; +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/poison/PoisonPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/poison/PoisonPlugin.java index cc53e2e9b9..22386a90ba 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/poison/PoisonPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/poison/PoisonPlugin.java @@ -44,6 +44,7 @@ import net.runelite.api.events.VarbitChanged; import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.game.AlternateSprites; import net.runelite.client.game.SpriteManager; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; @@ -70,9 +71,9 @@ public class PoisonPlugin extends Plugin static { - HEART_DISEASE = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(PoisonPlugin.class, "1067-DISEASE.png"), 26, 26); - HEART_POISON = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(PoisonPlugin.class, "1067-POISON.png"), 26, 26); - HEART_VENOM = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(PoisonPlugin.class, "1067-VENOM.png"), 26, 26); + HEART_DISEASE = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(AlternateSprites.class, AlternateSprites.DISEASE_HEART), 26, 26); + HEART_POISON = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(AlternateSprites.class, AlternateSprites.POISON_HEART), 26, 26); + HEART_VENOM = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(AlternateSprites.class, AlternateSprites.VENOM_HEART), 26, 26); } @Inject diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-DISEASE.png b/runelite-client/src/main/resources/net/runelite/client/game/1067-DISEASE.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-DISEASE.png rename to runelite-client/src/main/resources/net/runelite/client/game/1067-DISEASE.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-POISON.png b/runelite-client/src/main/resources/net/runelite/client/game/1067-POISON.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-POISON.png rename to runelite-client/src/main/resources/net/runelite/client/game/1067-POISON.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-VENOM.png b/runelite-client/src/main/resources/net/runelite/client/game/1067-VENOM.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-VENOM.png rename to runelite-client/src/main/resources/net/runelite/client/game/1067-VENOM.png From 1165780f427e1d9f86f2d658b050bf04a7ae237e Mon Sep 17 00:00:00 2001 From: Malfuryent Date: Sat, 2 May 2020 21:16:46 -0700 Subject: [PATCH 16/40] statubars: Add left/right customization options Co-authored-by: Jordan --- .../plugins/statusbars/BarRenderer.java | 172 +++++++++ .../plugins/statusbars/Config/BarMode.java | 33 ++ .../plugins/statusbars/StatusBarsConfig.java | 33 +- .../plugins/statusbars/StatusBarsOverlay.java | 333 ++++++++---------- 4 files changed, 379 insertions(+), 192 deletions(-) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/statusbars/BarRenderer.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Config/BarMode.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/BarRenderer.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/BarRenderer.java new file mode 100644 index 0000000000..84742e2f63 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/BarRenderer.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2019, Jos + * Copyright (c) 2019, Rheon + * 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 HOLDER 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.statusbars; + +import lombok.RequiredArgsConstructor; +import net.runelite.client.ui.FontManager; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Image; +import java.util.function.Supplier; + +@RequiredArgsConstructor +class BarRenderer +{ + private static final Color BACKGROUND = new Color(0, 0, 0, 150); + private static final Color OVERHEAL_COLOR = new Color(216, 255, 139, 150); + private static final int OVERHEAL_OFFSET = 2; + private static final int HEAL_OFFSET = 3; + private static final int ICON_AND_COUNTER_OFFSET_X = -4; + private static final int ICON_AND_COUNTER_OFFSET_Y = 25; + private static final int SKILL_ICON_HEIGHT = 35; + private static final int COUNTER_ICON_HEIGHT = 18; + private static final int OFFSET = 2; + private static final int WIDTH = 20; + private static final int PADDING = 1; + private final Supplier maxValueSupplier; + private final Supplier currentValueSupplier; + private final Supplier healSupplier; + private final Supplier colorSupplier; + private final Supplier healColorSupplier; + private final Supplier iconSupplier; + private int maxValue; + private int currentValue; + + private void refreshSkills() + { + maxValue = maxValueSupplier.get(); + currentValue = currentValueSupplier.get(); + } + + /** + * Renders a status bar along with its restoration bar(s), icons and counters as appropriate + * @param config Plugin configuration which dictates certain settings, such as whether to show restoration bars and + * whether or not to draw icons. + * @param graphics Graphics. + * @param x The location on the client where it will draw the bar on the x axis starting on the left side. + * @param y The location on the client where it will draw the bar on the y axis starting on the bottom side. + * @param height The height of the bar. + */ + void renderBar(StatusBarsConfig config, Graphics2D graphics, int x, int y, int height) + { + final int filledHeight = getBarHeight(maxValue, currentValue, height); + final Color fill = colorSupplier.get(); + + refreshSkills(); + + graphics.setColor(BACKGROUND); + graphics.drawRect(x, y, WIDTH - PADDING, height - PADDING); + graphics.fillRect(x, y, WIDTH, height); + + graphics.setColor(fill); + graphics.fillRect(x + PADDING, + y + PADDING + (height - filledHeight), + WIDTH - PADDING * OFFSET, + filledHeight - PADDING * OFFSET); + + if (config.enableRestorationBars()) + { + renderRestore(graphics, x, y, height); + } + + if (config.enableSkillIcon() || config.enableCounter()) + { + renderIconsAndCounters(config, graphics, x, y); + } + } + + private void renderIconsAndCounters(StatusBarsConfig config, Graphics2D graphics, int x, int y) + { + graphics.setFont(FontManager.getRunescapeSmallFont()); + graphics.setColor(Color.WHITE); + String counterText = Integer.toString(currentValue); + final int widthOfCounter = graphics.getFontMetrics().stringWidth(counterText); + int centerText = (WIDTH - PADDING) / 2 - (widthOfCounter / 2); + final Image icon = iconSupplier.get(); + + if (config.enableCounter()) + { + if (config.enableSkillIcon()) + { + graphics.drawImage(icon, x + ICON_AND_COUNTER_OFFSET_X + PADDING, y + ICON_AND_COUNTER_OFFSET_Y - icon.getWidth(null), null); + graphics.drawString(counterText, x + centerText + PADDING, y + SKILL_ICON_HEIGHT); + } + else + { + graphics.drawString(counterText, x + centerText + PADDING, y + COUNTER_ICON_HEIGHT); + } + } + else if (config.enableSkillIcon()) + { + graphics.drawImage(icon, x + ICON_AND_COUNTER_OFFSET_X + PADDING, y + ICON_AND_COUNTER_OFFSET_Y - icon.getWidth(null), null); + } + } + + private void renderRestore(Graphics2D graphics, int x, int y, int height) + { + final Color color = healColorSupplier.get(); + final int heal = healSupplier.get(); + + if (heal <= 0) + { + return; + } + + final int filledCurrentHeight = getBarHeight(maxValue, currentValue, height); + int filledHeight = getBarHeight(maxValue, heal, height); + graphics.setColor(color); + + if (filledHeight + filledCurrentHeight > height) + { + final int overHeal = filledHeight + filledCurrentHeight - height; + filledHeight = filledHeight - overHeal + OVERHEAL_OFFSET; + graphics.setColor(OVERHEAL_COLOR); + graphics.fillRect(x + PADDING, + y - filledCurrentHeight + (height - filledHeight) + HEAL_OFFSET, + WIDTH - PADDING * OVERHEAL_OFFSET, + filledHeight - PADDING * OVERHEAL_OFFSET); + } + else + { + graphics.fillRect(x + PADDING, + y - OVERHEAL_OFFSET - filledCurrentHeight + (height - filledHeight) + HEAL_OFFSET, + WIDTH - PADDING * OVERHEAL_OFFSET, + filledHeight + OVERHEAL_OFFSET - PADDING * OVERHEAL_OFFSET); + } + } + + private static int getBarHeight(int base, int current, int size) + { + final double ratio = (double) current / base; + + if (ratio >= 1) + { + return size; + } + + return (int) Math.round(ratio * size); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Config/BarMode.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Config/BarMode.java new file mode 100644 index 0000000000..16e41231eb --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Config/BarMode.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019, Jos + * 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.statusbars.Config; + +public enum BarMode +{ + DISABLED, + HITPOINTS, + PRAYER, + ; +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsConfig.java index c3a05b05db..9f9e136d06 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Jos + * Copyright (c) 2019, Jos * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,14 +27,15 @@ package net.runelite.client.plugins.statusbars; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; +import net.runelite.client.plugins.statusbars.Config.BarMode; @ConfigGroup("statusbars") public interface StatusBarsConfig extends Config { @ConfigItem( keyName = "enableCounter", - name = "Show hitpoints & prayer counter", - description = "Shows current amount of hitpoints & prayer on the status bars" + name = "Show counters", + description = "Shows current value of the status on the bar" ) default boolean enableCounter() { @@ -43,7 +44,7 @@ public interface StatusBarsConfig extends Config @ConfigItem( keyName = "enableSkillIcon", - name = "Show hitpoints & prayer icons", + name = "Show icons", description = "Adds skill icons at the top of the bars." ) default boolean enableSkillIcon() @@ -53,11 +54,31 @@ public interface StatusBarsConfig extends Config @ConfigItem( keyName = "enableRestorationBars", - name = "Show amount of hitpoints and prayer restored", - description = "Visually shows how much a food or prayer will heal/restore you on the bars." + name = "Show restores", + description = "Visually shows how much will be restored to your status bar." ) default boolean enableRestorationBars() { return true; } + + @ConfigItem( + keyName = "leftBarMode", + name = "Left Status Bar", + description = "Configures the left status bar" + ) + default BarMode leftBarMode() + { + return BarMode.HITPOINTS; + } + + @ConfigItem( + keyName = "rightBarMode", + name = "Right Status Bar", + description = "Configures the right status bar" + ) + default BarMode rightBarMode() + { + return BarMode.PRAYER; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java index aea65d2872..890900efe1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2018, Jos + * Copyright (c) 2019, Jos + * Copyright (c) 2019, Rheon * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,75 +28,148 @@ package net.runelite.client.plugins.statusbars; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; -import java.awt.image.BufferedImage; +import java.awt.Image; +import java.util.EnumMap; +import java.util.Map; +import java.util.Objects; import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.api.MenuEntry; import net.runelite.api.Point; +import net.runelite.api.Prayer; import net.runelite.api.Skill; +import net.runelite.api.SpriteID; import net.runelite.api.VarPlayer; -import net.runelite.api.Varbits; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; +import net.runelite.client.game.AlternateSprites; import net.runelite.client.game.SkillIconManager; +import net.runelite.client.game.SpriteManager; import net.runelite.client.plugins.itemstats.Effect; import net.runelite.client.plugins.itemstats.ItemStatChangesService; import net.runelite.client.plugins.itemstats.StatChange; -import net.runelite.client.plugins.itemstats.StatsChanges; -import net.runelite.client.ui.FontManager; +import net.runelite.client.plugins.statusbars.Config.BarMode; 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.components.TextComponent; import net.runelite.client.util.ImageUtil; class StatusBarsOverlay extends Overlay { private static final Color PRAYER_COLOR = new Color(50, 200, 200, 175); - private static final Color QUICK_PRAYER_COLOR = new Color(57, 255, 186, 225); - private static final Color BACKGROUND = new Color(0, 0, 0, 150); + private static final Color ACTIVE_PRAYER_COLOR = new Color(57, 255, 186, 225); private static final Color HEALTH_COLOR = new Color(225, 35, 0, 125); private static final Color POISONED_COLOR = new Color(0, 145, 0, 150); private static final Color VENOMED_COLOR = new Color(0, 65, 0, 150); private static final Color HEAL_COLOR = new Color(255, 112, 6, 150); private static final Color PRAYER_HEAL_COLOR = new Color(57, 255, 186, 75); - private static final Color OVERHEAL_COLOR = new Color(216, 255, 139, 150); + private static final Color DISEASE_COLOR = new Color(255, 193, 75, 181); private static final int HEIGHT = 252; private static final int RESIZED_BOTTOM_HEIGHT = 272; - private static final int WIDTH = 20; - private static final int PADDING = 1; private static final int IMAGE_SIZE = 17; - private static final int HEALTH_LOCATION_X = 0; - private static final int PRAYER_LOCATION_X = 1; + private static final int ICON_DIMENSIONS = 26; private static final int RESIZED_BOTTOM_OFFSET_Y = 12; private static final int RESIZED_BOTTOM_OFFSET_X = 10; - private static final int OVERHEAL_OFFSET = 2; - private static final int HEAL_OFFSET = 3; - private static final int ICON_AND_COUNTER_OFFSET_X = 1; - private static final int ICON_AND_COUNTER_OFFSET_Y = 21; - private static final int SKILL_ICON_HEIGHT = 35; - private static final int COUNTER_ICON_HEIGHT = 18; - private static final int OFFSET = 2; private final Client client; private final StatusBarsConfig config; - private final SkillIconManager skillIconManager; - private final TextComponent textComponent = new TextComponent(); private final ItemStatChangesService itemStatService; + private final SpriteManager spriteManager; - private final BufferedImage prayerImage; + private final Image prayerIcon; + private Image heartIcon; + private Image heartDisease; + private Image heartPoison; + private Image heartVenom; + private final Map barRenderers = new EnumMap<>(BarMode.class); @Inject - private StatusBarsOverlay(Client client, StatusBarsConfig config, SkillIconManager skillIconManager, ItemStatChangesService itemstatservice) + private StatusBarsOverlay(Client client, StatusBarsConfig config, SkillIconManager skillIconManager, ItemStatChangesService itemstatservice, SpriteManager spriteManager) { setPosition(OverlayPosition.DYNAMIC); setLayer(OverlayLayer.ABOVE_WIDGETS); this.client = client; this.config = config; - this.skillIconManager = skillIconManager; this.itemStatService = itemstatservice; + this.spriteManager = spriteManager; - prayerImage = ImageUtil.resizeImage(skillIconManager.getSkillImage(Skill.PRAYER, true), IMAGE_SIZE, IMAGE_SIZE); + prayerIcon = ImageUtil.resizeCanvas(ImageUtil.resizeImage(skillIconManager.getSkillImage(Skill.PRAYER, true), IMAGE_SIZE, IMAGE_SIZE), ICON_DIMENSIONS, ICON_DIMENSIONS); + initRenderers(); + } + + private void initRenderers() + { + barRenderers.put(BarMode.DISABLED, null); + barRenderers.put(BarMode.HITPOINTS, new BarRenderer( + () -> client.getRealSkillLevel(Skill.HITPOINTS), + () -> client.getBoostedSkillLevel(Skill.HITPOINTS), + () -> getRestoreValue(Skill.HITPOINTS.getName()), + () -> + { + final int poisonState = client.getVar(VarPlayer.IS_POISONED); + + if (poisonState >= 1000000) + { + return VENOMED_COLOR; + } + + if (poisonState > 0) + { + return POISONED_COLOR; + } + + if (client.getVar(VarPlayer.DISEASE_VALUE) > 0) + { + return DISEASE_COLOR; + } + + return HEALTH_COLOR; + }, + () -> HEAL_COLOR, + () -> + { + final int poisonState = client.getVar(VarPlayer.IS_POISONED); + + if (poisonState > 0 && poisonState < 50) + { + return heartPoison; + } + + if (poisonState >= 1000000) + { + return heartVenom; + } + + if (client.getVar(VarPlayer.DISEASE_VALUE) > 0) + { + return heartDisease; + } + + return heartIcon; + } + )); + barRenderers.put(BarMode.PRAYER, new BarRenderer( + () -> client.getRealSkillLevel(Skill.PRAYER), + () -> client.getBoostedSkillLevel(Skill.PRAYER), + () -> getRestoreValue(Skill.PRAYER.getName()), + () -> + { + Color prayerColor = PRAYER_COLOR; + + for (Prayer pray : Prayer.values()) + { + if (client.isPrayerActive(pray)) + { + prayerColor = ACTIVE_PRAYER_COLOR; + break; + } + } + + return prayerColor; + }, + () -> PRAYER_HEAL_COLOR, + () -> prayerIcon + )); } @Override @@ -123,194 +197,81 @@ class StatusBarsOverlay extends Overlay final Point offsetLeft = curViewport.getOffsetLeft(); final Point offsetRight = curViewport.getOffsetRight(); final Point location = curWidget.getCanvasLocation(); - final int height, offsetHealthX, offsetHealthY, offsetPrayerX, offsetPrayerY; + final int height, offsetLeftBarX, offsetLeftBarY, offsetRightBarX, offsetRightBarY; if (curViewport == Viewport.RESIZED_BOTTOM) { height = RESIZED_BOTTOM_HEIGHT; - offsetHealthX = (location.getX() + RESIZED_BOTTOM_OFFSET_X - offsetLeft.getX()); - offsetHealthY = (location.getY() - RESIZED_BOTTOM_OFFSET_Y - offsetRight.getY()); - offsetPrayerX = (location.getX() + RESIZED_BOTTOM_OFFSET_X - offsetRight.getX()); - offsetPrayerY = (location.getY() - RESIZED_BOTTOM_OFFSET_Y - offsetRight.getY()); + offsetLeftBarX = (location.getX() + RESIZED_BOTTOM_OFFSET_X - offsetLeft.getX()); + offsetLeftBarY = (location.getY() - RESIZED_BOTTOM_OFFSET_Y - offsetRight.getY()); + offsetRightBarX = (location.getX() + RESIZED_BOTTOM_OFFSET_X - offsetRight.getX()); + offsetRightBarY = (location.getY() - RESIZED_BOTTOM_OFFSET_Y - offsetRight.getY()); } else { height = HEIGHT; - offsetHealthX = (location.getX() - offsetLeft.getX()); - offsetHealthY = (location.getY() - offsetLeft.getY()); - offsetPrayerX = (location.getX() - offsetRight.getX()) + curWidget.getWidth(); - offsetPrayerY = (location.getY() - offsetRight.getY()); + offsetLeftBarX = (location.getX() - offsetLeft.getX()); + offsetLeftBarY = (location.getY() - offsetLeft.getY()); + offsetRightBarX = (location.getX() - offsetRight.getX()) + curWidget.getWidth(); + offsetRightBarY = (location.getY() - offsetRight.getY()); } - final int poisonState = client.getVar(VarPlayer.IS_POISONED); - final Color healthBar; + buildIcons(); - if (poisonState >= 1000000) + BarRenderer left = barRenderers.get(config.leftBarMode()); + BarRenderer right = barRenderers.get(config.rightBarMode()); + + if (left != null) { - healthBar = VENOMED_COLOR; - } - else if (poisonState > 0) - { - healthBar = POISONED_COLOR; - } - else - { - healthBar = HEALTH_COLOR; + left.renderBar(config, g, offsetLeftBarX, offsetLeftBarY, height); } - final int maxHealth = client.getRealSkillLevel(Skill.HITPOINTS); - final int maxPrayer = client.getRealSkillLevel(Skill.PRAYER); - final int currentHealth = client.getBoostedSkillLevel(Skill.HITPOINTS); - final int currentPrayer = client.getBoostedSkillLevel(Skill.PRAYER); - final int quickPrayerState = client.getVar(Varbits.QUICK_PRAYER); - final Color prayerBar = quickPrayerState == 1 ? QUICK_PRAYER_COLOR : PRAYER_COLOR; - - renderBar(g, offsetHealthX, offsetHealthY, - maxHealth, currentHealth, height, healthBar); - - renderBar(g, offsetPrayerX, offsetPrayerY, - maxPrayer, currentPrayer, height, prayerBar); - - if (config.enableRestorationBars()) + if (right != null) { - final MenuEntry[] menu = client.getMenuEntries(); - final int menuSize = menu.length; - final MenuEntry entry = menuSize > 0 ? menu[menuSize - 1] : null; - int prayerHealValue = 0; - int foodHealValue = 0; - if (entry != null && entry.getParam1() == WidgetInfo.INVENTORY.getId()) - { - final Effect change = itemStatService.getItemStatChanges(entry.getIdentifier()); - - if (change != null) - { - final StatsChanges statsChanges = change.calculate(client); - - for (final StatChange c : statsChanges.getStatChanges()) - { - final int theoreticalBoost = c.getTheoretical(); - - if (c.getStat().getName().equals(Skill.HITPOINTS.getName())) - { - foodHealValue = theoreticalBoost; - } - - if (c.getStat().getName().equals(Skill.PRAYER.getName())) - { - prayerHealValue = theoreticalBoost; - } - - if (foodHealValue != 0 && prayerHealValue != 0) - { - break; - } - } - } - } - - renderHealingBar(g, offsetHealthX, offsetHealthY, - maxHealth, currentHealth, height, - foodHealValue, HEAL_COLOR); - - renderHealingBar(g, offsetPrayerX, offsetPrayerY, - maxPrayer, currentPrayer, height, - prayerHealValue, PRAYER_HEAL_COLOR); - } - - if (config.enableSkillIcon() || config.enableCounter()) - { - final BufferedImage healthImage = skillIconManager.getSkillImage(Skill.HITPOINTS, true); - final int counterHealth = client.getBoostedSkillLevel(Skill.HITPOINTS); - final int counterPrayer = client.getBoostedSkillLevel(Skill.PRAYER); - final String counterHealthText = Integer.toString(counterHealth); - final String counterPrayerText = Integer.toString(counterPrayer); - - renderIconsAndCounters(g, offsetPrayerX, offsetPrayerY, prayerImage, counterPrayerText, PRAYER_LOCATION_X); - renderIconsAndCounters(g, offsetHealthX, offsetHealthY, healthImage, counterHealthText, HEALTH_LOCATION_X); + right.renderBar(config, g, offsetRightBarX, offsetRightBarY, height); } return null; } - private static void renderBar(Graphics2D graphics, int x, int y, int max, int current, int height, Color filled) + private int getRestoreValue(String skill) { - graphics.setColor(BACKGROUND); - graphics.drawRect(x, y, WIDTH - PADDING, height - PADDING); - graphics.fillRect(x, y, WIDTH, height); + final MenuEntry[] menu = client.getMenuEntries(); + final int menuSize = menu.length; + final MenuEntry entry = menuSize > 0 ? menu[menuSize - 1] : null; + int restoreValue = 0; - final int filledHeight = getBarHeight(max, current, height); - graphics.setColor(filled); - graphics.fillRect(x + PADDING, - y + PADDING + (height - filledHeight), - WIDTH - PADDING * OFFSET, - filledHeight - PADDING * OFFSET); + if (entry != null && entry.getParam1() == WidgetInfo.INVENTORY.getId()) + { + final Effect change = itemStatService.getItemStatChanges(entry.getIdentifier()); + + if (change != null) + { + for (final StatChange c : change.calculate(client).getStatChanges()) + { + final int value = c.getTheoretical(); + + if (value != 0 && c.getStat().getName().equals(skill)) + { + restoreValue = value; + } + } + } + } + + return restoreValue; } - private static void renderHealingBar(Graphics2D graphics, int x, int y, int max, int current, int height, int heal, Color color) + private void buildIcons() { - if (heal <= 0) + if (heartIcon != null && heartDisease != null && heartPoison != null && heartVenom != null) { return; } - final int filledCurrentHeight = getBarHeight(max, current, height); - int filledHeight = getBarHeight(max, heal, height); - graphics.setColor(color); - - if (filledHeight + filledCurrentHeight > height) - { - final int overHeal = filledHeight + filledCurrentHeight - height; - filledHeight = filledHeight - overHeal + OVERHEAL_OFFSET; - graphics.setColor(OVERHEAL_COLOR); - graphics.fillRect(x + PADDING, - y - filledCurrentHeight + (height - filledHeight) + HEAL_OFFSET, - WIDTH - PADDING * OVERHEAL_OFFSET, - filledHeight - PADDING * OVERHEAL_OFFSET); - } - else - { - graphics.fillRect(x + PADDING, - y - OVERHEAL_OFFSET - filledCurrentHeight + (height - filledHeight) + HEAL_OFFSET, - WIDTH - PADDING * OVERHEAL_OFFSET, - filledHeight + OVERHEAL_OFFSET - PADDING * OVERHEAL_OFFSET); - } - } - - private static int getBarHeight(int base, int current, int size) - { - final double ratio = (double) current / base; - - if (ratio >= 1) - { - return size; - } - - return (int) Math.round(ratio * size); - } - - private void renderIconsAndCounters(Graphics2D graphics, int x, int y, BufferedImage image, String counterText, int counterPadding) - { - final int widthOfCounter = graphics.getFontMetrics().stringWidth(counterText); - final int centerText = (WIDTH - PADDING) / 2 - (widthOfCounter / 2); - - if (config.enableCounter()) - { - graphics.setFont(FontManager.getRunescapeSmallFont()); - textComponent.setColor(Color.WHITE); - textComponent.setText(counterText); - textComponent.setPosition(new java.awt.Point(x + centerText + counterPadding, y + COUNTER_ICON_HEIGHT)); - } - else - { - textComponent.setText(""); - } - - if (config.enableSkillIcon()) - { - graphics.drawImage(image, x + ICON_AND_COUNTER_OFFSET_X + PADDING, y + ICON_AND_COUNTER_OFFSET_Y - image.getWidth(null), null); - textComponent.setPosition(new java.awt.Point(x + centerText + counterPadding, y + SKILL_ICON_HEIGHT)); - } - - textComponent.render(graphics); + heartIcon = ImageUtil.resizeCanvas(Objects.requireNonNull(spriteManager.getSprite(SpriteID.MINIMAP_ORB_HITPOINTS_ICON, 0)), ICON_DIMENSIONS, ICON_DIMENSIONS); + heartDisease = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(AlternateSprites.class, AlternateSprites.DISEASE_HEART), ICON_DIMENSIONS, ICON_DIMENSIONS); + heartPoison = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(AlternateSprites.class, AlternateSprites.POISON_HEART), ICON_DIMENSIONS, ICON_DIMENSIONS); + heartVenom = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(AlternateSprites.class, AlternateSprites.VENOM_HEART), ICON_DIMENSIONS, ICON_DIMENSIONS); } } From 643d3a452391ae6c325f84c2228dea2805fc8e91 Mon Sep 17 00:00:00 2001 From: Malfuryent Date: Mon, 4 May 2020 12:19:11 -0700 Subject: [PATCH 17/40] statusbars: Add special & run energy bar types Co-authored-by: Jordan --- .../main/java/net/runelite/api/SpriteID.java | 1 + .../plugins/statusbars/Config/BarMode.java | 2 + .../plugins/statusbars/StatusBarsOverlay.java | 39 ++++++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/runelite-api/src/main/java/net/runelite/api/SpriteID.java b/runelite-api/src/main/java/net/runelite/api/SpriteID.java index 3dc86dacf0..995715076c 100644 --- a/runelite-api/src/main/java/net/runelite/api/SpriteID.java +++ b/runelite-api/src/main/java/net/runelite/api/SpriteID.java @@ -1042,6 +1042,7 @@ public final class SpriteID public static final int MINIMAP_ORB_PRAYER_ACTIVATED = 1066; public static final int MINIMAP_ORB_HITPOINTS_ICON = 1067; public static final int MINIMAP_ORB_PRAYER_ICON = 1068; + public static final int MINIMAP_ORB_WALK_ICON = 1069; public static final int MINIMAP_ORB_RUN_ICON = 1070; public static final int MINIMAP_ORB_RUN_ICON_ACTIVATED = 1070; public static final int MINIMAP_ORB_FRAME = 1071; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Config/BarMode.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Config/BarMode.java index 16e41231eb..9cf32e0b47 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Config/BarMode.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/Config/BarMode.java @@ -29,5 +29,7 @@ public enum BarMode DISABLED, HITPOINTS, PRAYER, + RUN_ENERGY, + SPECIAL_ATTACK, ; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java index 890900efe1..b61a057f98 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/statusbars/StatusBarsOverlay.java @@ -39,6 +39,7 @@ import net.runelite.api.Point; import net.runelite.api.Prayer; import net.runelite.api.Skill; import net.runelite.api.SpriteID; +import net.runelite.api.Varbits; import net.runelite.api.VarPlayer; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; @@ -63,6 +64,10 @@ class StatusBarsOverlay extends Overlay private static final Color VENOMED_COLOR = new Color(0, 65, 0, 150); private static final Color HEAL_COLOR = new Color(255, 112, 6, 150); private static final Color PRAYER_HEAL_COLOR = new Color(57, 255, 186, 75); + private static final Color ENERGY_HEAL_COLOR = new Color (199, 118, 0, 218); + private static final Color RUN_STAMINA_COLOR = new Color(160, 124, 72, 255); + private static final Color SPECIAL_ATTACK_COLOR = new Color(3, 153, 0, 195); + private static final Color ENERGY_COLOR = new Color(199, 174, 0, 220); private static final Color DISEASE_COLOR = new Color(255, 193, 75, 181); private static final int HEIGHT = 252; private static final int RESIZED_BOTTOM_HEIGHT = 272; @@ -70,6 +75,8 @@ class StatusBarsOverlay extends Overlay private static final int ICON_DIMENSIONS = 26; private static final int RESIZED_BOTTOM_OFFSET_Y = 12; private static final int RESIZED_BOTTOM_OFFSET_X = 10; + private static final int MAX_SPECIAL_ATTACK_VALUE = 100; + private static final int MAX_RUN_ENERGY_VALUE = 100; private final Client client; private final StatusBarsConfig config; @@ -81,6 +88,8 @@ class StatusBarsOverlay extends Overlay private Image heartDisease; private Image heartPoison; private Image heartVenom; + private Image specialIcon; + private Image energyIcon; private final Map barRenderers = new EnumMap<>(BarMode.class); @Inject @@ -170,6 +179,32 @@ class StatusBarsOverlay extends Overlay () -> PRAYER_HEAL_COLOR, () -> prayerIcon )); + barRenderers.put(BarMode.RUN_ENERGY, new BarRenderer( + () -> MAX_RUN_ENERGY_VALUE, + client::getEnergy, + () -> getRestoreValue("Run Energy"), + () -> + { + if (client.getVar(Varbits.RUN_SLOWED_DEPLETION_ACTIVE) != 0) + { + return RUN_STAMINA_COLOR; + } + else + { + return ENERGY_COLOR; + } + }, + () -> ENERGY_HEAL_COLOR, + () -> energyIcon + )); + barRenderers.put(BarMode.SPECIAL_ATTACK, new BarRenderer( + () -> MAX_SPECIAL_ATTACK_VALUE, + () -> client.getVar(VarPlayer.SPECIAL_ATTACK_PERCENT) / 10, + () -> 0, + () -> SPECIAL_ATTACK_COLOR, + () -> SPECIAL_ATTACK_COLOR, + () -> specialIcon + )); } @Override @@ -264,7 +299,7 @@ class StatusBarsOverlay extends Overlay private void buildIcons() { - if (heartIcon != null && heartDisease != null && heartPoison != null && heartVenom != null) + if (heartIcon != null && heartDisease != null && heartPoison != null && heartVenom != null && energyIcon != null && specialIcon != null) { return; } @@ -273,5 +308,7 @@ class StatusBarsOverlay extends Overlay heartDisease = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(AlternateSprites.class, AlternateSprites.DISEASE_HEART), ICON_DIMENSIONS, ICON_DIMENSIONS); heartPoison = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(AlternateSprites.class, AlternateSprites.POISON_HEART), ICON_DIMENSIONS, ICON_DIMENSIONS); heartVenom = ImageUtil.resizeCanvas(ImageUtil.getResourceStreamFromClass(AlternateSprites.class, AlternateSprites.VENOM_HEART), ICON_DIMENSIONS, ICON_DIMENSIONS); + energyIcon = ImageUtil.resizeCanvas(Objects.requireNonNull(spriteManager.getSprite(SpriteID.MINIMAP_ORB_WALK_ICON, 0)), ICON_DIMENSIONS, ICON_DIMENSIONS); + specialIcon = ImageUtil.resizeCanvas(Objects.requireNonNull(spriteManager.getSprite(SpriteID.MINIMAP_ORB_SPECIAL_ICON, 0)), ICON_DIMENSIONS, ICON_DIMENSIONS); } } From 8438b42e15ba51b9779be4bfd570a0ceba888082 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 24 Oct 2020 13:22:52 -0400 Subject: [PATCH 18/40] api: move isDead from NPC to Actor --- runelite-api/src/main/java/net/runelite/api/Actor.java | 7 +++++++ runelite-api/src/main/java/net/runelite/api/NPC.java | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Actor.java b/runelite-api/src/main/java/net/runelite/api/Actor.java index 7f649ad15d..5ae80b23c6 100644 --- a/runelite-api/src/main/java/net/runelite/api/Actor.java +++ b/runelite-api/src/main/java/net/runelite/api/Actor.java @@ -259,4 +259,11 @@ public interface Actor extends Renderable * @param overheadText the overhead text */ void setOverheadText(String overheadText); + + /** + * Returns true if this actor has died + * + * @return + */ + boolean isDead(); } diff --git a/runelite-api/src/main/java/net/runelite/api/NPC.java b/runelite-api/src/main/java/net/runelite/api/NPC.java index d0647604b7..b6c59cf878 100644 --- a/runelite-api/src/main/java/net/runelite/api/NPC.java +++ b/runelite-api/src/main/java/net/runelite/api/NPC.java @@ -68,11 +68,4 @@ public interface NPC extends Actor */ @Nullable NPCComposition getTransformedComposition(); - - /** - * Returns true if this NPC has died - * - * @return - */ - boolean isDead(); } From 03566d67027e4f7f761b9b874f2eec8c84aed788 Mon Sep 17 00:00:00 2001 From: paymon123 Date: Thu, 8 Oct 2020 14:34:14 -0700 Subject: [PATCH 19/40] ConfigManager: Fix NPE when resetting configs with null default --- .../runelite/client/config/ConfigManager.java | 3 ++- .../client/config/ConfigManagerTest.java | 14 +++++++++++++- .../net/runelite/client/config/TestConfig.java | 17 +++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) 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 af158dfbb8..b13c54140c 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 @@ -659,6 +659,7 @@ public class ConfigManager return str; } + @Nullable static String objectToString(Object object) { if (object instanceof Color) @@ -702,7 +703,7 @@ public class ConfigManager { return Long.toString(((Duration) object).toMillis()); } - return object.toString(); + return object == null ? null : object.toString(); } @Subscribe(priority = 100) diff --git a/runelite-client/src/test/java/net/runelite/client/config/ConfigManagerTest.java b/runelite-client/src/test/java/net/runelite/client/config/ConfigManagerTest.java index aae6194a3c..208e90b699 100644 --- a/runelite-client/src/test/java/net/runelite/client/config/ConfigManagerTest.java +++ b/runelite-client/src/test/java/net/runelite/client/config/ConfigManagerTest.java @@ -118,6 +118,18 @@ public class ConfigManagerTest TestConfig conf = manager.getConfig(TestConfig.class); ConfigDescriptor descriptor = manager.getConfigDescriptor(conf); - Assert.assertEquals(1, descriptor.getItems().size()); + Assert.assertEquals(2, descriptor.getItems().size()); + } + + @Test + public void testResetNullDefaultConfig() + { + TestConfig conf = manager.getConfig(TestConfig.class); + ConfigDescriptor descriptor = manager.getConfigDescriptor(conf); + conf.nullDefaultKey("new value"); + + manager.unsetConfiguration(descriptor.getGroup().value(), "nullDefaultKey"); + manager.setDefaultConfiguration(conf, false); + Assert.assertNull(conf.nullDefaultKey()); } } diff --git a/runelite-client/src/test/java/net/runelite/client/config/TestConfig.java b/runelite-client/src/test/java/net/runelite/client/config/TestConfig.java index 66e659d98a..78cf0edb36 100644 --- a/runelite-client/src/test/java/net/runelite/client/config/TestConfig.java +++ b/runelite-client/src/test/java/net/runelite/client/config/TestConfig.java @@ -43,4 +43,21 @@ public interface TestConfig extends Config description = "value" ) void key(String key); + + @ConfigItem( + keyName = "nullDefaultKey", + name = "Key Name", + description = "value" + ) + void nullDefaultKey(String key); + + @ConfigItem( + keyName = "nullDefaultKey", + name = "Key Name", + description = "value" + ) + default String nullDefaultKey() + { + return null; + } } From 0e71c88b4d47d7fb2dcc8a862e0b31830887877a Mon Sep 17 00:00:00 2001 From: Sean Patiag Date: Sun, 20 Sep 2020 07:24:41 -0700 Subject: [PATCH 20/40] timers: Fix NMZ Overload timer not disappearing Unlike with the CoX Overloads, the plugin did not check if the player was still in the area for the Nightmare Zone Overloads, causing the timer to not disappear after leaving. The plugin now removes the timer if the player has left NMZ and has drunk an Overload potion. --- .../runelite/client/plugins/timers/TimersPlugin.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index 57b782f5e7..3cbf489c59 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -121,6 +121,7 @@ public class TimersPlugin extends Plugin static final int FIGHT_CAVES_REGION_ID = 9551; static final int INFERNO_REGION_ID = 9043; + private static final int NMZ_MAP_REGION_ID = 9033; private static final Pattern TZHAAR_WAVE_MESSAGE = Pattern.compile("Wave: (\\d+)"); private static final String TZHAAR_DEFEATED_MESSAGE = "You have been defeated!"; private static final Pattern TZHAAR_COMPLETE_MESSAGE = Pattern.compile("Your (TzTok-Jad|TzKal-Zuk) kill count is:"); @@ -718,6 +719,11 @@ public class TimersPlugin extends Plugin return client.getMapRegions() != null && ArrayUtils.contains(client.getMapRegions(), INFERNO_REGION_ID); } + private boolean isInNightmareZone() + { + return client.getLocalPlayer() != null && client.getLocalPlayer().getWorldLocation().getPlane() > 0 && ArrayUtils.contains(client.getMapRegions(), NMZ_MAP_REGION_ID); + } + private void createTzhaarTimer() { removeTzhaarTimer(); @@ -783,6 +789,11 @@ public class TimersPlugin extends Plugin switch (gameStateChanged.getGameState()) { case LOADING: + if (!isInNightmareZone()) + { + removeGameTimer(OVERLOAD); + } + if (tzhaarTimer != null && !isInFightCaves() && !isInInferno()) { removeTzhaarTimer(); From 5e2946024b4fdd831a3e70ed98f583941eeaefae Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sat, 24 Oct 2020 17:45:28 -0700 Subject: [PATCH 21/40] nightmarezone: Set absorption notification var on startup --- .../client/plugins/nightmarezone/NightmareZonePlugin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/nightmarezone/NightmareZonePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/nightmarezone/NightmareZonePlugin.java index a471f5b241..7a3952b903 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/nightmarezone/NightmareZonePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/nightmarezone/NightmareZonePlugin.java @@ -89,6 +89,7 @@ public class NightmareZonePlugin extends Plugin overlayManager.add(overlay); overlay.removeAbsorptionCounter(); + absorptionNotificationSend = true; overloadNotificationSend = false; } From 5c9ceb9d175ad1e0db8567517904835eaa9c8658 Mon Sep 17 00:00:00 2001 From: Sean Patiag Date: Sun, 20 Sep 2020 07:31:11 -0700 Subject: [PATCH 22/40] nightmarezone: Clear pending overload notifications outside NMZ --- .../client/plugins/nightmarezone/NightmareZonePlugin.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/nightmarezone/NightmareZonePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/nightmarezone/NightmareZonePlugin.java index 7a3952b903..ccd2a775c0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/nightmarezone/NightmareZonePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/nightmarezone/NightmareZonePlugin.java @@ -136,6 +136,8 @@ public class NightmareZonePlugin extends Plugin resetPointsPerHour(); } + overloadNotificationSend = false; + return; } From ba21a988090944955946ac7fa30b7b28a438fdb8 Mon Sep 17 00:00:00 2001 From: Gamma91 <7499230+Bram91@users.noreply.github.com> Date: Sun, 25 Oct 2020 03:14:42 +0100 Subject: [PATCH 23/40] HotColdLocation: Center a location spot (#12657) --- .../plugins/cluescrolls/clues/hotcold/HotColdLocation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java index 54feabc852..b624e206a2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/hotcold/HotColdLocation.java @@ -180,7 +180,7 @@ public enum HotColdLocation ZEAH_GOLDEN_FIELD_TAVERN(new WorldPoint(1718, 3643, 0), ZEAH, "South of the gravestone in Kingstown.", BRASSICAN_MAGE), ZEAH_MESS_HALL(new WorldPoint(1656, 3621, 0), ZEAH, "East of the Mess hall.", ANCIENT_WIZARDS), ZEAH_WATSONS_HOUSE(new WorldPoint(1653, 3573, 0), ZEAH, "East of Watson's house.", ANCIENT_WIZARDS), - ZEAH_VANNAHS_FARM_STORE(new WorldPoint(1806, 3521, 0), ZEAH, "North of Vannah's Farm Store, between the chicken coop and willow trees.", BRASSICAN_MAGE), + ZEAH_VANNAHS_FARM_STORE(new WorldPoint(1807, 3523, 0), ZEAH, "North of Tithe Farm, next to the pond.", BRASSICAN_MAGE), ZEAH_FARMING_GUILD_W(new WorldPoint(1208, 3736, 0), ZEAH, "West of the Farming Guild.", BRASSICAN_MAGE), ZEAH_DAIRY_COW(new WorldPoint(1324, 3722, 0), ZEAH, "North-east of the Kebos Lowlands, east of the dairy cow.", BRASSICAN_MAGE), ZEAH_CRIMSON_SWIFTS(new WorldPoint(1187, 3580, 0), ZEAH, "South-west of the Kebos Swamp, below the crimson swifts.", BRASSICAN_MAGE); From 1c21d0671e7b900ad7620d74fa817eaf3a8b6053 Mon Sep 17 00:00:00 2001 From: Plondrein Date: Sun, 18 Oct 2020 16:35:08 +0200 Subject: [PATCH 24/40] motherlode: Add overlay for broken water wheel struts * Rename MotherlodeRocksOverlay to MotherlodeSceneOverlay * When strut is broken, red border with hammer icon will show around it. --- .../plugins/motherlode/MotherlodeConfig.java | 10 ++++ .../plugins/motherlode/MotherlodePlugin.java | 52 ++++++++++++------- ...erlay.java => MotherlodeSceneOverlay.java} | 31 ++++++++++- .../motherlode/MotherlodePluginTest.java | 2 +- 4 files changed, 72 insertions(+), 23 deletions(-) rename runelite-client/src/main/java/net/runelite/client/plugins/motherlode/{MotherlodeRocksOverlay.java => MotherlodeSceneOverlay.java} (79%) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeConfig.java index 320c07758a..92b90498ed 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeConfig.java @@ -124,6 +124,16 @@ public interface MotherlodeConfig extends Config return true; } + @ConfigItem( + keyName = "showBrokenStruts", + name = "Show broken struts", + description = "Shows broken water wheel struts" + ) + default boolean showBrokenStruts() + { + return true; + } + @ConfigItem( keyName = "showLootIcons", name = "Show ore icons", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java index 91725a3754..ffdb03717e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java @@ -49,6 +49,7 @@ import net.runelite.api.Item; import net.runelite.api.ItemContainer; import net.runelite.api.ItemID; import net.runelite.api.MenuAction; +import static net.runelite.api.ObjectID.BROKEN_STRUT; import static net.runelite.api.ObjectID.ORE_VEIN_26661; import static net.runelite.api.ObjectID.ORE_VEIN_26662; import static net.runelite.api.ObjectID.ORE_VEIN_26663; @@ -109,7 +110,7 @@ public class MotherlodePlugin extends Plugin private MotherlodeOverlay overlay; @Inject - private MotherlodeRocksOverlay rocksOverlay; + private MotherlodeSceneOverlay sceneOverlay; @Inject private MotherlodeSackOverlay motherlodeSackOverlay; @@ -148,6 +149,8 @@ public class MotherlodePlugin extends Plugin private final Set veins = new HashSet<>(); @Getter(AccessLevel.PACKAGE) private final Set rocks = new HashSet<>(); + @Getter(AccessLevel.PACKAGE) + private final Set brokenStruts = new HashSet<>(); @Provides MotherlodeConfig getConfig(ConfigManager configManager) @@ -159,7 +162,7 @@ public class MotherlodePlugin extends Plugin protected void startUp() { overlayManager.add(overlay); - overlayManager.add(rocksOverlay); + overlayManager.add(sceneOverlay); overlayManager.add(motherlodeGemOverlay); overlayManager.add(motherlodeOreOverlay); overlayManager.add(motherlodeSackOverlay); @@ -176,12 +179,13 @@ public class MotherlodePlugin extends Plugin protected void shutDown() { overlayManager.remove(overlay); - overlayManager.remove(rocksOverlay); + overlayManager.remove(sceneOverlay); overlayManager.remove(motherlodeGemOverlay); overlayManager.remove(motherlodeOreOverlay); overlayManager.remove(motherlodeSackOverlay); veins.clear(); rocks.clear(); + brokenStruts.clear(); Widget sack = client.getWidget(WidgetInfo.MOTHERLODE_MINE); @@ -345,11 +349,7 @@ public class MotherlodePlugin extends Plugin return; } - GameObject gameObject = event.getGameObject(); - if (ROCK_OBSTACLES.contains(gameObject.getId())) - { - rocks.add(gameObject); - } + addGameObject(event.getGameObject()); } @Subscribe @@ -360,15 +360,8 @@ public class MotherlodePlugin extends Plugin return; } - GameObject previous = event.getPrevious(); - GameObject gameObject = event.getGameObject(); - - rocks.remove(previous); - if (ROCK_OBSTACLES.contains(gameObject.getId())) - { - rocks.add(gameObject); - } - + removeGameObject(event.getPrevious()); + addGameObject(event.getGameObject()); } @Subscribe @@ -379,8 +372,7 @@ public class MotherlodePlugin extends Plugin return; } - GameObject gameObject = event.getGameObject(); - rocks.remove(gameObject); + removeGameObject(event.getGameObject()); } @Subscribe @@ -391,6 +383,7 @@ public class MotherlodePlugin extends Plugin // on region changes the tiles get set to null veins.clear(); rocks.clear(); + brokenStruts.clear(); inMlm = checkInMlm(); } @@ -513,4 +506,23 @@ public class MotherlodePlugin extends Plugin { return Perspective.getTileHeight(client, localPoint, 0) < UPPER_FLOOR_HEIGHT; } -} \ No newline at end of file + + private void addGameObject(GameObject gameObject) + { + if (ROCK_OBSTACLES.contains(gameObject.getId())) + { + rocks.add(gameObject); + } + + if (BROKEN_STRUT == gameObject.getId()) + { + brokenStruts.add(gameObject); + } + } + + private void removeGameObject(GameObject gameObject) + { + rocks.remove(gameObject); + brokenStruts.remove(gameObject); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeSceneOverlay.java similarity index 79% rename from runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java rename to runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeSceneOverlay.java index 28b131aa06..97d65b2966 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeSceneOverlay.java @@ -34,30 +34,34 @@ import java.awt.image.BufferedImage; import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.api.GameObject; +import net.runelite.api.ItemID; import net.runelite.api.Perspective; import net.runelite.api.Player; import net.runelite.api.Point; import net.runelite.api.Skill; import net.runelite.api.WallObject; import net.runelite.api.coords.LocalPoint; +import net.runelite.client.game.ItemManager; import net.runelite.client.game.SkillIconManager; 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 MotherlodeRocksOverlay extends Overlay +class MotherlodeSceneOverlay extends Overlay { private static final int MAX_DISTANCE = 2350; + private static final int IMAGE_Z_OFFSET = 20; private final Client client; private final MotherlodePlugin plugin; private final MotherlodeConfig config; private final BufferedImage miningIcon; + private final BufferedImage hammerIcon; @Inject - MotherlodeRocksOverlay(Client client, MotherlodePlugin plugin, MotherlodeConfig config, SkillIconManager iconManager) + MotherlodeSceneOverlay(Client client, MotherlodePlugin plugin, MotherlodeConfig config, SkillIconManager iconManager, ItemManager itemManager) { setPosition(OverlayPosition.DYNAMIC); setLayer(OverlayLayer.ABOVE_SCENE); @@ -66,6 +70,7 @@ class MotherlodeRocksOverlay extends Overlay this.config = config; miningIcon = iconManager.getSkillImage(Skill.MINING); + hammerIcon = itemManager.getImage(ItemID.HAMMER); } @Override @@ -115,6 +120,17 @@ class MotherlodeRocksOverlay extends Overlay } } + if (config.showBrokenStruts()) + { + for (GameObject brokenStrut : plugin.getBrokenStruts()) + { + LocalPoint location = brokenStrut.getLocalLocation(); + if (localLocation.distanceTo(location) <= MAX_DISTANCE) + { + renderBrokenStrut(graphics, brokenStrut); + } + } + } } private void renderVein(Graphics2D graphics, WallObject vein) @@ -136,4 +152,15 @@ class MotherlodeRocksOverlay extends Overlay OverlayUtil.renderPolygon(graphics, poly, Color.red); } } + + private void renderBrokenStrut(Graphics2D graphics, GameObject brokenStrut) + { + Polygon poly = Perspective.getCanvasTilePoly(client, brokenStrut.getLocalLocation()); + + if (poly != null) + { + OverlayUtil.renderPolygon(graphics, poly, Color.red); + OverlayUtil.renderImageLocation(client, graphics, brokenStrut.getLocalLocation(), hammerIcon, IMAGE_Z_OFFSET); + } + } } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/motherlode/MotherlodePluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/motherlode/MotherlodePluginTest.java index 3141025604..99531b5404 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/motherlode/MotherlodePluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/motherlode/MotherlodePluginTest.java @@ -78,7 +78,7 @@ public class MotherlodePluginTest @Mock @Bind - private MotherlodeRocksOverlay motherlodeRocksOverlay; + private MotherlodeSceneOverlay motherlodeSceneOverlay; @Mock @Bind From 9479b232293cc148bc4abec826285a67b1483e35 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Sat, 24 Oct 2020 21:30:42 -0700 Subject: [PATCH 25/40] devtools: Render world map location above region overlay --- .../client/plugins/devtools/WorldMapLocationOverlay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WorldMapLocationOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WorldMapLocationOverlay.java index b109ef67ad..c0ee198533 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WorldMapLocationOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WorldMapLocationOverlay.java @@ -55,7 +55,7 @@ public class WorldMapLocationOverlay extends Overlay this.worldMapOverlay = worldMapOverlay; this.plugin = plugin; setPosition(OverlayPosition.DYNAMIC); - setPriority(OverlayPriority.HIGH); + setPriority(OverlayPriority.HIGHEST); setLayer(OverlayLayer.ABOVE_MAP); } From a1bfed0e8427ae0f5c5660ce4356daef62980956 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Sat, 3 Oct 2020 17:02:16 -0400 Subject: [PATCH 26/40] worldmap: add Kourend task and unlock tooltip descriptions --- .../plugins/worldmap/KourendTaskLocation.java | 80 +++++++++++++++++++ .../plugins/worldmap/KourendTaskPoint.java | 37 +++++++++ .../plugins/worldmap/WorldMapConfig.java | 11 +++ .../plugins/worldmap/WorldMapPlugin.java | 9 +++ 4 files changed, 137 insertions(+) create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskLocation.java create mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskPoint.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskLocation.java new file mode 100644 index 0000000000..3b3890ffed --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskLocation.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2020, Brooklyn + * 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 HOLDER 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.worldmap; + +import lombok.Getter; +import net.runelite.api.coords.WorldPoint; + +@Getter +enum KourendTaskLocation +{ + ARCEUUS_LIBRARY_SOUTH("Arceuus Task (0%) - Library Assistance", new WorldPoint(1622, 3801, 0)), + ARCEUUS_LIBRARY_NORTH("Arceuus Task (0%) - Library Assistance", new WorldPoint(1638, 3817, 0)), + ARCEUUS_DENSE_ESSENCE("Arceuus Task (25%) - Dense Essence Mining", new WorldPoint(1757, 3852, 0)), + ARCEUUS_REANIMATE_CREATURES("Arceuus Task (60%) - Creature Reanimation", new WorldPoint(1714, 3883, 0)), + ARCEUUS_BLOOD_ALTAR("Arceuus Unlock (100%) - Blood Rune Crafting", new WorldPoint(1716, 3829, 0)), + ARCEUUS_SOUL_ALTAR("Arceuus Unlock (100%) - Soul Rune Crafting", new WorldPoint(1814, 3854, 0)), + + HOSIDIUS_PLOUGH_NORTH("Hosidius Task (0%) - Ploughs", new WorldPoint(1770, 3550, 0)), + HOSIDIUS_PLOUGH_SOUTH("Hosidius Task (0%) - Ploughs", new WorldPoint(1769, 3528, 0)), + HOSIDUIS_FERTILISER("Hosidius Task (5%) - Making Fertilizer", new WorldPoint(1701, 3527, 0)), + HOSIDIUS_SPIRIT_TREE("Hosidius Unlock (35%) - Spirit Tree Patch", new WorldPoint(1695, 3545, 0)), + HOSIDIUS_MESS("Hosidius Task (45%) - Mess", new WorldPoint(1639, 3629, 0)), + HOSIDIUS_FARMING_PATCH("Hosidius Unlock (50%) - Disease Protection", new WorldPoint(1740, 3552, 0)), + HOSIDIUS_VINERY("Hosidius Task (65%) - Grape Planting", new WorldPoint(1804, 3564, 0)), + HOSIDIUS_TITHE_FARM("Hosidius Unlock (100%) - Tithe Farm", new WorldPoint(1802, 3499, 0)), + HOSIDIUS_KITCHEN("Hosidius Unlock (100%) - Kitchen", new WorldPoint(1678, 3618, 0)), + + LOVAKENGJ_DYNAMITE("Lovakengj Task (0%) - Making Juniper Charcoal", new WorldPoint(1718, 3472, 0)), + LOVAKENGJ_SULFUR("Lovakengj Task (0%) - Mining Volcanic Sulphur", new WorldPoint(1437, 3861, 0)), + LOVAKENGJ_ARMOURER_T1("Lovakengj Task (30%) - Armourer (Tier 1)", new WorldPoint(1453, 3750, 0)), + LOVAKENGJ_ARMOURER_T2("Lovakengj Task (40%) - Armourer (Tier 2)", new WorldPoint(1436, 3784, 0)), + LOVAKENGJ_ARMOURER_T3("Lovakengj Task (50%) - Armourer (Tier 3)", new WorldPoint(1430, 3797, 0)), + LOVAKENGJ_ARMOURER_T4("Lovakengj Task (60%) - Armourer (Tier 4)", new WorldPoint(1460, 3763, 0)), + LOVAKENGJ_ARMOURER_T5("Lovakengj Task (70%) - Armourer (Tier 5)", new WorldPoint(1524, 3755, 0)), + LOVAKENGJ_BLAST_MINE("Lovakengj Unlock (100%) - Blast Mine", new WorldPoint(1488, 3865, 0)), + + PISCARILIUS_CRANE_REPAIR("Piscarilius Task (0%) - Fishing Crane Repair", new WorldPoint(1820, 3742, 0)), + PISCARILIUS_FRESH_FISH("Piscarilius Task (15%) - Fish Delivery", new WorldPoint(1831, 3716, 0)), + PISCARILIUS_SANDWORMS("Piscarilius Task (30%) - Hunting Sandworms", new WorldPoint(1841, 3789, 0)), + PISCARILIUS_STEALING_ARTEFACTS("Piscarilius Task (75%) - Stealing Artefacts", new WorldPoint(1849, 3753, 0)), + + SHAYZIEN_HEALING_SOLDIERS("Shayzien Task (0%) - Healing Wounded Soldiers", new WorldPoint(1572, 3581, 0)), + SHAYZIEN_LIZARDMEN_EAST("Shayzien Task (5%) - Killing Lizardmen", new WorldPoint(1570, 3668, 0)), + SHAYZIEN_LIZARDMEN_WEST("Shayzien Task (5%) - Killing Lizardmen", new WorldPoint(1471, 3686, 0)), + SHAYZIEN_ORGANIZED_CRIME("Shayzien Task (40%) - Organized Crime", new WorldPoint(1565, 3605, 0)), + SHAYZIEN_COMBAT_RING("Shayzien Task (60%) - Combat Ring", new WorldPoint(1539, 3589, 0)), + SHAYZIEN_LIZARDMAN_SHAMANS("Shayzien Unlock (100%) - Lizardman Shamans", new WorldPoint(1455, 3693, 0)); + + private final String tooltip; + private final WorldPoint location; + + KourendTaskLocation(String tooltip, WorldPoint location) + { + this.tooltip = tooltip; + this.location = location; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskPoint.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskPoint.java new file mode 100644 index 0000000000..21170e0789 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/KourendTaskPoint.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020, Brooklyn + * 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 HOLDER 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.worldmap; + +import net.runelite.client.ui.overlay.worldmap.WorldMapPoint; + +public class KourendTaskPoint extends WorldMapPoint +{ + KourendTaskPoint(KourendTaskLocation data) + { + super(data.getLocation(), WorldMapPlugin.BLANK_ICON); + setTooltip(data.getTooltip()); + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java index e3e11dccd9..07518ba9df 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java @@ -295,4 +295,15 @@ public interface WorldMapConfig extends Config { return true; } + + @ConfigItem( + keyName = WorldMapPlugin.CONFIG_KEY_KOUREND_TASK_TOOLTIPS, + name = "Show Kourend task tooltips", + description = "Indicates the task or unlock for Kourend Favour locations", + position = 25 + ) + default boolean kourendTaskTooltips() + { + return true; + } } 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 74741357e0..f5df57f022 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 @@ -88,6 +88,7 @@ public class WorldMapPlugin extends Plugin static final String CONFIG_KEY_DUNGEON_TOOLTIPS = "dungeonTooltips"; static final String CONFIG_KEY_HUNTER_AREA_TOOLTIPS = "hunterAreaTooltips"; static final String CONFIG_KEY_FISHING_SPOT_TOOLTIPS = "fishingSpotTooltips"; + static final String CONFIG_KEY_KOUREND_TASK_TOOLTIPS = "kourendTaskTooltips"; static { @@ -383,6 +384,14 @@ public class WorldMapPlugin extends Plugin .forEach(worldMapPointManager::add) ); } + + worldMapPointManager.removeIf(KourendTaskPoint.class::isInstance); + if (config.kourendTaskTooltips()) + { + Arrays.stream(KourendTaskLocation.values()) + .map(KourendTaskPoint::new) + .forEach(worldMapPointManager::add); + } } private void updateQuestStartPointIcons() From 2d8ca77c8c9bb6e31c371b524224d6a9416068c4 Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Sat, 3 Oct 2020 17:07:42 -0400 Subject: [PATCH 27/40] worldmap: fix typos in "transportation" --- .../runelite/client/plugins/worldmap/WorldMapConfig.java | 6 +++--- .../runelite/client/plugins/worldmap/WorldMapPlugin.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java index 07518ba9df..8dddb1ad60 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/WorldMapConfig.java @@ -231,9 +231,9 @@ public interface WorldMapConfig extends Config } @ConfigItem( - keyName = WorldMapPlugin.CONFIG_KEY_TRANSPORATION_TELEPORT_TOOLTIPS, - name = "Show transporation tooltips", - description = "Indicates types and destinations of Transporation", + keyName = WorldMapPlugin.CONFIG_KEY_TRANSPORTATION_TELEPORT_TOOLTIPS, + name = "Show transportation tooltips", + description = "Indicates types and destinations of Transportation", position = 19 ) default boolean transportationTeleportTooltips() 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 f5df57f022..fb79e63b12 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 @@ -82,7 +82,7 @@ public class WorldMapPlugin extends Plugin static final String CONFIG_KEY_FARMING_PATCH_TOOLTIPS = "farmingpatchTooltips"; static final String CONFIG_KEY_RARE_TREE_TOOLTIPS = "rareTreeTooltips"; static final String CONFIG_KEY_RARE_TREE_LEVEL_ICON = "rareTreeIcon"; - static final String CONFIG_KEY_TRANSPORATION_TELEPORT_TOOLTIPS = "transportationTooltips"; + static final String CONFIG_KEY_TRANSPORTATION_TELEPORT_TOOLTIPS = "transportationTooltips"; static final String CONFIG_KEY_RUNECRAFTING_ALTAR_ICON = "runecraftingAltarIcon"; static final String CONFIG_KEY_MINING_SITE_TOOLTIPS = "miningSiteTooltips"; static final String CONFIG_KEY_DUNGEON_TOOLTIPS = "dungeonTooltips"; From 62413bcf2a1464c1a3a892b0180a6a8cc4cc004e Mon Sep 17 00:00:00 2001 From: Caleb Allen Date: Mon, 26 Oct 2020 17:40:29 -0400 Subject: [PATCH 28/40] gpu: fix anisotropic filtering resetting to 0 after plugin is toggled --- .../main/java/net/runelite/client/plugins/gpu/GpuPlugin.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index 18a2d5acd6..d0c7fce8bc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -489,6 +489,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks modelBuffer = null; modelBufferUnordered = null; + lastAnisotropicFilteringLevel = -1; + // force main buffer provider rebuild to turn off alpha channel client.resizeCanvas(); }); From 7c5123d230e0b678a41cbf830c894cd4fa878d9a Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 26 Oct 2020 17:42:36 -0400 Subject: [PATCH 29/40] gpu: remove unused lastViewportWidth/Height fields --- .../main/java/net/runelite/client/plugins/gpu/GpuPlugin.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index d0c7fce8bc..3bd04c4132 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -235,8 +235,6 @@ public class GpuPlugin extends Plugin implements DrawCallbacks */ private int tempUvOffset; - private int lastViewportWidth; - private int lastViewportHeight; private int lastCanvasWidth; private int lastCanvasHeight; private int lastStretchedCanvasWidth; @@ -383,7 +381,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks // force rebuild of main buffer provider to enable alpha channel client.resizeCanvas(); - lastViewportWidth = lastViewportHeight = lastCanvasWidth = lastCanvasHeight = -1; + lastCanvasWidth = lastCanvasHeight = -1; lastStretchedCanvasWidth = lastStretchedCanvasHeight = -1; lastAntiAliasingMode = null; From a78fa0560ce6af3e14f504730d66ef347cb4a7d1 Mon Sep 17 00:00:00 2001 From: dekvall Date: Mon, 26 Oct 2020 23:04:46 +0100 Subject: [PATCH 30/40] xp: add support for wise-old-man trailblazer --- .../runelite/client/plugins/xptracker/XpInfoBox.java | 4 +++- .../net/runelite/client/plugins/xptracker/XpPanel.java | 10 +++++++--- .../client/plugins/xpupdater/XpUpdaterPlugin.java | 6 +++++- 3 files changed, 15 insertions(+), 5 deletions(-) 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 d2d5d8bf3c..4dc0af0f88 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 @@ -50,6 +50,7 @@ import lombok.Getter; import net.runelite.api.Client; import net.runelite.api.Experience; import net.runelite.api.Skill; +import net.runelite.api.WorldType; import net.runelite.client.game.SkillIconManager; import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.DynamicGridLayout; @@ -123,7 +124,8 @@ class XpInfoBox extends JPanel // Create open xp tracker menu final JMenuItem openXpTracker = new JMenuItem("Open Wise Old Man"); - openXpTracker.addActionListener(e -> LinkBrowser.browse(XpPanel.buildXpTrackerUrl(client.getLocalPlayer(), skill))); + openXpTracker.addActionListener(e -> LinkBrowser.browse(XpPanel.buildXpTrackerUrl( + client.getLocalPlayer(), skill, client.getWorldType().contains(WorldType.LEAGUE)))); // Create reset menu final JMenuItem reset = new JMenuItem("Reset"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpPanel.java index e50cd3a050..aa7af98aed 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpPanel.java @@ -41,6 +41,7 @@ import javax.swing.border.EmptyBorder; import net.runelite.api.Actor; import net.runelite.api.Client; import net.runelite.api.Skill; +import net.runelite.api.WorldType; import net.runelite.client.game.SkillIconManager; import net.runelite.client.ui.ColorScheme; import net.runelite.client.ui.FontManager; @@ -82,7 +83,8 @@ class XpPanel extends PluginPanel // Create open xp tracker menu final JMenuItem openXpTracker = new JMenuItem("Open Wise Old Man"); - openXpTracker.addActionListener(e -> LinkBrowser.browse(XpPanel.buildXpTrackerUrl(client.getLocalPlayer(), Skill.OVERALL))); + openXpTracker.addActionListener(e -> LinkBrowser.browse(XpPanel.buildXpTrackerUrl( + client.getLocalPlayer(), Skill.OVERALL, client.getWorldType().contains(WorldType.LEAGUE)))); // Create reset all menu final JMenuItem reset = new JMenuItem("Reset All"); @@ -140,16 +142,18 @@ class XpPanel extends PluginPanel add(errorPanel); } - static String buildXpTrackerUrl(final Actor player, final Skill skill) + static String buildXpTrackerUrl(final Actor player, final Skill skill, boolean leagueWorld) { if (player == null) { return ""; } + final String host = leagueWorld ? "trailblazer.wiseoldman.net" : "wiseoldman.net"; + return new HttpUrl.Builder() .scheme("https") - .host("wiseoldman.net") + .host(host) .addPathSegment("players") .addPathSegment(player.getName()) .addPathSegment("gained") diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xpupdater/XpUpdaterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/xpupdater/XpUpdaterPlugin.java index 6f86e0006e..1a529b3328 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xpupdater/XpUpdaterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xpupdater/XpUpdaterPlugin.java @@ -34,6 +34,7 @@ import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.api.GameState; import net.runelite.api.Player; +import net.runelite.api.WorldType; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.client.config.ConfigManager; @@ -172,9 +173,12 @@ public class XpUpdaterPlugin extends Plugin if (config.wiseoldman()) { + final boolean leagueWorld = client.getWorldType().contains(WorldType.LEAGUE); + final String host = leagueWorld ? "trailblazer.wiseoldman.net" : "wiseoldman.net"; + HttpUrl url = new HttpUrl.Builder() .scheme("https") - .host("wiseoldman.net") + .host(host) .addPathSegment("api") .addPathSegment("players") .addPathSegment("track") From 953fb390976f8c981ebe9748abb644769df2effe Mon Sep 17 00:00:00 2001 From: Broooklyn <54762282+Broooklyn@users.noreply.github.com> Date: Tue, 27 Oct 2020 13:46:21 -0400 Subject: [PATCH 31/40] worldmap: add Wilderness Slayer Cave entrances --- .../net/runelite/client/plugins/worldmap/DungeonLocation.java | 2 ++ 1 file changed, 2 insertions(+) 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 c79b1a02a1..1f5ee3bb0e 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 @@ -200,6 +200,8 @@ enum DungeonLocation WHITE_WOLF_TUNNEL_W("White Wolf Tunnel", new WorldPoint(2819, 3484, 0)), WILDERNESS_AGILITY("Wilderness Agility Course Dungeon", new WorldPoint(3004, 3963, 0)), WILDERNESS_GOD_WARS("Wilderness God Wars Dungeon", new WorldPoint(3016, 3739, 0)), + WILDERNESS_SLAYER_CAVE_NORTH("Wilderness Slayer Cave", new WorldPoint(3292, 3746, 0)), + WILDERNESS_SLAYER_CAVE_SOUTH("Wilderness Slayer Cave", new WorldPoint(3259, 3666, 0)), WITCHAVEN("Witchaven Dungeon", new WorldPoint(2695, 3283, 0)), WIZARDS_GUILD("Wizards' Guild basement", new WorldPoint(2593, 3085, 0)), WIZARDS_TOWER("Wizards' Tower basement", new WorldPoint(3103, 3162, 0)), From c7e120d201f74642f40948f327eb0fea7f0b653b Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Wed, 28 Oct 2020 11:12:44 +0000 Subject: [PATCH 32/40] Update Item IDs to 2020-10-28-rev192 --- .../main/java/net/runelite/api/ItemID.java | 90 +++++++++++++++++- .../java/net/runelite/api/NullItemID.java | 92 +++++++++++++++++++ 2 files changed, 177 insertions(+), 5 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 5834f3f735..ba6f1c4707 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/ItemID.java @@ -5769,7 +5769,7 @@ public final class ItemID public static final int BLURITE_CROSSBOW = 9176; public static final int IRON_CROSSBOW = 9177; public static final int STEEL_CROSSBOW = 9179; - public static final int MITH_CROSSBOW = 9181; + public static final int MITHRIL_CROSSBOW = 9181; public static final int ADAMANT_CROSSBOW = 9183; public static final int RUNE_CROSSBOW = 9185; public static final int JADE_BOLT_TIPS = 9187; @@ -10768,7 +10768,7 @@ public final class ItemID public static final int FLIER_23670 = 23670; public static final int CRYSTAL_AXE = 23673; public static final int CRYSTAL_AXE_INACTIVE = 23675; - public static final int DRAGON_PICKAXEOR = 23677; + public static final int DRAGON_PICKAXE_OR = 23677; public static final int CRYSTAL_PICKAXE = 23680; public static final int CRYSTAL_PICKAXE_INACTIVE = 23682; public static final int DIVINE_SUPER_COMBAT_POTION4 = 23685; @@ -11200,9 +11200,9 @@ public final class ItemID public static final int TWISTED_TELEPORT_SCROLL = 24460; public static final int TWISTED_BLUEPRINTS = 24463; public static final int TWISTED_HORNS = 24466; - public static final int TWISTED_RELICHUNTER_T1_ARMOUR_SET = 24469; - public static final int TWISTED_RELICHUNTER_T2_ARMOUR_SET = 24472; - public static final int TWISTED_RELICHUNTER_T3_ARMOUR_SET = 24475; + public static final int TWISTED_RELIC_HUNTER_T1_ARMOUR_SET = 24469; + public static final int TWISTED_RELIC_HUNTER_T2_ARMOUR_SET = 24472; + public static final int TWISTED_RELIC_HUNTER_T3_ARMOUR_SET = 24475; public static final int OPEN_HERB_SACK = 24478; public static final int SPICE_RACK = 24479; public static final int OPEN_COAL_BAG = 24480; @@ -11472,5 +11472,85 @@ public final class ItemID public static final int BP_OBJ = 24941; public static final int REINFORCED_GOGGLES = 24942; public static final int SOURHOG_FOOT = 24944; + public static final int HALLOWED_SACK = 24946; + public static final int MOONCLAN_TELEPORT = 24949; + public static final int OURANIA_TELEPORT = 24951; + public static final int WATERBIRTH_TELEPORT = 24953; + public static final int BARBARIAN_TELEPORT = 24955; + public static final int KHAZARD_TELEPORT = 24957; + public static final int FISHING_GUILD_TELEPORT = 24959; + public static final int CATHERBY_TELEPORT = 24961; + public static final int ICE_PLATEAU_TELEPORT = 24963; + public static final int CABBAGE_24971 = 24971; + public static final int CABBAGE_24973 = 24973; + public static final int HEADLESS_HEAD = 24975; + public static final int MAGICAL_PUMPKIN = 24977; + public static final int PUMPKIN_24979 = 24979; + public static final int BROWN_CANDY = 24980; + public static final int BLUE_CANDY = 24981; + public static final int WHITE_CANDY = 24982; + public static final int PURPLE_CANDY = 24983; + public static final int RED_CANDY = 24984; + public static final int GREEN_CANDY = 24985; + public static final int BLACK_CANDY = 24986; + public static final int ORANGE_CANDY = 24987; + public static final int PINK_CANDY = 24988; + public static final int RICKS_BOX = 24989; + public static final int RICKS_HEAD = 24990; + public static final int WITCHS_BREW = 24991; + public static final int SPIDER_SNACK = 24992; + public static final int INCANTATION = 24993; + public static final int CABBAGE_24994 = 24994; + public static final int CABBAGE_24996 = 24996; + public static final int TRAILBLAZER_HOOD_T3 = 25001; + public static final int TRAILBLAZER_COAT_T3 = 25004; + public static final int TRAILBLAZER_TROUSERS_T3 = 25007; + public static final int TRAILBLAZER_BOOTS_T3 = 25010; + public static final int TRAILBLAZER_CANE = 25013; + public static final int TRAILBLAZER_HOOD_T2 = 25016; + public static final int TRAILBLAZER_COAT_T2 = 25019; + public static final int TRAILBLAZER_TROUSERS_T2 = 25022; + public static final int TRAILBLAZER_BOOTS_T2 = 25025; + public static final int TRAILBLAZER_HOOD_T1 = 25028; + public static final int TRAILBLAZER_COAT_T1 = 25031; + public static final int TRAILBLAZER_TROUSERS_T1 = 25034; + public static final int TRAILBLAZER_BOOTS_T1 = 25037; + public static final int TRAILBLAZER_TROPHY = 25040; + public static final int TRAILBLAZER_DRAGON_TROPHY = 25042; + public static final int TRAILBLAZER_RUNE_TROPHY = 25044; + public static final int TWISTED_ADAMANT_TROPHY_25046 = 25046; + public static final int TRAILBLAZER_MITHRIL_TROPHY = 25048; + public static final int TRAILBLAZER_STEEL_TROPHY = 25050; + public static final int TRAILBLAZER_IRON_TROPHY = 25052; + public static final int TRAILBLAZER_BRONZE_TROPHY = 25054; + public static final int TRAILBLAZER_BANNER = 25056; + public static final int TRAILBLAZER_HARPOON = 25059; + public static final int TRAILBLAZER_PICKAXE = 25063; + public static final int TRAILBLAZER_AXE = 25066; + public static final int GRACEFUL_HOOD_25069 = 25069; + public static final int GRACEFUL_HOOD_25071 = 25071; + public static final int GRACEFUL_CAPE_25072 = 25072; + public static final int GRACEFUL_CAPE_25074 = 25074; + public static final int GRACEFUL_TOP_25075 = 25075; + public static final int GRACEFUL_TOP_25077 = 25077; + public static final int GRACEFUL_LEGS_25078 = 25078; + public static final int GRACEFUL_LEGS_25080 = 25080; + public static final int GRACEFUL_GLOVES_25081 = 25081; + public static final int GRACEFUL_GLOVES_25083 = 25083; + public static final int GRACEFUL_BOOTS_25084 = 25084; + public static final int GRACEFUL_BOOTS_25086 = 25086; + public static final int TRAILBLAZER_TELEPORT_SCROLL = 25087; + public static final int TRAILBLAZER_TOOL_ORNAMENT_KIT = 25090; + public static final int TRAILBLAZER_GLOBE = 25093; + public static final int TRAILBLAZER_RUG = 25096; + public static final int TRAILBLAZER_GRACEFUL_ORNAMENT_KIT = 25099; + public static final int FAIRY_MUSHROOM = 25102; + public static final int CRYSTAL_OF_MEMORIES = 25104; + public static final int EXTRADIMENSIONAL_BAG = 25106; + public static final int EXTRADIMENSIONAL_BAG_25108 = 25108; + public static final int TRAILBLAZER_AXE_25110 = 25110; + public static final int TRAILBLAZER_PICKAXE_25112 = 25112; + public static final int TRAILBLAZER_HARPOON_25114 = 25114; + public static final int LEAGUE_TOMATO = 25117; /* 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 aba4e37dc2..fb20591bfa 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullItemID.java @@ -13263,5 +13263,97 @@ public final class NullItemID public static final int NULL_24883 = 24883; public static final int NULL_24943 = 24943; public static final int NULL_24945 = 24945; + public static final int NULL_24947 = 24947; + public static final int NULL_24948 = 24948; + public static final int NULL_24950 = 24950; + public static final int NULL_24952 = 24952; + public static final int NULL_24954 = 24954; + public static final int NULL_24956 = 24956; + public static final int NULL_24958 = 24958; + public static final int NULL_24960 = 24960; + public static final int NULL_24962 = 24962; + public static final int NULL_24964 = 24964; + public static final int NULL_24965 = 24965; + public static final int NULL_24966 = 24966; + public static final int NULL_24967 = 24967; + public static final int NULL_24968 = 24968; + public static final int NULL_24969 = 24969; + public static final int NULL_24970 = 24970; + public static final int NULL_24972 = 24972; + public static final int NULL_24974 = 24974; + public static final int NULL_24976 = 24976; + public static final int NULL_24978 = 24978; + public static final int NULL_24995 = 24995; + public static final int NULL_24997 = 24997; + public static final int NULL_24998 = 24998; + public static final int NULL_24999 = 24999; + public static final int NULL_25000 = 25000; + public static final int NULL_25002 = 25002; + public static final int NULL_25003 = 25003; + public static final int NULL_25005 = 25005; + public static final int NULL_25006 = 25006; + public static final int NULL_25008 = 25008; + public static final int NULL_25009 = 25009; + public static final int NULL_25011 = 25011; + public static final int NULL_25012 = 25012; + public static final int NULL_25014 = 25014; + public static final int NULL_25015 = 25015; + public static final int NULL_25017 = 25017; + public static final int NULL_25018 = 25018; + public static final int NULL_25020 = 25020; + public static final int NULL_25021 = 25021; + public static final int NULL_25023 = 25023; + public static final int NULL_25024 = 25024; + public static final int NULL_25026 = 25026; + public static final int NULL_25027 = 25027; + public static final int NULL_25029 = 25029; + public static final int NULL_25030 = 25030; + public static final int NULL_25032 = 25032; + public static final int NULL_25033 = 25033; + public static final int NULL_25035 = 25035; + public static final int NULL_25036 = 25036; + public static final int NULL_25038 = 25038; + public static final int NULL_25039 = 25039; + public static final int NULL_25041 = 25041; + public static final int NULL_25043 = 25043; + public static final int NULL_25045 = 25045; + public static final int NULL_25047 = 25047; + public static final int NULL_25049 = 25049; + public static final int NULL_25051 = 25051; + public static final int NULL_25053 = 25053; + public static final int NULL_25055 = 25055; + public static final int NULL_25057 = 25057; + public static final int NULL_25058 = 25058; + public static final int NULL_25060 = 25060; + public static final int NULL_25061 = 25061; + public static final int NULL_25062 = 25062; + public static final int NULL_25064 = 25064; + public static final int NULL_25065 = 25065; + public static final int NULL_25067 = 25067; + public static final int NULL_25068 = 25068; + public static final int NULL_25070 = 25070; + public static final int NULL_25073 = 25073; + public static final int NULL_25076 = 25076; + public static final int NULL_25079 = 25079; + public static final int NULL_25082 = 25082; + public static final int NULL_25085 = 25085; + public static final int NULL_25088 = 25088; + public static final int NULL_25089 = 25089; + public static final int NULL_25091 = 25091; + public static final int NULL_25092 = 25092; + public static final int NULL_25094 = 25094; + public static final int NULL_25095 = 25095; + public static final int NULL_25097 = 25097; + public static final int NULL_25098 = 25098; + public static final int NULL_25100 = 25100; + public static final int NULL_25101 = 25101; + public static final int NULL_25103 = 25103; + public static final int NULL_25105 = 25105; + public static final int NULL_25107 = 25107; + public static final int NULL_25109 = 25109; + public static final int NULL_25111 = 25111; + public static final int NULL_25113 = 25113; + public static final int NULL_25115 = 25115; + public static final int NULL_25116 = 25116; /* This file is automatically generated. Do not edit. */ } From 2ad96d242a76bbc7e6f02980d8024eb07286f852 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Wed, 28 Oct 2020 11:12:44 +0000 Subject: [PATCH 33/40] Update Item variations to 2020-10-28-rev192 --- .../src/main/resources/item_variations.json | 80 +++++++++++++++++-- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/runelite-client/src/main/resources/item_variations.json b/runelite-client/src/main/resources/item_variations.json index 0adad5f44c..0271d91ad5 100644 --- a/runelite-client/src/main/resources/item_variations.json +++ b/runelite-client/src/main/resources/item_variations.json @@ -2413,6 +2413,10 @@ 1947, 5607 ], + "pumpkin": [ + 1959, + 24979 + ], "easter egg": [ 1961, 7928, @@ -2432,7 +2436,11 @@ 22519, 22520, 24367, - 24426 + 24426, + 24971, + 24973, + 24994, + 24996 ], "empty cup": [ 1980, @@ -6238,6 +6246,10 @@ 9179, 9459 ], + "mithril crossbow": [ + 9181, + 9461 + ], "adamant crossbow": [ 9183, 9463 @@ -7251,7 +7263,9 @@ 21061, 21063, 24743, - 24745 + 24745, + 25069, + 25071 ], "graceful cape": [ 11852, @@ -7271,7 +7285,9 @@ 21064, 21066, 24746, - 24748 + 24748, + 25072, + 25074 ], "graceful top": [ 11854, @@ -7291,7 +7307,9 @@ 21067, 21069, 24749, - 24751 + 24751, + 25075, + 25077 ], "graceful legs": [ 11856, @@ -7311,7 +7329,9 @@ 21070, 21072, 24752, - 24754 + 24754, + 25078, + 25080 ], "graceful gloves": [ 11858, @@ -7331,7 +7351,9 @@ 21073, 21075, 24755, - 24757 + 24757, + 25081, + 25083 ], "graceful boots": [ 11860, @@ -7351,7 +7373,9 @@ 21076, 21078, 24758, - 24760 + 24760, + 25084, + 25086 ], "slayer helmet": [ 11864, @@ -9282,6 +9306,10 @@ 24365, 24366 ], + "twisted adamant trophy": [ + 24376, + 25046 + ], "twisted hat": [ 24387, 24397, @@ -9311,7 +9339,7 @@ 24439, 24440 ], - "twisted relichunter armour set": [ + "twisted relic hunter armour set": [ 24469, 24472, 24475 @@ -9428,5 +9456,41 @@ "mahogany bed": [ 24921, 24925 + ], + "trailblazer hood": [ + 25001, + 25016, + 25028 + ], + "trailblazer coat": [ + 25004, + 25019, + 25031 + ], + "trailblazer trousers": [ + 25007, + 25022, + 25034 + ], + "trailblazer boots": [ + 25010, + 25025, + 25037 + ], + "trailblazer harpoon": [ + 25059, + 25114 + ], + "trailblazer pickaxe": [ + 25063, + 25112 + ], + "trailblazer axe": [ + 25066, + 25110 + ], + "extradimensional bag": [ + 25106, + 25108 ] } \ No newline at end of file From 921d657ef23167f14c768c07b115b0fe77aa166e Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Wed, 28 Oct 2020 11:12:44 +0000 Subject: [PATCH 34/40] Update Object IDs to 2020-10-28-rev192 --- .../java/net/runelite/api/NullObjectID.java | 21 ++++- .../main/java/net/runelite/api/ObjectID.java | 83 +++++++++++++++---- 2 files changed, 85 insertions(+), 19 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java b/runelite-api/src/main/java/net/runelite/api/NullObjectID.java index 5416c14951..47bae609ef 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullObjectID.java @@ -1750,6 +1750,7 @@ public final class NullObjectID public static final int NULL_3818 = 3818; public static final int NULL_3819 = 3819; public static final int NULL_3827 = 3827; + public static final int NULL_3831 = 3831; public static final int NULL_3834 = 3834; public static final int NULL_3855 = 3855; public static final int NULL_3864 = 3864; @@ -4308,6 +4309,7 @@ public final class NullObjectID 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_10230 = 10230; public static final int NULL_10231 = 10231; public static final int NULL_10232 = 10232; public static final int NULL_10233 = 10233; @@ -9382,8 +9384,9 @@ public final class NullObjectID public static final int NULL_20840 = 20840; public static final int NULL_20841 = 20841; public static final int NULL_20842 = 20842; + public static final int NULL_20846 = 20846; + public static final int NULL_20853 = 20853; public static final int NULL_20857 = 20857; - public static final int NULL_20858 = 20858; public static final int NULL_20859 = 20859; public static final int NULL_20860 = 20860; public static final int NULL_20861 = 20861; @@ -12500,6 +12503,10 @@ public final class NullObjectID public static final int NULL_26493 = 26493; public static final int NULL_26500 = 26500; public static final int NULL_26501 = 26501; + public static final int NULL_26502 = 26502; + public static final int NULL_26503 = 26503; + public static final int NULL_26504 = 26504; + public static final int NULL_26505 = 26505; public static final int NULL_26506 = 26506; public static final int NULL_26507 = 26507; public static final int NULL_26508 = 26508; @@ -19719,5 +19726,17 @@ public final class NullObjectID public static final int NULL_40352 = 40352; public static final int NULL_40353 = 40353; public static final int NULL_40354 = 40354; + public static final int NULL_40360 = 40360; + public static final int NULL_40364 = 40364; + public static final int NULL_40368 = 40368; + public static final int NULL_40378 = 40378; + public static final int NULL_40379 = 40379; + public static final int NULL_40380 = 40380; + public static final int NULL_40381 = 40381; + public static final int NULL_40382 = 40382; + public static final int NULL_40392 = 40392; + public static final int NULL_40393 = 40393; + public static final int NULL_40394 = 40394; + public static final int NULL_40395 = 40395; /* 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 7073e724e2..b43d877ab4 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/ObjectID.java @@ -2087,7 +2087,6 @@ public final class ObjectID public static final int TUNNEL_ENTRANCE = 3828; public static final int ROPE_3829 = 3829; public static final int COMPOST_BIN = 3830; - public static final int TUNNEL_ENTRANCE_3831 = 3831; public static final int ROPE_3832 = 3832; public static final int COCOON = 3833; public static final int COMPOST_BIN_3835 = 3835; @@ -5927,7 +5926,6 @@ public final class ObjectID public static final int LADDER_10227 = 10227; public static final int LADDER_10228 = 10228; public static final int KINGS_LADDER = 10229; - public static final int KINGS_LADDER_10230 = 10230; public static final int BROKEN_KILN_10246 = 10246; public static final int BROKEN_KILN_10247 = 10247; public static final int BROKEN_KILN_10248 = 10248; @@ -11467,17 +11465,16 @@ public final class ObjectID public static final int EXIT_PORTAL_20843 = 20843; public static final int TREE_20844 = 20844; public static final int TREE_20845 = 20845; - public static final int BEEHIVE_PART = 20846; - public static final int BEEHIVE_PART_20847 = 20847; - public static final int BEEHIVE_PART_20848 = 20848; - public static final int BEEHIVE_PART_20849 = 20849; - public static final int INTERFACE_SURROUND = 20850; - public static final int BUTTON_UP = 20851; - public static final int BUTTON_DOWN = 20852; - public static final int BUTTON_LEFT = 20853; - public static final int BUTTON_RIGHT = 20854; - public static final int BUTTON_BUILD = 20855; - public static final int BEEHIVE_20856 = 20856; + public static final int WARDROBE_20847 = 20847; + public static final int WEB_20848 = 20848; + public static final int JACKOLANTERN = 20849; + public static final int JACKOLANTERN_20850 = 20850; + public static final int PORTAL_TO_RICKS_ROOM = 20851; + public static final int PORTAL_TO_WIZARDS_TOWER = 20852; + public static final int BONFIRE = 20854; + public static final int BONFIRE_20855 = 20855; + public static final int BONFIRE_20856 = 20856; + public static final int BED_20858 = 20858; public static final int COMPOST_BIN_20870 = 20870; public static final int COMPOST_BIN_20871 = 20871; public static final int COMPOST_BIN_20872 = 20872; @@ -13991,10 +13988,6 @@ public final class ObjectID public static final int WATERFALL_26497 = 26497; public static final int WATERFALL_26498 = 26498; public static final int WATERFALL_26499 = 26499; - public static final int BIG_DOOR_26502 = 26502; - public static final int BIG_DOOR_26503 = 26503; - public static final int BIG_DOOR_26504 = 26504; - public static final int BIG_DOOR_26505 = 26505; public static final int ICE_BRIDGE = 26518; public static final int CRATE_26519 = 26519; public static final int CAVE_26564 = 26564; @@ -15467,7 +15460,7 @@ public final class ObjectID public static final int MARBLE_BENCH_29275 = 29275; public static final int OBSIDIAN_BENCH_29276 = 29276; public static final int OBSIDIAN_BENCH_29277 = 29277; - public static final int BONFIRE = 29300; + public static final int BONFIRE_29300 = 29300; public static final int CRATE_29301 = 29301; public static final int CRATE_29302 = 29302; public static final int CRATE_29303 = 29303; @@ -20624,5 +20617,59 @@ public final class ObjectID public static final int BLOCKAGE_40331 = 40331; public static final int CRUMBLING_WALL_40355 = 40355; public static final int ROCKS_40356 = 40356; + public static final int LECTERN_40357 = 40357; + public static final int LECTERN_40358 = 40358; + public static final int PICTURE_40359 = 40359; + public static final int MUSHROOM_40361 = 40361; + public static final int BARREL_OF_SPIDERS = 40362; + public static final int BARREL_OF_SPIDERS_40363 = 40363; + public static final int TREE_STUMP_40365 = 40365; + public static final int CAULDRON_OF_BREW = 40366; + public static final int CAULDRON_OF_BREW_40367 = 40367; + public static final int PLANT_40369 = 40369; + public static final int GRAMOPHONE_40370 = 40370; + public static final int WARDROBE_40371 = 40371; + public static final int WARDROBE_40372 = 40372; + public static final int BOOKSHELF_40373 = 40373; + public static final int CRATE_40374 = 40374; + public static final int HAT_STAND_40375 = 40375; + public static final int PORTRAIT_40376 = 40376; + public static final int KWUARM_AND_PEAS = 40377; + public static final int MAGICAL_PUMPKIN = 40383; + public static final int MAGICAL_PUMPKIN_40384 = 40384; + public static final int MAGICAL_PUMPKIN_40385 = 40385; + public static final int CAVERN_40386 = 40386; + public static final int OPENING_40387 = 40387; + public static final int STAIRS_40388 = 40388; + public static final int OPENING_40389 = 40389; + public static final int STAIRS_40390 = 40390; + public static final int OPENING_40391 = 40391; + public static final int ROCK_40396 = 40396; + public static final int ROCK_40397 = 40397; + public static final int ROCK_40398 = 40398; + public static final int ROCK_40399 = 40399; + public static final int ARCHWAY_40400 = 40400; + public static final int ARCHWAY_40401 = 40401; + public static final int ARCHWAY_40402 = 40402; + public static final int ARCHWAY_40403 = 40403; + public static final int ARCHWAY_40404 = 40404; + public static final int ARCHWAY_40405 = 40405; + public static final int ARCHWAY_40406 = 40406; + public static final int ARCHWAY_40407 = 40407; + public static final int WAYSTONE = 40408; + public static final int WAYSTONE_40409 = 40409; + public static final int WAYSTONE_40410 = 40410; + public static final int WAYSTONE_40411 = 40411; + public static final int WAYSTONE_40412 = 40412; + public static final int WAYSTONE_40413 = 40413; + public static final int WAYSTONE_40414 = 40414; + public static final int WAYSTONE_40415 = 40415; + public static final int WAYSTONE_40416 = 40416; + public static final int KINGS_LADDER_40417 = 40417; + public static final int KINGS_LADDER_40418 = 40418; + public static final int BIG_DOOR_40419 = 40419; + public static final int BIG_DOOR_40420 = 40420; + public static final int TUNNEL_ENTRANCE_40421 = 40421; + public static final int TUNNEL_ENTRANCE_40422 = 40422; /* This file is automatically generated. Do not edit. */ } From ba3aec829b3cdc9d757a38cec3ea47a5b2a355e8 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Wed, 28 Oct 2020 11:12:44 +0000 Subject: [PATCH 35/40] Update NPC IDs to 2020-10-28-rev192 --- .../src/main/java/net/runelite/api/NpcID.java | 29 +++++++++++++++++-- .../main/java/net/runelite/api/NullNpcID.java | 13 +++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/NpcID.java b/runelite-api/src/main/java/net/runelite/api/NpcID.java index c873061a0a..962a248a1f 100644 --- a/runelite-api/src/main/java/net/runelite/api/NpcID.java +++ b/runelite-api/src/main/java/net/runelite/api/NpcID.java @@ -368,8 +368,8 @@ public final class NpcID public static final int PHEASANT_374 = 374; public static final int RICK_TURPENTINE = 375; public static final int RICK_TURPENTINE_376 = 376; - public static final int BEE_KEEPER = 377; - public static final int BEES = 378; + public static final int RICK_377 = 377; + public static final int RICK_378 = 378; public static final int QUIZ_MASTER = 379; public static final int PILLORY_GUARD = 380; public static final int TRAMP = 381; @@ -521,7 +521,6 @@ public final class NpcID public static final int DARK_WARRIOR = 531; public static final int CHAOS_DRUID_WARRIOR = 532; public static final int FUNGI = 533; - public static final int THESSALIA = 534; public static final int FUNGI_535 = 535; public static final int ZYGOMITE = 537; public static final int FUNGI_538 = 538; @@ -3026,6 +3025,7 @@ public final class NpcID public static final int WIZARD_3232 = 3232; public static final int LEECH = 3233; public static final int FERAL_VAMPYRE_3234 = 3234; + public static final int BEE_KEEPER = 3235; public static final int MIST = 3236; public static final int FERAL_VAMPYRE_3237 = 3237; public static final int VAMPYRIC_HOUND = 3238; @@ -8826,5 +8826,28 @@ public final class NpcID public static final int SHEEPDOG_10439 = 10439; public static final int SPIDER_10442 = 10442; public static final int SPIDER_10443 = 10443; + public static final int BEES = 10444; + public static final int RICK_10445 = 10445; + public static final int RICK_10446 = 10446; + public static final int RICK_10447 = 10447; + public static final int EVE_10448 = 10448; + public static final int EVE_10449 = 10449; + public static final int YELDIVE = 10450; + public static final int YELDIVE_10451 = 10451; + public static final int YANES = 10452; + public static final int YANES_10453 = 10453; + public static final int HOGST = 10454; + public static final int HOGST_10455 = 10455; + public static final int POUNCER = 10456; + public static final int POUNCER_10457 = 10457; + public static final int GHOSTLY_FIGURE = 10458; + public static final int GHOSTLY_FIGURE_10459 = 10459; + public static final int JACKOLANTERN = 10460; + public static final int RICK_10461 = 10461; + public static final int RICK_10462 = 10462; + public static final int RICK_10463 = 10463; + public static final int LEAGUES_ASSISTANT = 10476; + public static final int THESSALIA = 10477; + public static final int THESSALIA_10478 = 10478; /* 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 5773e6680e..bfb27b5a2c 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullNpcID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullNpcID.java @@ -18,6 +18,7 @@ public final class NullNpcID public static final int NULL_424 = 424; public static final int NULL_471 = 471; public static final int NULL_490 = 490; + public static final int NULL_534 = 534; public static final int NULL_536 = 536; public static final int NULL_638 = 638; public static final int NULL_716 = 716; @@ -1599,5 +1600,17 @@ public final class NullNpcID public static final int NULL_10431 = 10431; public static final int NULL_10440 = 10440; public static final int NULL_10441 = 10441; + public static final int NULL_10464 = 10464; + public static final int NULL_10465 = 10465; + public static final int NULL_10466 = 10466; + public static final int NULL_10467 = 10467; + public static final int NULL_10468 = 10468; + public static final int NULL_10469 = 10469; + public static final int NULL_10470 = 10470; + public static final int NULL_10471 = 10471; + public static final int NULL_10472 = 10472; + public static final int NULL_10473 = 10473; + public static final int NULL_10474 = 10474; + public static final int NULL_10475 = 10475; /* This file is automatically generated. Do not edit. */ } From 8a5825fbde105f71099bd9e03beb8a7b65cad7ca Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Wed, 28 Oct 2020 11:12:49 +0000 Subject: [PATCH 36/40] Update Scripts to 2020-10-28-rev192 --- .../scripts/ChatboxInputWidgetBuilder.hash | 2 +- .../scripts/ChatboxInputWidgetBuilder.rs2asm | 72 ++++++++++++------- .../main/scripts/OptionsPanelRebuilder.hash | 2 +- .../main/scripts/OptionsPanelRebuilder.rs2asm | 4 +- 4 files changed, 52 insertions(+), 28 deletions(-) diff --git a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash b/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash index 9bc0c02495..a030722f69 100644 --- a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash +++ b/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash @@ -1 +1 @@ -B840A83E8560C8EB17205E2B98F1D9CD25FBC390562E8A5A437B692EEA6D8F15 \ No newline at end of file +7AA081A68C6157F9B74DDB6B04F00B1691113941EED8996A4DEABF643F45EA25 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm b/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm index e1ab66d206..c523d51759 100644 --- a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm +++ b/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm @@ -47,8 +47,19 @@ LABEL23: get_varbit 8119 iconst 1 if_icmpeq LABEL42 - jump LABEL146 + jump LABEL155 LABEL42: + invoke 3160 + iconst 1 + if_icmpeq LABEL46 + jump LABEL51 +LABEL46: + sconst "" + chat_playername + join_string 2 + sstore 2 + jump LABEL59 +LABEL51: iconst 105 iconst 115 iconst 1894 @@ -57,16 +68,17 @@ LABEL42: chat_playername join_string 2 sstore 2 +LABEL59: iload 4 iconst 1 - if_icmpeq LABEL54 - jump LABEL58 -LABEL54: + if_icmpeq LABEL63 + jump LABEL67 +LABEL63: sload 2 sconst "" append sstore 2 -LABEL58: +LABEL67: sload 2 sconst ": " sload 0 @@ -77,9 +89,9 @@ LABEL58: sstore 2 iload 2 iconst 80 - if_icmplt LABEL70 - jump LABEL77 -LABEL70: + if_icmplt LABEL79 + jump LABEL86 +LABEL79: sload 2 sload 0 sconst "*" @@ -87,7 +99,7 @@ LABEL70: join_string 3 append sstore 2 -LABEL77: +LABEL86: sload 2 iconst 2147483647 iconst 495 @@ -95,9 +107,9 @@ LABEL77: istore 3 iload 4 iconst 1 - if_icmpeq LABEL86 - jump LABEL103 -LABEL86: + if_icmpeq LABEL95 + jump LABEL112 +LABEL95: iconst 60 iconst 5 iload 3 @@ -114,8 +126,8 @@ LABEL86: iconst 2 iconst 10616871 if_setposition - jump LABEL115 -LABEL103: + jump LABEL124 +LABEL112: iconst 0 iconst 30 iconst 0 @@ -128,26 +140,26 @@ LABEL103: iconst 2 iconst 10616871 if_setposition -LABEL115: +LABEL124: iload 3 iconst 10616890 if_getwidth - if_icmpgt LABEL120 - jump LABEL126 -LABEL120: + if_icmpgt LABEL129 + jump LABEL135 +LABEL129: iconst 2 iconst 2 iconst 0 iconst 10616890 if_settextalign - jump LABEL131 -LABEL126: + jump LABEL140 +LABEL135: iconst 0 iconst 2 iconst 0 iconst 10616890 if_settextalign -LABEL131: +LABEL140: iconst 10616890 if_clearops iconst -1 @@ -162,8 +174,19 @@ LABEL131: sconst "" iconst 10616890 if_setonop - jump LABEL187 -LABEL146: + jump LABEL205 +LABEL155: + invoke 3160 + iconst 1 + if_icmpeq LABEL159 + jump LABEL164 +LABEL159: + sconst "" + sconst " You must set a name before you can chat." + join_string 2 + sstore 2 + jump LABEL172 +LABEL164: iconst 105 iconst 115 iconst 1894 @@ -172,6 +195,7 @@ LABEL146: sconst " You must set a name before you can chat." join_string 2 sstore 2 +LABEL172: iconst 1 iconst 2 iconst 0 @@ -205,7 +229,7 @@ LABEL146: sconst "ii" iconst 10616890 if_setonop -LABEL187: +LABEL205: sload 2 iconst 10616890 if_settext diff --git a/runelite-client/src/main/scripts/OptionsPanelRebuilder.hash b/runelite-client/src/main/scripts/OptionsPanelRebuilder.hash index 325891a913..381dd10c4f 100644 --- a/runelite-client/src/main/scripts/OptionsPanelRebuilder.hash +++ b/runelite-client/src/main/scripts/OptionsPanelRebuilder.hash @@ -1 +1 @@ -70481539CCDB751DD4627EE8F4765D6D5BFD331E32E51B73946913C3CE17D942 \ No newline at end of file +1CCC672616971AEB7A1E4C00885367CEFC75A873DD22A37BE99652F2DA107653 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/OptionsPanelRebuilder.rs2asm b/runelite-client/src/main/scripts/OptionsPanelRebuilder.rs2asm index 70847540be..c713cbc000 100644 --- a/runelite-client/src/main/scripts/OptionsPanelRebuilder.rs2asm +++ b/runelite-client/src/main/scripts/OptionsPanelRebuilder.rs2asm @@ -487,7 +487,7 @@ LABEL437: iconst 73 iconst 73 iload 1 - iconst 10551305 + iconst 10551304 enum if_hassub iconst 1 @@ -542,7 +542,7 @@ LABEL481: iconst 73 iconst 73 iload 1 - iconst 10551305 + iconst 10551304 enum istore 18 iconst 0 From bc3a217043a10a197c7d0f385ca85a07019e46a8 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Wed, 28 Oct 2020 05:29:01 -0600 Subject: [PATCH 37/40] rl-client: update changed item names --- .../src/main/java/net/runelite/client/game/ItemMapping.java | 4 ++-- .../runelite/client/plugins/cluescrolls/clues/EmoteClue.java | 2 +- .../client/plugins/cluescrolls/clues/SkillChallengeClue.java | 2 +- .../main/java/net/runelite/client/plugins/mining/Pickaxe.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java index 4014382771..725fabb239 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java @@ -68,8 +68,8 @@ public enum ItemMapping ITEM_DRAGON_SCIMITAR(DRAGON_SCIMITAR, DRAGON_SCIMITAR_OR), ITEM_DRAGON_SCIMITAR_ORNAMENT_KIT(DRAGON_SCIMITAR_ORNAMENT_KIT, DRAGON_SCIMITAR_OR), ITEM_DRAGON_DEFENDER(DRAGON_DEFENDER_ORNAMENT_KIT, DRAGON_DEFENDER_T), - ITEM_DRAGON_PICKAXE(DRAGON_PICKAXE, DRAGON_PICKAXE_12797, DRAGON_PICKAXEOR), - ITEM_DRAGON_PICKAXE_OR(ZALCANO_SHARD, DRAGON_PICKAXEOR), + ITEM_DRAGON_PICKAXE(DRAGON_PICKAXE, DRAGON_PICKAXE_12797, DRAGON_PICKAXE_OR), + ITEM_DRAGON_PICKAXE_OR(ZALCANO_SHARD, DRAGON_PICKAXE_OR), ITEM_DRAGON_KITESHIELD(DRAGON_KITESHIELD, DRAGON_KITESHIELD_G), ITEM_DRAGON_KITESHIELD_ORNAMENT_KIT(DRAGON_KITESHIELD_ORNAMENT_KIT, DRAGON_KITESHIELD_G), ITEM_DRAGON_FULL_HELM(DRAGON_FULL_HELM, DRAGON_FULL_HELM_G), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java index de789b904f..d18aa4d6f2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/EmoteClue.java @@ -154,7 +154,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu new EmoteClue("Slap your head in the centre of the Kourend catacombs. Beware of double agents! Equip the arclight and the amulet of the damned.", "Kourend catacombs", CENTRE_OF_THE_CATACOMBS_OF_KOUREND, new WorldPoint(1663, 10045, 0), DOUBLE_AGENT_141, SLAP_HEAD, item(ARCLIGHT), any("Amulet of the damned", item(AMULET_OF_THE_DAMNED), item(AMULET_OF_THE_DAMNED_FULL))), new EmoteClue("Spin at the crossroads north of Rimmington. Equip a green gnome hat, cream gnome top and leather chaps.", "Rimmington", ROAD_JUNCTION_NORTH_OF_RIMMINGTON, new WorldPoint(2981, 3276, 0), SPIN, item(GREEN_HAT), item(CREAM_ROBE_TOP), item(LEATHER_CHAPS)), new EmoteClue("Spin in Draynor Manor by the fountain. Equip an iron platebody, studded leather chaps and a bronze full helmet.", "Draynor Manor", DRAYNOR_MANOR_BY_THE_FOUNTAIN, new WorldPoint(3088, 3336, 0), SPIN, item(IRON_PLATEBODY), item(STUDDED_CHAPS), item(BRONZE_FULL_HELM)), - new EmoteClue("Spin in front of the Soul altar. Beware of double agents! Equip a dragon pickaxe, helm of neitiznot and a pair of rune boots.", "Soul altar", SOUL_ALTAR, new WorldPoint(1815, 3856, 0), DOUBLE_AGENT_141, SPIN, any("Dragon or Crystal pickaxe", item(DRAGON_PICKAXE), item(DRAGON_PICKAXE_12797), item(INFERNAL_PICKAXE), item(INFERNAL_PICKAXE_UNCHARGED), item(DRAGON_PICKAXEOR), item(CRYSTAL_PICKAXE), item(CRYSTAL_PICKAXE_INACTIVE)), item(HELM_OF_NEITIZNOT), item(RUNE_BOOTS)), + new EmoteClue("Spin in front of the Soul altar. Beware of double agents! Equip a dragon pickaxe, helm of neitiznot and a pair of rune boots.", "Soul altar", SOUL_ALTAR, new WorldPoint(1815, 3856, 0), DOUBLE_AGENT_141, SPIN, any("Dragon or Crystal pickaxe", item(DRAGON_PICKAXE), item(DRAGON_PICKAXE_12797), item(INFERNAL_PICKAXE), item(INFERNAL_PICKAXE_UNCHARGED), item(DRAGON_PICKAXE_OR), item(CRYSTAL_PICKAXE), item(CRYSTAL_PICKAXE_INACTIVE)), item(HELM_OF_NEITIZNOT), item(RUNE_BOOTS)), new EmoteClue("Spin in the Varrock Castle courtyard. Equip a black axe, a coif and a ruby ring.", "Varrock Castle", OUTSIDE_VARROCK_PALACE_COURTYARD, new WorldPoint(3213, 3463, 0), SPIN, item(BLACK_AXE), item(COIF), item(RUBY_RING)), new EmoteClue("Spin in West Ardougne Church. Equip a dragon spear and red dragonhide chaps.", "West Ardougne Church", CHAPEL_IN_WEST_ARDOUGNE, new WorldPoint(2530, 3290, 0), SPIN, item(DRAGON_SPEAR), item(RED_DHIDE_CHAPS)), new EmoteClue("Spin on the bridge by the Barbarian Village. Salute before you talk to me. Equip purple gloves, a steel kiteshield and a mithril full helmet.", "Barbarian Village", EAST_OF_THE_BARBARIAN_VILLAGE_BRIDGE, new WorldPoint(3105, 3420, 0), SPIN, SALUTE, item(PURPLE_GLOVES), item(STEEL_KITESHIELD), item(MITHRIL_FULL_HELM)), 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 144c07ce27..4f7adb6db6 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 @@ -78,7 +78,7 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam item(ItemID.RUNE_PICKAXE), item(ItemID.DRAGON_PICKAXE), item(ItemID.DRAGON_PICKAXE_12797), - item(ItemID.DRAGON_PICKAXEOR), + item(ItemID.DRAGON_PICKAXE_OR), item(ItemID.INFERNAL_PICKAXE), item(ItemID.INFERNAL_PICKAXE_UNCHARGED), item(ItemID.GILDED_PICKAXE), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/mining/Pickaxe.java b/runelite-client/src/main/java/net/runelite/client/plugins/mining/Pickaxe.java index 2d5d246978..b21b3eea29 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/mining/Pickaxe.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/mining/Pickaxe.java @@ -60,7 +60,7 @@ import static net.runelite.api.ItemID.BLACK_PICKAXE; import static net.runelite.api.ItemID.BRONZE_PICKAXE; import static net.runelite.api.ItemID.CRYSTAL_PICKAXE; import static net.runelite.api.ItemID.DRAGON_PICKAXE; -import static net.runelite.api.ItemID.DRAGON_PICKAXEOR; +import static net.runelite.api.ItemID.DRAGON_PICKAXE_OR; import static net.runelite.api.ItemID.DRAGON_PICKAXE_12797; import static net.runelite.api.ItemID.GILDED_PICKAXE; import static net.runelite.api.ItemID.INFERNAL_PICKAXE; @@ -83,7 +83,7 @@ enum Pickaxe RUNE(RUNE_PICKAXE, MINING_RUNE_PICKAXE, MINING_MOTHERLODE_RUNE), GILDED(GILDED_PICKAXE, MINING_GILDED_PICKAXE, MINING_MOTHERLODE_GILDED), DRAGON(DRAGON_PICKAXE, MINING_DRAGON_PICKAXE, MINING_MOTHERLODE_DRAGON), - DRAGON_OR(DRAGON_PICKAXEOR, MINING_DRAGON_PICKAXE_OR, MINING_MOTHERLODE_DRAGON_OR), + DRAGON_OR(DRAGON_PICKAXE_OR, MINING_DRAGON_PICKAXE_OR, MINING_MOTHERLODE_DRAGON_OR), DRAGON_UPGRADED(DRAGON_PICKAXE_12797, MINING_DRAGON_PICKAXE_UPGRADED, MINING_MOTHERLODE_DRAGON_UPGRADED), INFERNAL(INFERNAL_PICKAXE, MINING_INFERNAL_PICKAXE, MINING_MOTHERLODE_INFERNAL), THIRDAGE(_3RD_AGE_PICKAXE, MINING_3A_PICKAXE, MINING_MOTHERLODE_3A), From cd2b9539c89f52acc32cfa9697373e00f59c50c0 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Wed, 28 Oct 2020 12:32:16 +0000 Subject: [PATCH 38/40] Release 1.6.30 --- 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 1ec4731562..46f952e0fc 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.30-SNAPSHOT + 1.6.30 cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index 796a31240a..fd6a3f8e29 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.30-SNAPSHOT + 1.6.30 Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 283d9deb9b..38bc5fa0b1 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.30-SNAPSHOT + 1.6.30 cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 106086753e..db3204f876 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.30-SNAPSHOT + 1.6.30 Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index 9aa89e7815..ad4ebc3ace 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.30-SNAPSHOT + 1.6.30 Web Service diff --git a/pom.xml b/pom.xml index 33cd81190d..b3cc5af7e0 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.30-SNAPSHOT + 1.6.30 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.30 diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 9977cfb97a..5ea3556caf 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.30-SNAPSHOT + 1.6.30 runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 7b58466043..79b18dcadb 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.30-SNAPSHOT + 1.6.30 client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 99fa981e02..ac321369c6 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.30-SNAPSHOT + 1.6.30 script-assembler-plugin From 95fcfd5f8cc83d78845a3362464235c330a2aa1a Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Wed, 28 Oct 2020 12:32:25 +0000 Subject: [PATCH 39/40] Bump for 1.6.31-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 46f952e0fc..da20b36dde 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.30 + 1.6.31-SNAPSHOT cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index fd6a3f8e29..7839c544ec 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.30 + 1.6.31-SNAPSHOT Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 38bc5fa0b1..c33520a26f 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.30 + 1.6.31-SNAPSHOT cache diff --git a/http-api/pom.xml b/http-api/pom.xml index db3204f876..ade5b362c3 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.30 + 1.6.31-SNAPSHOT Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index ad4ebc3ace..d12a850ff3 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.30 + 1.6.31-SNAPSHOT Web Service diff --git a/pom.xml b/pom.xml index b3cc5af7e0..edade826d7 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.6.30 + 1.6.31-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.30 + HEAD diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 5ea3556caf..8ec359a326 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.30 + 1.6.31-SNAPSHOT runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 79b18dcadb..6c1b5934d0 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.6.30 + 1.6.31-SNAPSHOT client diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index ac321369c6..62f0481d21 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.30 + 1.6.31-SNAPSHOT script-assembler-plugin From 2dafade4d16d4d1aa57750bdcb8640741fe8d5fc Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 28 Oct 2020 10:45:58 -0400 Subject: [PATCH 40/40] client: remove league chat icons plugin Jagex have added this functionality to the new TB league --- .../LeagueChatIconsPlugin.java | 350 ------------------ .../plugins/leaguechaticons/league_icon.png | Bin 641 -> 0 bytes 2 files changed, 350 deletions(-) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/leaguechaticons/LeagueChatIconsPlugin.java delete mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/leaguechaticons/league_icon.png diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/leaguechaticons/LeagueChatIconsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/leaguechaticons/LeagueChatIconsPlugin.java deleted file mode 100644 index 207f52504d..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/leaguechaticons/LeagueChatIconsPlugin.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (c) 2019, hsamoht - * 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.leaguechaticons; - -import java.awt.image.BufferedImage; -import java.util.Arrays; -import javax.inject.Inject; -import lombok.extern.slf4j.Slf4j; -import net.runelite.api.ChatPlayer; -import net.runelite.api.FriendsChatMember; -import net.runelite.api.FriendsChatManager; -import net.runelite.api.Client; -import net.runelite.api.Friend; -import net.runelite.api.GameState; -import net.runelite.api.IconID; -import net.runelite.api.IndexedSprite; -import net.runelite.api.MessageNode; -import net.runelite.api.NameableContainer; -import net.runelite.api.Player; -import net.runelite.api.events.ChatMessage; -import net.runelite.api.events.GameStateChanged; -import net.runelite.api.events.ScriptCallbackEvent; -import net.runelite.api.widgets.Widget; -import net.runelite.api.widgets.WidgetInfo; -import net.runelite.client.callback.ClientThread; -import net.runelite.client.chat.ChatMessageManager; -import net.runelite.client.eventbus.Subscribe; -import net.runelite.client.game.WorldService; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.util.ImageUtil; -import net.runelite.client.util.Text; -import net.runelite.http.api.worlds.World; -import net.runelite.http.api.worlds.WorldResult; -import net.runelite.http.api.worlds.WorldType; - -@PluginDescriptor( - name = "League Chat Icons", - description = "Changes the chat icon for players on league worlds", - enabledByDefault = false -) -@Slf4j -public class LeagueChatIconsPlugin extends Plugin -{ - private static final String SCRIPT_EVENT_SET_CHATBOX_INPUT = "setChatboxInput"; - private static final String IRONMAN_PREFIX = ""; - - @Inject - private Client client; - - @Inject - private ChatMessageManager chatMessageManager; - - @Inject - private WorldService worldService; - - @Inject - private ClientThread clientThread; - - private int leagueIconOffset = -1; // offset for league icon - private boolean onLeagueWorld; - - @Override - protected void startUp() - { - onLeagueWorld = false; - - clientThread.invoke(() -> - { - if (client.getGameState() == GameState.LOGGED_IN) - { - loadLeagueIcon(); - onLeagueWorld = isLeagueWorld(client.getWorld()); - if (onLeagueWorld) - { - setChatboxName(getNameChatbox()); - } - } - }); - } - - @Override - protected void shutDown() - { - clientThread.invoke(() -> - { - if (client.getGameState() == GameState.LOGGED_IN && onLeagueWorld) - { - setChatboxName(getNameDefault()); - } - }); - } - - @Subscribe - public void onGameStateChanged(GameStateChanged gameStateChanged) - { - if (gameStateChanged.getGameState() == GameState.LOGGED_IN) - { - loadLeagueIcon(); - onLeagueWorld = isLeagueWorld(client.getWorld()); - } - } - - @Subscribe - public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent) - { - if (scriptCallbackEvent.getEventName().equals(SCRIPT_EVENT_SET_CHATBOX_INPUT) && onLeagueWorld) - { - setChatboxName(getNameChatbox()); - } - } - - @Subscribe - public void onChatMessage(ChatMessage chatMessage) - { - if (client.getGameState() != GameState.LOADING && client.getGameState() != GameState.LOGGED_IN) - { - return; - } - - switch (chatMessage.getType()) - { - case PRIVATECHAT: - case MODPRIVATECHAT: - // Note this is unable to change icon on PMs if they are not a friend or in friends chat - case FRIENDSCHAT: - String name = Text.removeTags(chatMessage.getName()); - if (isChatPlayerOnLeague(name)) - { - addLeagueIconToMessage(chatMessage); - } - break; - case PUBLICCHAT: - case MODCHAT: - if (onLeagueWorld) - { - addLeagueIconToMessage(chatMessage); - } - break; - } - } - - /** - * Adds the League Icon in front of player names chatting from a league world. - * - * @param chatMessage chat message to edit sender name on - */ - private void addLeagueIconToMessage(ChatMessage chatMessage) - { - String name = chatMessage.getName(); - if (!name.startsWith(IRONMAN_PREFIX)) - { - // don't replace non-ironman icons, like mods - return; - } - - name = Text.removeTags(name); - - final MessageNode messageNode = chatMessage.getMessageNode(); - messageNode.setName(getNameWithIcon(leagueIconOffset, name)); - - chatMessageManager.update(messageNode); - client.refreshChat(); - } - - /** - * Update the player name in the chatbox input - */ - private void setChatboxName(String name) - { - Widget chatboxInput = client.getWidget(WidgetInfo.CHATBOX_INPUT); - if (chatboxInput != null) - { - String text = chatboxInput.getText(); - int idx = text.indexOf(':'); - if (idx != -1) - { - String newText = name + text.substring(idx); - chatboxInput.setText(newText); - } - } - } - - /** - * Gets the league name, including possible icon, of the local player. - * - * @return String of icon + name - */ - private String getNameChatbox() - { - Player player = client.getLocalPlayer(); - if (player != null) - { - return getNameWithIcon(leagueIconOffset, player.getName()); - } - return null; - } - - /** - * Gets the default name, including possible icon, of the local player. - * - * @return String of icon + name - */ - private String getNameDefault() - { - Player player = client.getLocalPlayer(); - if (player == null) - { - return null; - } - - int iconIndex; - switch (client.getAccountType()) - { - case IRONMAN: - iconIndex = IconID.IRONMAN.getIndex(); - break; - case HARDCORE_IRONMAN: - iconIndex = IconID.HARDCORE_IRONMAN.getIndex(); - break; - case ULTIMATE_IRONMAN: - iconIndex = IconID.ULTIMATE_IRONMAN.getIndex(); - break; - default: - return player.getName(); - } - - return getNameWithIcon(iconIndex, player.getName()); - } - - /** - * Get a name formatted with icon - * - * @param iconIndex index of the icon - * @param name name of the player - * @return String of icon + name - */ - private static String getNameWithIcon(int iconIndex, String name) - { - String icon = ""; - return icon + name; - } - - /** - * Checks if a player name is a friend or friends chat member on a league world. - * - * @param name name of player to check. - * @return boolean true/false. - */ - private boolean isChatPlayerOnLeague(String name) - { - ChatPlayer player = getChatPlayerFromName(name); - - if (player == null) - { - return false; - } - - int world = player.getWorld(); - return isLeagueWorld(world); - } - - /** - * Checks if the world is a League world. - * - * @param worldNumber number of the world to check. - * @return boolean true/false if it is a league world or not. - */ - private boolean isLeagueWorld(int worldNumber) - { - WorldResult worlds = worldService.getWorlds(); - if (worlds == null) - { - return false; - } - - World world = worlds.findWorld(worldNumber); - return world != null && world.getTypes().contains(WorldType.LEAGUE); - } - - /** - * Loads the league icon into the client. - */ - private void loadLeagueIcon() - { - final IndexedSprite[] modIcons = client.getModIcons(); - - if (leagueIconOffset != -1 || modIcons == null) - { - return; - } - - BufferedImage image = ImageUtil.getResourceStreamFromClass(getClass(), "league_icon.png"); - IndexedSprite indexedSprite = ImageUtil.getImageIndexedSprite(image, client); - - leagueIconOffset = modIcons.length; - - final IndexedSprite[] newModIcons = Arrays.copyOf(modIcons, modIcons.length + 1); - newModIcons[newModIcons.length - 1] = indexedSprite; - - client.setModIcons(newModIcons); - } - - /** - * Gets a ChatPlayer object from a clean name by searching friends chat and friends list. - * - * @param name name of player to find. - * @return ChatPlayer if found, else null. - */ - private ChatPlayer getChatPlayerFromName(String name) - { - // Search friends chat members first, because we will be able to get the world if their private - // is off. - FriendsChatManager friendsChatManager = client.getFriendsChatManager(); - if (friendsChatManager != null) - { - FriendsChatMember member = friendsChatManager.findByName(name); - if (member != null) - { - return member; - } - } - - NameableContainer friendContainer = client.getFriendContainer(); - return friendContainer.findByName(name); - } -} diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/leaguechaticons/league_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/leaguechaticons/league_icon.png deleted file mode 100644 index ba897e68c3bdba068597fa1eaba31b36c40975ff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 641 zcmV-{0)G98P)l0}&Am4h{(y7Y-8>3@Q85s`*1OyZm4M9OCLO~~Xbw#yHQg*8-R z)zi2$Q(#zfdXb@x!NYucct??;kI2fkNn>V~qHgQuyhmbWyTGoKqmOfPL%6+wWPO84 zWN6*mt;flK^X$Lg+pb7sWmRx_xxId!s*5^UWr>$;$H{>3>9Y9n#mdWoC`nkFsEN$Z zqSe#6=;FKl^Uw6{ztYjS%g&;mtBg5TVuzG!^6azu@y7A%v&_zcnWS%-r--?}f@FMy zMqy>&+^*5nh4t;f$;*J>+pb7rWKwN*x4eIRdq|a~l1^!Bp{#Z6=Dn7oZb@Thzr(MR zqL0MKfR&_?V|;@)R%F!ExHC~-R&aQeqmj40ft;#~o~w+xzJU|!FZ2Ka02g#pPE!B@ zOv}qO%gZy)P|nNI&Qk)>&N?nyN897r<0eSw~qvags-2!c|c%LaEME&I0J83ctm7WbWChq zd;%W>e`1n$a!P7idPb%s7lVLcR(4KqUVcHLf)LO(!h(rK#cm~~nj)egr!n&LN=QhE b@dIT5l)N9OZY|9H00000NkvXXu0mjfQwki(