From c5586123c86de7baa5b13b9e07bb26391d666231 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 9 Sep 2021 20:38:03 -0400 Subject: [PATCH 1/5] npc overlay: set lower priority on npc change and despawn handlers Similar to spawn, these need to run after plugins for most of the highlight functions to work correctly --- .../client/game/npcoverlay/NpcOverlayService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlayService.java b/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlayService.java index a8e01bf489..242854a4ca 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlayService.java +++ b/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlayService.java @@ -81,14 +81,18 @@ public class NpcOverlayService } } - @Subscribe + @Subscribe( + priority = -1 + ) private void onNpcDespawned(NpcDespawned npcDespawned) { final NPC npc = npcDespawned.getNpc(); highlightedNpcs.remove(npc); } - @Subscribe + @Subscribe( + priority = -1 + ) private void onNpcChanged(NpcChanged event) { final NPC npc = event.getNpc(); From 9cadc62eba89699758e6e1fafba58fac5fc1562d Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 10 Sep 2021 18:05:25 -0400 Subject: [PATCH 2/5] widget overlay: correct raids points overlay position --- .../main/java/net/runelite/client/ui/overlay/WidgetOverlay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 43a1faf32e..9435086d7c 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 @@ -47,7 +47,7 @@ public class WidgetOverlay extends Overlay // The client forces the oxygen bar below the xp tracker, so set its priority lower new WidgetOverlay(client, WidgetInfo.FOSSIL_ISLAND_OXYGENBAR, OverlayPosition.TOP_CENTER, OverlayPriority.HIGH), new XpTrackerWidgetOverlay(overlayManager, client, WidgetInfo.EXPERIENCE_TRACKER_WIDGET, OverlayPosition.TOP_RIGHT), - new WidgetOverlay(client, WidgetInfo.RAIDS_POINTS_INFOBOX, OverlayPosition.TOP_RIGHT), + new WidgetOverlay(client, WidgetInfo.RAIDS_POINTS_INFOBOX, OverlayPosition.TOP_LEFT), new WidgetOverlay(client, WidgetInfo.TOB_PARTY_INTERFACE, OverlayPosition.TOP_LEFT), new WidgetOverlay(client, WidgetInfo.TOB_PARTY_STATS, OverlayPosition.TOP_LEFT), new WidgetOverlay(client, WidgetInfo.GWD_KC, OverlayPosition.TOP_RIGHT), From 9cd1cbcea0e0dce5b57b43494617324587037392 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 11 Sep 2021 00:02:19 -0400 Subject: [PATCH 3/5] music: check game state before applying sliders on startup This accesses vars, which typically cannot be accessed when not logged in, or in early startup --- .../java/net/runelite/client/plugins/music/MusicPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java index 36081a3e10..96b08f83e2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java @@ -186,7 +186,7 @@ public class MusicPlugin extends Plugin channels = new Channel[]{musicChannel, effectChannel, areaChannel}; addMusicButtons(); - if (musicConfig.granularSliders()) + if (client.getGameState() == GameState.LOGGED_IN && musicConfig.granularSliders()) { updateMusicOptions(); resetSettingsWindow(); From 3c5f8123313b5f52027b5b2bd32f6c6c0d49dea1 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 11 Sep 2021 10:53:05 -0400 Subject: [PATCH 4/5] npc overlay: clear highlighted npcs on logout Despawn events don't fire for npcs on logout, copied from the npc highlight plugin --- .../client/game/npcoverlay/NpcOverlayService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlayService.java b/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlayService.java index 242854a4ca..db96bc91a5 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlayService.java +++ b/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlayService.java @@ -33,7 +33,9 @@ import java.util.function.Function; import javax.inject.Inject; import javax.inject.Singleton; import net.runelite.api.Client; +import net.runelite.api.GameState; import net.runelite.api.NPC; +import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.NpcChanged; import net.runelite.api.events.NpcDespawned; import net.runelite.api.events.NpcSpawned; @@ -62,6 +64,16 @@ public class NpcOverlayService eventBus.register(this); } + @Subscribe + private void onGameStateChanged(GameStateChanged event) + { + if (event.getGameState() == GameState.LOGIN_SCREEN || + event.getGameState() == GameState.HOPPING) + { + highlightedNpcs.clear(); + } + } + @Subscribe( // Run after plugins, which typically capture NPCs on spawn and reference them in the highlight functions priority = -1 From a23119257849c37ef3567629e3fe7fdff1a08c3d Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 11 Sep 2021 00:13:58 -0400 Subject: [PATCH 5/5] client: update jna to 5.9.0 This is required for macos aarch64 support --- runelite-client/pom.xml | 5 ++--- .../client/plugins/worldhopper/ping/IcmpEchoReply.java | 5 +++-- .../net/runelite/client/plugins/worldhopper/ping/RLLibC.java | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 922c9c3a6a..da1746631b 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -198,16 +198,15 @@ archive-patcher 1.0 - net.java.dev.jna jna - 4.5.1 + 5.9.0 net.java.dev.jna jna-platform - 4.5.1 + 5.9.0 com.google.code.findbugs diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/IcmpEchoReply.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/IcmpEchoReply.java index 0e1cc198a3..038022f44d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/IcmpEchoReply.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/IcmpEchoReply.java @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.worldhopper.ping; +import com.sun.jna.Native; import com.sun.jna.Pointer; import com.sun.jna.Structure; import com.sun.jna.platform.win32.WinDef; @@ -32,8 +33,8 @@ import java.util.List; public class IcmpEchoReply extends Structure { - private static final int IP_OPTION_INFO_SIZE = 1 + 1 + 1 + 1 + (Pointer.SIZE == 8 ? 12 : 4); // on 64bit vms add 4 byte padding - public static final int SIZE = 4 + 4 + 4 + 2 + 2 + Pointer.SIZE + IP_OPTION_INFO_SIZE; + private static final int IP_OPTION_INFO_SIZE = 1 + 1 + 1 + 1 + (Native.POINTER_SIZE == 8 ? 12 : 4); // on 64bit vms add 4 byte padding + public static final int SIZE = 4 + 4 + 4 + 2 + 2 + Native.POINTER_SIZE + IP_OPTION_INFO_SIZE; public WinDef.ULONG address; public WinDef.ULONG status; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/RLLibC.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/RLLibC.java index f495ccff83..3000e5a85e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/RLLibC.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/ping/RLLibC.java @@ -41,8 +41,6 @@ interface RLLibC extends LibC int socket(int domain, int type, int protocol); - void close(int socket); - int sendto(int sockfd, byte[] buf, int len, int flags, byte[] dest_addr, int addrlen); int recvfrom(int sockfd, Pointer buf, int len, int flags, Pointer src_addr, Pointer addrlen);