object indicator: add support for ground objects
This commit is contained in:
@@ -31,6 +31,7 @@ import javax.inject.Inject;
|
||||
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 @@ class ObjectIndicatorsOverlay extends Overlay
|
||||
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 static net.runelite.api.Constants.REGION_SIZE;
|
||||
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.Tile;
|
||||
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 class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
||||
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 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
||||
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 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
||||
return tileDecorativeObject;
|
||||
}
|
||||
|
||||
if (objectIdEquals(groundObject, id))
|
||||
{
|
||||
return groundObject;
|
||||
}
|
||||
|
||||
for (GameObject object : tileGameObjects)
|
||||
{
|
||||
if (objectIdEquals(object, id))
|
||||
|
||||
Reference in New Issue
Block a user