Search in sources :

Example 6 with NPCComposition

use of net.runelite.api.NPCComposition in project runelite by runelite.

the class DevToolsOverlay method renderNpcs.

private void renderNpcs(Graphics2D graphics) {
    List<NPC> npcs = client.getNpcs();
    for (NPC npc : npcs) {
        NPCComposition composition = npc.getComposition();
        if (composition.getConfigs() != null) {
            composition = composition.transform();
        }
        String text = composition.getName() + " (ID: " + composition.getId() + ") (A: " + npc.getAnimation() + ") (G: " + npc.getGraphic() + ")";
        if (npc.getCombatLevel() > 1) {
            OverlayUtil.renderActorOverlay(graphics, npc, text, YELLOW);
        } else {
            OverlayUtil.renderActorOverlay(graphics, npc, text, ORANGE);
        }
    }
}
Also used : NPC(net.runelite.api.NPC) NPCComposition(net.runelite.api.NPCComposition)

Aggregations

NPC (net.runelite.api.NPC)6 NPCComposition (net.runelite.api.NPCComposition)6 Client (net.runelite.api.Client)2 Subscribe (com.google.common.eventbus.Subscribe)1 HashMap (java.util.HashMap)1