From 6d6867c2f0d54bb0c40a27009e9fd2ca7d6613de Mon Sep 17 00:00:00 2001 From: Juan Ortiz Date: Sun, 17 Mar 2019 13:15:03 -0400 Subject: [PATCH] npc highlight: remove tags from npc names --- .../client/plugins/npchighlight/NpcSceneOverlay.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 d4c8c356ec..6c41b2f24d 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 @@ -46,6 +46,7 @@ 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; +import net.runelite.client.util.Text; public class NpcSceneOverlay extends Overlay { @@ -87,7 +88,7 @@ public class NpcSceneOverlay extends Overlay for (NPC npc : plugin.getHighlightedNpcs()) { - renderNpcOverlay(graphics, npc, npc.getName(), config.getHighlightColor()); + renderNpcOverlay(graphics, npc, config.getHighlightColor()); } return null; @@ -143,7 +144,7 @@ public class NpcSceneOverlay extends Overlay } } - private void renderNpcOverlay(Graphics2D graphics, NPC actor, String name, Color color) + private void renderNpcOverlay(Graphics2D graphics, NPC actor, Color color) { switch (config.renderStyle()) { @@ -176,11 +177,12 @@ public class NpcSceneOverlay extends Overlay if (config.drawNames()) { - Point textLocation = actor.getCanvasTextLocation(graphics, name, actor.getLogicalHeight() + 40); + String npcName = Text.removeTags(actor.getName()); + Point textLocation = actor.getCanvasTextLocation(graphics, npcName, actor.getLogicalHeight() + 40); if (textLocation != null) { - OverlayUtil.renderTextLocation(graphics, textLocation, name, color); + OverlayUtil.renderTextLocation(graphics, textLocation, npcName, color); } } }