use of net.runelite.api.coords.WorldPoint in project runelite by runelite.
the class ClueScrollPlugin method coordinatesToWorldPoint.
/**
* This conversion is explained on
* http://oldschoolrunescape.wikia.com/wiki/Treasure_Trails/Guide/Coordinates
*/
private WorldPoint coordinatesToWorldPoint(int degX, int minX, int degY, int minY) {
// Center of the Observatory
int x2 = 2440;
int y2 = 3161;
x2 += degX * 32 + Math.round(minX / 1.875);
y2 += degY * 32 + Math.round(minY / 1.875);
return new WorldPoint(x2, y2, 0);
}
use of net.runelite.api.coords.WorldPoint in project runelite by runelite.
the class LocationOverlay method render.
@Override
public Dimension render(Graphics2D graphics) {
if (!plugin.isToggleLocation()) {
return null;
}
panelComponent = new PanelComponent();
WorldPoint localWorld = client.getLocalPlayer().getWorldLocation();
panelComponent.getLines().add(new PanelComponent.Line("Tile", localWorld.getX() + ", " + localWorld.getY() + ", " + client.getPlane()));
for (int i = 0; i < client.getMapRegions().length; i++) {
int region = client.getMapRegions()[i];
panelComponent.getLines().add(new PanelComponent.Line((i == 0) ? "Map region" : " ", String.valueOf(region)));
}
return panelComponent.render(graphics);
}
use of net.runelite.api.coords.WorldPoint in project runelite by runelite.
the class HerbiboarOverlay method render.
@Override
public Dimension render(Graphics2D graphics) {
if (!plugin.isInHerbiboarArea()) {
return null;
}
HerbiboarTrail currentTrail = plugin.getCurrentTrail();
int finishId = plugin.getFinishId();
// Draw start objects
if (config.isStartShown() && (currentTrail == null && finishId == 0)) {
plugin.getStarts().keySet().forEach((obj) -> {
OverlayUtil.renderTileOverlay(graphics, obj, "", config.getStartColor());
});
}
// Draw trails
if (config.isTrailShown()) {
Set<Integer> shownTrailIds = plugin.getShownTrails();
plugin.getTrails().keySet().forEach((x) -> {
int id = x.getId();
if (shownTrailIds.contains(id) && (finishId > 0 || (currentTrail != null && currentTrail.getTrailId() != id && currentTrail.getTrailId() + 1 != id))) {
OverlayUtil.renderTileOverlay(graphics, x, "", config.getTrailColor());
}
});
}
// Draw trail objects (mushrooms, mud, etc)
if (config.isObjectShown() && currentTrail != null) {
int currentPath = plugin.getCurrentPath();
plugin.getTrailObjects().keySet().forEach((obj) -> {
WorldPoint loc = obj.getWorldLocation();
WorldPoint[] trailLocs = currentTrail.getObjectLocs(currentPath);
for (WorldPoint trailLoc : trailLocs) {
if (trailLoc == null) {
continue;
}
if (trailLoc.equals(loc)) {
if (config.showClickBoxes()) {
Area clickbox = obj.getClickbox();
graphics.setColor(config.getObjectColor());
graphics.draw(clickbox);
graphics.setColor(new Color(255, 0, 255, 20));
graphics.fill(clickbox);
} else {
OverlayUtil.renderTileOverlay(graphics, obj, "", config.getObjectColor());
}
}
}
});
}
// Draw finish tunnels
if (config.isTunnelShown() && finishId > 0) {
WorldPoint finishLoc = plugin.getEndLocations().get(finishId - 1);
Map<TileObject, Tile> tunnels = plugin.getTunnels();
tunnels.keySet().forEach((obj) -> {
WorldPoint loc = obj.getWorldLocation();
if (finishLoc.equals(loc)) {
if (config.showClickBoxes()) {
Area clickbox = obj.getClickbox();
Color col = config.getObjectColor();
graphics.setColor(col);
graphics.draw(clickbox);
graphics.setColor(new Color(col.getRed(), col.getGreen(), col.getBlue(), 20));
graphics.fill(clickbox);
} else {
OverlayUtil.renderTileOverlay(graphics, obj, "", config.getTunnelColor());
}
}
});
}
return null;
}
Aggregations