diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java index 8bc34e7738..b7022c56e5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/MemorizedNpc.java @@ -34,33 +34,22 @@ import lombok.Setter; import net.runelite.api.NPC; import net.runelite.api.NPCDefinition; import net.runelite.api.coords.WorldPoint; - +@Getter(AccessLevel.PACKAGE) class MemorizedNpc { - @Getter(AccessLevel.PACKAGE) private int npcIndex; - - @Getter(AccessLevel.PACKAGE) private Set npcNames; - - @Getter(AccessLevel.PACKAGE) private int npcSize; - /** * The time the npc died at, in game ticks, relative to the tick counter */ - @Getter(AccessLevel.PACKAGE) @Setter(AccessLevel.PACKAGE) private int diedOnTick; - /** * The time it takes for the npc to respawn, in game ticks */ - @Getter(AccessLevel.PACKAGE) @Setter(AccessLevel.PACKAGE) private int respawnTime; - - @Getter(AccessLevel.PACKAGE) @Setter(AccessLevel.PACKAGE) private List possibleRespawnLocations; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java index 2b35ee2bf0..2b8ba7c95f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsConfig.java @@ -65,6 +65,17 @@ public interface NpcIndicatorsConfig extends Config return Color.CYAN; } + @ConfigItem( + position = 2, + keyName = "interactingColor", + name = "Interacting Color", + description = "Color of the NPC highlight when targeting local player" + ) + default Color getInteractingColor() + { + return Color.RED; + } + @ConfigItem( position = 3, keyName = "drawNames", @@ -78,6 +89,17 @@ public interface NpcIndicatorsConfig extends Config @ConfigItem( position = 4, + keyName = "drawInteracting", + name = "Draw target name above NPC", + description = "Configures whether the name of the NPC's target is drawn above it's head" + ) + default boolean drawInteracting() + { + return false; + } + + @ConfigItem( + position = 5, keyName = "drawMinimapNames", name = "Draw names on minimap", description = "Configures whether or not NPC names should be drawn on the minimap" @@ -88,7 +110,7 @@ public interface NpcIndicatorsConfig extends Config } @ConfigItem( - position = 5, + position = 6, keyName = "highlightMenuNames", name = "Highlight menu names", description = "Highlight NPC names in right click menu" @@ -99,7 +121,7 @@ public interface NpcIndicatorsConfig extends Config } @ConfigItem( - position = 6, + position = 7, keyName = "showRespawnTimer", name = "Show respawn timer", description = "Show respawn timer of tagged NPCs") diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java index 62cf808211..5f504fe3af 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcIndicatorsPlugin.java @@ -192,8 +192,12 @@ public class NpcIndicatorsPlugin extends Plugin @Getter(AccessLevel.PACKAGE) private Color getHighlightColor; @Getter(AccessLevel.PACKAGE) + private Color getInteractingColor; + @Getter(AccessLevel.PACKAGE) private boolean drawNames; @Getter(AccessLevel.PACKAGE) + private boolean drawInteracting; + @Getter(AccessLevel.PACKAGE) private boolean drawMinimapNames; @Getter(AccessLevel.PACKAGE) private boolean highlightMenuNames; @@ -654,9 +658,11 @@ public class NpcIndicatorsPlugin extends Plugin this.renderStyle = config.renderStyle(); this.getNpcToHighlight = config.getNpcToHighlight(); this.getHighlightColor = config.getHighlightColor(); + this.getInteractingColor = config.getInteractingColor(); this.drawNames = config.drawNames(); + this.drawInteracting = config.drawInteracting(); this.drawMinimapNames = config.drawMinimapNames(); this.highlightMenuNames = config.highlightMenuNames(); this.showRespawnTimer = config.showRespawnTimer(); } -} +} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcMinimapOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcMinimapOverlay.java index bb5519202c..a729fe20cc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcMinimapOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcMinimapOverlay.java @@ -63,7 +63,8 @@ public class NpcMinimapOverlay extends Overlay private void renderNpcOverlay(Graphics2D graphics, NPC actor, String name, Color color) { - Point minimapLocation = actor.getMinimapLocation(); + final Point minimapLocation = actor.getMinimapLocation(); + if (minimapLocation != null) { OverlayUtil.renderMinimapLocation(graphics, minimapLocation, color.darker()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java index 5f0d3100a2..93aa72994e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npchighlight/NpcSceneOverlay.java @@ -149,10 +149,16 @@ public class NpcSceneOverlay extends Overlay private void renderNpcOverlay(Graphics2D graphics, NPC actor, Color color) { + if (plugin.isDrawInteracting() && actor.getInteracting() != null + && actor.getInteracting() == client.getLocalPlayer()) + { + color = plugin.getGetInteractingColor(); + } + switch (plugin.getRenderStyle()) { case SOUTH_WEST_TILE: - LocalPoint lp1 = LocalPoint.fromWorld(client, actor.getWorldLocation()); + final LocalPoint lp1 = LocalPoint.fromWorld(client, actor.getWorldLocation()); Polygon tilePoly1 = null; if (lp1 != null) { @@ -161,38 +167,30 @@ public class NpcSceneOverlay extends Overlay renderPoly(graphics, color, tilePoly1); break; - case TILE: int size = 1; - NPCDefinition composition = actor.getTransformedDefinition(); + final NPCDefinition composition = actor.getTransformedDefinition(); if (composition != null) { size = composition.getSize(); } - LocalPoint lp = actor.getLocalLocation(); - Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size); - + final LocalPoint lp = actor.getLocalLocation(); + final Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size); renderPoly(graphics, color, tilePoly); break; - case HULL: - Polygon objectClickbox = actor.getConvexHull(); - + final Polygon objectClickbox = actor.getConvexHull(); renderPoly(graphics, color, objectClickbox); break; - case THIN_OUTLINE: modelOutliner.drawOutline(actor, 1, color); break; - case OUTLINE: modelOutliner.drawOutline(actor, 2, color); break; - case THIN_GLOW: modelOutliner.drawOutline(actor, 4, color, TRANSPARENT); break; - case GLOW: modelOutliner.drawOutline(actor, 8, color, TRANSPARENT); break; @@ -200,14 +198,26 @@ public class NpcSceneOverlay extends Overlay if (plugin.isDrawNames() && actor.getName() != null) { - String npcName = Text.removeTags(actor.getName()); - Point textLocation = actor.getCanvasTextLocation(graphics, npcName, actor.getLogicalHeight() + 40); + final String npcName = Text.removeTags(actor.getName()); + final Point textLocation = actor.getCanvasTextLocation(graphics, npcName, actor.getLogicalHeight() + 40); if (textLocation != null) { OverlayUtil.renderTextLocation(graphics, textLocation, npcName, color); } } + + if (plugin.isDrawInteracting() && actor.getInteracting() != null) + { + final int drawHeight = plugin.isDrawNames() ? 80 : 40; + final String targetName = Text.removeTags(actor.getInteracting().getName()); + final Point textLocation = actor.getCanvasTextLocation(graphics, targetName, actor.getLogicalHeight() + drawHeight); + + if (textLocation != null) + { + OverlayUtil.renderTextLocation(graphics, textLocation, targetName, color); + } + } } private void renderPoly(Graphics2D graphics, Color color, Polygon polygon)