npc indicators: add option to not highlight dead npcs

This commit is contained in:
Jesse Serrao
2020-05-30 16:52:59 +01:00
committed by GitHub
parent 27173d90b5
commit 869b1ba1d9
4 changed files with 16 additions and 3 deletions

View File

@@ -100,6 +100,17 @@ public interface NpcIndicatorsConfig extends Config
@ConfigItem(
position = 6,
keyName = "highlightDeadNPCs",
name = "Highlight dead NPCs",
description = "Highlight dead NPCs"
)
default boolean highlightDeadNpcs()
{
return false;
}
@ConfigItem(
position = 7,
keyName = "showRespawnTimer",
name = "Show respawn timer",
description = "Show respawn timer of tagged NPCs")

View File

@@ -260,7 +260,7 @@ public class NpcIndicatorsPlugin extends Plugin
if (config.highlightMenuNames() &&
NPC_MENU_ACTIONS.contains(MenuAction.of(type)) &&
highlightedNpcs.stream().anyMatch(npc -> npc.getIndex() == event.getIdentifier()))
highlightedNpcs.stream().anyMatch(npc -> npc.getIndex() == event.getIdentifier() && (!npc.isDead() || config.highlightDeadNpcs())))
{
MenuEntry[] menuEntries = client.getMenuEntries();
final MenuEntry menuEntry = menuEntries[menuEntries.length - 1];

View File

@@ -68,7 +68,8 @@ public class NpcMinimapOverlay extends Overlay
private void renderNpcOverlay(Graphics2D graphics, NPC actor, String name, Color color)
{
NPCComposition npcComposition = actor.getTransformedComposition();
if (npcComposition == null || !npcComposition.isInteractible())
if (npcComposition == null || !npcComposition.isInteractible()
|| (actor.isDead() && !config.highlightDeadNpcs()))
{
return;
}

View File

@@ -146,7 +146,8 @@ public class NpcSceneOverlay extends Overlay
private void renderNpcOverlay(Graphics2D graphics, NPC actor, Color color)
{
NPCComposition npcComposition = actor.getTransformedComposition();
if (npcComposition == null || !npcComposition.isInteractible())
if (npcComposition == null || !npcComposition.isInteractible()
|| (actor.isDead() && !config.highlightDeadNpcs()))
{
return;
}