Skip to content
Permalink
Browse files

object indicator: add support for ground objects

  • Loading branch information...
Adam- committed Oct 3, 2019
1 parent 5f745be commit ad5514acdefe657b31326c2f6776c66884daf060
@@ -31,6 +31,7 @@
import net.runelite.api.Client;
import net.runelite.api.DecorativeObject;
import net.runelite.api.GameObject;
import net.runelite.api.GroundObject;
import net.runelite.api.TileObject;
import net.runelite.api.WallObject;
import net.runelite.client.ui.overlay.Overlay;
@@ -83,6 +84,10 @@ else if (object instanceof DecorativeObject)
polygon = ((DecorativeObject) object).getConvexHull();
polygon2 = ((DecorativeObject) object).getConvexHull2();
}
else if (object instanceof GroundObject)
{
polygon = ((GroundObject) object).getConvexHull();
}
else
{
polygon = object.getCanvasTilePoly();
@@ -47,6 +47,7 @@
import net.runelite.api.DecorativeObject;
import net.runelite.api.GameObject;
import net.runelite.api.GameState;
import net.runelite.api.GroundObject;
import net.runelite.api.MenuAction;
import net.runelite.api.MenuEntry;
import net.runelite.api.ObjectComposition;
@@ -55,14 +56,16 @@
import net.runelite.api.TileObject;
import net.runelite.api.WallObject;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.DecorativeObjectDespawned;
import net.runelite.api.events.DecorativeObjectSpawned;
import net.runelite.api.events.FocusChanged;
import net.runelite.api.events.GameObjectDespawned;
import net.runelite.api.events.GameObjectSpawned;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GroundObjectDespawned;
import net.runelite.api.events.GroundObjectSpawned;
import net.runelite.api.events.MenuEntryAdded;
import net.runelite.api.events.MenuOptionClicked;
import net.runelite.api.events.DecorativeObjectSpawned;
import net.runelite.api.events.DecorativeObjectDespawned;
import net.runelite.api.events.WallObjectChanged;
import net.runelite.api.events.WallObjectDespawned;
import net.runelite.api.events.WallObjectSpawned;
@@ -212,6 +215,20 @@ public void onDecorativeObjectDespawned(DecorativeObjectDespawned event)
objects.remove(event.getDecorativeObject());
}

@Subscribe
public void onGroundObjectSpawned(GroundObjectSpawned groundObjectSpawned)
{
final GroundObject groundObject = groundObjectSpawned.getGroundObject();
checkObjectPoints(groundObject);
}

@Subscribe
public void onGroundObjectDespawned(GroundObjectDespawned groundObjectDespawned)
{
GroundObject groundObject = groundObjectDespawned.getGroundObject();
objects.remove(groundObject);
}

@Subscribe
public void onGameStateChanged(GameStateChanged gameStateChanged)
{
@@ -332,6 +349,7 @@ private TileObject findTileObject(Tile tile, int id)
final GameObject[] tileGameObjects = tile.getGameObjects();
final DecorativeObject tileDecorativeObject = tile.getDecorativeObject();
final WallObject tileWallObject = tile.getWallObject();
final GroundObject groundObject = tile.getGroundObject();

if (objectIdEquals(tileWallObject, id))
{
@@ -343,6 +361,11 @@ private TileObject findTileObject(Tile tile, int id)
return tileDecorativeObject;
}

if (objectIdEquals(groundObject, id))
{
return groundObject;
}

for (GameObject object : tileGameObjects)
{
if (objectIdEquals(object, id))

0 comments on commit ad5514a

Please sign in to comment.
You can’t perform that action at this time.