Search in sources :

Example 1 with NPC

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

the class BarrowsOverlay method render.

@Override
public Dimension render(Graphics2D graphics) {
    Player local = client.getLocalPlayer();
    // tunnels are only on z=0
    if (!plugin.getWalls().isEmpty() && client.getPlane() == 0 && config.showMinimap()) {
        // NPC yellow dot
        List<NPC> npcs = client.getNpcs();
        for (NPC npc : npcs) {
            net.runelite.api.Point minimapLocation = npc.getMinimapLocation();
            if (minimapLocation != null) {
                graphics.setColor(Color.yellow);
                graphics.fillOval(minimapLocation.getX(), minimapLocation.getY(), 4, 4);
            }
        }
        // Render barrows walls/doors
        renderObjects(graphics, local);
        // Player white dot
        graphics.setColor(Color.white);
        graphics.fillRect(local.getMinimapLocation().getX(), local.getMinimapLocation().getY(), 3, 3);
    } else if (config.showBrotherLoc()) {
        renderBarrowsBrothers(graphics);
    }
    return null;
}
Also used : NPC(net.runelite.api.NPC) Player(net.runelite.api.Player)

Example 2 with NPC

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

the class MenuManager method removeNpcMenuOption.

public void removeNpcMenuOption(String option) {
    npcMenuOptions.remove(option);
    // remove this option from all npc compositions
    Client client = clientProvider.get();
    if (client == null) {
        return;
    }
    for (NPC npc : client.getNpcs()) {
        NPCComposition composition = npc.getComposition();
        removeNpcOption(composition, option);
    }
}
Also used : NPC(net.runelite.api.NPC) NPCComposition(net.runelite.api.NPCComposition) Client(net.runelite.api.Client)

Example 3 with NPC

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

the class MenuManager method addNpcMenuOption.

public void addNpcMenuOption(String option) {
    npcMenuOptions.add(option);
    // add to surrounding npcs
    Client client = clientProvider.get();
    if (client == null) {
        return;
    }
    for (NPC npc : client.getNpcs()) {
        NPCComposition composition = npc.getComposition();
        addNpcOption(composition, option);
    }
}
Also used : NPC(net.runelite.api.NPC) NPCComposition(net.runelite.api.NPCComposition) Client(net.runelite.api.Client)

Example 4 with NPC

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

the class ImplingsOverlay method render.

@Override
public Dimension render(Graphics2D graphics) {
    NPC[] imps = plugin.getImplings();
    if (imps == null) {
        return null;
    }
    for (NPC imp : imps) {
        if (imp == null || imp.getName() == null) {
            continue;
        }
        // Spawns have the name "null", so they get changed to "Spawn"
        String text = imp.getName().equals("null") ? "Spawn" : imp.getName();
        drawImp(graphics, imp, text, plugin.getIds().get(imp.getId()));
    }
    return null;
}
Also used : NPC(net.runelite.api.NPC)

Example 5 with NPC

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

the class PestControlOverlay method renderSpinners.

private void renderSpinners(Graphics2D graphics) {
    Query query = new NPCQuery().nameEquals("Spinner");
    NPC[] result = queryRunner.runQuery(query);
    Arrays.stream(result).forEach(npc -> OverlayUtil.renderActorOverlay(graphics, npc, npc.getName(), Color.CYAN));
}
Also used : NPC(net.runelite.api.NPC) Query(net.runelite.api.Query) NPCQuery(net.runelite.api.queries.NPCQuery) NPCQuery(net.runelite.api.queries.NPCQuery)

Aggregations

NPC (net.runelite.api.NPC)16 NPCComposition (net.runelite.api.NPCComposition)6 LocalPoint (net.runelite.api.coords.LocalPoint)3 Color (java.awt.Color)2 Client (net.runelite.api.Client)2 Player (net.runelite.api.Player)2 Point (net.runelite.api.Point)2 Query (net.runelite.api.Query)2 Inject (net.runelite.api.mixins.Inject)2 NPCQuery (net.runelite.api.queries.NPCQuery)2 Subscribe (com.google.common.eventbus.Subscribe)1 Dimension (java.awt.Dimension)1 FontMetrics (java.awt.FontMetrics)1 Point (java.awt.Point)1 Rectangle (java.awt.Rectangle)1 BufferedImage (java.awt.image.BufferedImage)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Actor (net.runelite.api.Actor)1 GameObject (net.runelite.api.GameObject)1