object indicators: add ability to mark wall objects

This commit is contained in:
dekvall
2019-10-01 14:28:39 +02:00
parent 3819994572
commit 047861d8cd
2 changed files with 38 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ import net.runelite.api.Client;
import net.runelite.api.DecorativeObject;
import net.runelite.api.GameObject;
import net.runelite.api.TileObject;
import net.runelite.api.WallObject;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
@@ -72,6 +73,11 @@ class ObjectIndicatorsOverlay extends Overlay
{
polygon = ((GameObject) object).getConvexHull();
}
else if (object instanceof WallObject)
{
polygon = ((WallObject) object).getConvexHull();
polygon2 = ((WallObject) object).getConvexHull2();
}
else if (object instanceof DecorativeObject)
{
polygon = ((DecorativeObject) object).getConvexHull();

View File

@@ -51,6 +51,7 @@ import net.runelite.api.ObjectComposition;
import net.runelite.api.Scene;
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.FocusChanged;
import net.runelite.api.events.GameObjectDespawned;
@@ -60,6 +61,9 @@ 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;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.input.KeyListener;
@@ -157,6 +161,28 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
}
}
@Subscribe
public void onWallObjectSpawned(WallObjectSpawned event)
{
checkObjectPoints(event.getWallObject());
}
@Subscribe
public void onWallObjectChanged(WallObjectChanged event)
{
WallObject previous = event.getPrevious();
WallObject wallObject = event.getWallObject();
objects.remove(previous);
checkObjectPoints(wallObject);
}
@Subscribe
public void onWallObjectDespawned(WallObjectDespawned event)
{
objects.remove(event.getWallObject());
}
@Subscribe
public void onGameObjectSpawned(GameObjectSpawned event)
{
@@ -296,6 +322,12 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
final GameObject[] tileGameObjects = tile.getGameObjects();
final DecorativeObject tileDecorativeObject = tile.getDecorativeObject();
final WallObject tileWallObject = tile.getWallObject();
if (tileWallObject != null && tileWallObject.getId() == id)
{
return tileWallObject;
}
if (tileDecorativeObject != null && tileDecorativeObject.getId() == id)
{