npchighlight: Apply correct highlights to changed NPCs

This commit is contained in:
Jordan Atwood
2021-02-12 23:40:34 -08:00
committed by Adam
parent e8fd08fa41
commit 7c59815869
2 changed files with 62 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ import net.runelite.api.events.GameTick;
import net.runelite.api.events.GraphicsObjectCreated;
import net.runelite.api.events.MenuEntryAdded;
import net.runelite.api.events.MenuOptionClicked;
import net.runelite.api.events.NpcChanged;
import net.runelite.api.events.NpcDespawned;
import net.runelite.api.events.NpcSpawned;
import net.runelite.client.callback.ClientThread;
@@ -409,6 +410,26 @@ public class NpcIndicatorsPlugin extends Plugin
highlightedNpcs.remove(npc);
}
@Subscribe
public void onNpcChanged(NpcChanged event)
{
final NPC npc = event.getNpc();
final String npcName = npc.getName();
highlightedNpcs.remove(npc);
if (npcName == null)
{
return;
}
if (npcTags.contains(npc.getIndex())
|| highlightMatchesNPCName(npcName))
{
highlightedNpcs.add(npc);
}
}
@Subscribe
public void onGraphicsObjectCreated(GraphicsObjectCreated event)
{