Search in sources :

Example 26 with LocalPoint

use of net.runelite.api.coords.LocalPoint in project runelite by runelite.

the class MapClue method makeWorldOverlayHint.

@Override
public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin) {
    LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
    if (localLocation == null) {
        return;
    }
    // Mark game object
    if (objectId != -1) {
        Region region = plugin.getClient().getRegion();
        Tile[][][] tiles = region.getTiles();
        Tile tile = tiles[plugin.getClient().getPlane()][localLocation.getRegionX()][localLocation.getRegionY()];
        net.runelite.api.Point mousePosition = plugin.getClient().getMouseCanvasPosition();
        for (GameObject gameObject : tile.getGameObjects()) {
            if (gameObject != null) {
                OverlayUtil.renderHoverableArea(graphics, gameObject.getClickbox(), mousePosition, CLICKBOX_FILL_COLOR, CLICKBOX_BORDER_COLOR, CLICKBOX_HOVER_BORDER_COLOR);
                OverlayUtil.renderImageLocation(plugin.getClient(), graphics, localLocation, CLUE_SCROLL_IMAGE, IMAGE_Z_OFFSET);
            }
        }
    } else {
        OverlayUtil.renderTileOverlay(plugin.getClient(), graphics, localLocation, SPADE_IMAGE, Color.ORANGE);
    }
}
Also used : LocalPoint(net.runelite.api.coords.LocalPoint) GameObject(net.runelite.api.GameObject) Region(net.runelite.api.Region) Tile(net.runelite.api.Tile)

Example 27 with LocalPoint

use of net.runelite.api.coords.LocalPoint in project runelite by runelite.

the class FairyRingClue method makeWorldOverlayHint.

@Override
public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin) {
    LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
    if (localLocation == null) {
        return;
    }
    OverlayUtil.renderTileOverlay(plugin.getClient(), graphics, localLocation, SPADE_IMAGE, Color.ORANGE);
}
Also used : LocalPoint(net.runelite.api.coords.LocalPoint)

Example 28 with LocalPoint

use of net.runelite.api.coords.LocalPoint in project runelite by runelite.

the class CoordinateClue method makeWorldOverlayHint.

@Override
public void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin) {
    LocalPoint localLocation = LocalPoint.fromWorld(plugin.getClient(), getLocation());
    if (localLocation == null) {
        return;
    }
    OverlayUtil.renderTileOverlay(plugin.getClient(), graphics, localLocation, SPADE_IMAGE, Color.ORANGE);
}
Also used : LocalPoint(net.runelite.api.coords.LocalPoint)

Example 29 with LocalPoint

use of net.runelite.api.coords.LocalPoint 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);
            }
        }
    }
}
Also used : NPC(net.runelite.api.NPC) LocalPoint(net.runelite.api.coords.LocalPoint) GameObject(net.runelite.api.GameObject)

Example 30 with LocalPoint

use of net.runelite.api.coords.LocalPoint in project runelite by runelite.

the class DevToolsOverlay method renderProjectiles.

private void renderProjectiles(Graphics2D graphics) {
    List<Projectile> projectiles = client.getProjectiles();
    for (Projectile projectile : projectiles) {
        int originX = projectile.getX1();
        int originY = projectile.getY1();
        LocalPoint tilePoint = new LocalPoint(originX, originY);
        Polygon poly = Perspective.getCanvasTilePoly(client, tilePoint);
        if (poly != null) {
            OverlayUtil.renderPolygon(graphics, poly, Color.RED);
        }
        int projectileId = projectile.getId();
        Actor projectileInteracting = projectile.getInteracting();
        String infoString = "";
        if (projectileInteracting == null) {
            infoString += "AoE";
        } else {
            infoString += "Targeted (T: " + projectileInteracting.getName() + ")";
        }
        infoString += " (ID: " + projectileId + ")";
        if (projectileInteracting != null) {
            OverlayUtil.renderActorOverlay(graphics, projectile.getInteracting(), infoString, Color.RED);
        }
    }
}
Also used : LocalPoint(net.runelite.api.coords.LocalPoint) Actor(net.runelite.api.Actor) Polygon(java.awt.Polygon) LocalPoint(net.runelite.api.coords.LocalPoint) Projectile(net.runelite.api.Projectile)

Aggregations

LocalPoint (net.runelite.api.coords.LocalPoint)33 Point (net.runelite.api.Point)8 Polygon (java.awt.Polygon)7 Color (java.awt.Color)5 WorldPoint (net.runelite.api.coords.WorldPoint)5 FontMetrics (java.awt.FontMetrics)4 GameObject (net.runelite.api.GameObject)4 Rectangle2D (java.awt.geom.Rectangle2D)3 Player (net.runelite.api.Player)3 Tile (net.runelite.api.Tile)3 Area (java.awt.geom.Area)2 Region (net.runelite.api.Region)2 ProgressPie (net.runelite.client.ui.overlay.components.ProgressPie)2 Subscribe (com.google.common.eventbus.Subscribe)1 Inject (com.google.inject.Inject)1 Dimension (java.awt.Dimension)1 Graphics2D (java.awt.Graphics2D)1 Rectangle (java.awt.Rectangle)1 Instant (java.time.Instant)1 HashMap (java.util.HashMap)1