use of net.runelite.api.GameObject in project runelite by runelite.
the class MotherlodePlugin method onGameObjectChanged.
@Subscribe
public void onGameObjectChanged(GameObjectChanged event) {
GameObject previous = event.getPrevious();
GameObject gameObject = event.getGameObject();
rocks.remove(previous);
if (ROCK_OBSTACLES.contains(gameObject.getId())) {
rocks.add(gameObject);
}
}
use of net.runelite.api.GameObject 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);
}
}
use of net.runelite.api.GameObject 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);
}
}
}
}
Aggregations