use of net.runelite.api.NPC in project runelite by runelite.
the class NpcClickboxOverlay method render.
@Override
public Dimension render(Graphics2D graphics) {
Map<NPC, String> npcMap = plugin.getHighlightedNpcs();
for (NPC npc : npcMap.keySet()) {
renderNpcOverlay(graphics, npc, npcMap.get(npc), config.getNpcColor());
}
for (NPC npc : plugin.getTaggedNpcs()) {
NPCComposition composition = plugin.getComposition(npc);
if (composition == null || composition.getName() == null)
continue;
String name = composition.getName().replace('\u00A0', ' ');
renderNpcOverlay(graphics, npc, name, config.getTagColor());
}
return null;
}
use of net.runelite.api.NPC in project runelite by runelite.
the class CrypticClue method makeWorldOverlayHint.
@Override
public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin) {
// Mark dig location
if (getLocation() != null && getNpc() == null && objectId == -1) {
LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
if (localLocation != null) {
OverlayUtil.renderTileOverlay(plugin.getClient(), graphics, localLocation, SPADE_IMAGE, Color.ORANGE);
}
}
// Mark NPC
if (plugin.getNpcsToMark() != null) {
for (NPC npc : plugin.getNpcsToMark()) {
OverlayUtil.renderActorOverlayImage(graphics, npc, CLUE_SCROLL_IMAGE, Color.ORANGE, IMAGE_Z_OFFSET);
}
}
// Mark game object
if (objectId != -1) {
net.runelite.api.Point mousePosition = plugin.getClient().getMouseCanvasPosition();
if (plugin.getObjectsToMark() != null) {
for (GameObject gameObject : plugin.getObjectsToMark()) {
OverlayUtil.renderHoverableArea(graphics, gameObject.getClickbox(), mousePosition, CLICKBOX_FILL_COLOR, CLICKBOX_BORDER_COLOR, CLICKBOX_HOVER_BORDER_COLOR);
OverlayUtil.renderImageLocation(plugin.getClient(), graphics, gameObject.getLocalLocation(), CLUE_SCROLL_IMAGE, IMAGE_Z_OFFSET);
}
}
}
}
use of net.runelite.api.NPC 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);
}
}
}
use of net.runelite.api.NPC in project runelite by runelite.
the class FishingSpotMinimapOverlay method render.
@Override
public Dimension render(Graphics2D graphics) {
NPC[] fishingSpots = plugin.getFishingSpots();
if (fishingSpots == null) {
return null;
}
for (NPC npc : fishingSpots) {
FishingSpot spot = FishingSpot.getSpot(npc.getId());
if (spot == null) {
continue;
}
Color color = npc.getGraphic() == GraphicID.FLYING_FISH ? Color.RED : Color.CYAN;
net.runelite.api.Point minimapLocation = npc.getMinimapLocation();
if (minimapLocation != null) {
OverlayUtil.renderMinimapLocation(graphics, minimapLocation, color.darker());
}
}
return null;
}
use of net.runelite.api.NPC in project runelite by runelite.
the class FightCavePlugin method findJad.
private NPC findJad() {
Query query = new NPCQuery().nameContains("TzTok-Jad");
NPC[] result = queryRunner.runQuery(query);
return result.length >= 1 ? result[0] : null;
}
Aggregations