Merge pull request #9953 from dekvall/improve-object-markers
object indicators: add ability to mark wall objects
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api;
|
package net.runelite.api;
|
||||||
|
|
||||||
|
import java.awt.Polygon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents one or two walls on a tile
|
* Represents one or two walls on a tile
|
||||||
*/
|
*/
|
||||||
@@ -55,6 +57,15 @@ public interface WallObject extends TileObject
|
|||||||
*/
|
*/
|
||||||
int getConfig();
|
int getConfig();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the convex hull of the objects model.
|
||||||
|
*
|
||||||
|
* @return the convex hull
|
||||||
|
* @see net.runelite.api.model.Jarvis
|
||||||
|
*/
|
||||||
|
Polygon getConvexHull();
|
||||||
|
Polygon getConvexHull2();
|
||||||
|
|
||||||
Renderable getRenderable1();
|
Renderable getRenderable1();
|
||||||
Renderable getRenderable2();
|
Renderable getRenderable2();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import net.runelite.api.Client;
|
|||||||
import net.runelite.api.DecorativeObject;
|
import net.runelite.api.DecorativeObject;
|
||||||
import net.runelite.api.GameObject;
|
import net.runelite.api.GameObject;
|
||||||
import net.runelite.api.TileObject;
|
import net.runelite.api.TileObject;
|
||||||
|
import net.runelite.api.WallObject;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
@@ -72,6 +73,11 @@ class ObjectIndicatorsOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
polygon = ((GameObject) object).getConvexHull();
|
polygon = ((GameObject) object).getConvexHull();
|
||||||
}
|
}
|
||||||
|
else if (object instanceof WallObject)
|
||||||
|
{
|
||||||
|
polygon = ((WallObject) object).getConvexHull();
|
||||||
|
polygon2 = ((WallObject) object).getConvexHull2();
|
||||||
|
}
|
||||||
else if (object instanceof DecorativeObject)
|
else if (object instanceof DecorativeObject)
|
||||||
{
|
{
|
||||||
polygon = ((DecorativeObject) object).getConvexHull();
|
polygon = ((DecorativeObject) object).getConvexHull();
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import net.runelite.api.ObjectComposition;
|
|||||||
import net.runelite.api.Scene;
|
import net.runelite.api.Scene;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
import net.runelite.api.TileObject;
|
import net.runelite.api.TileObject;
|
||||||
|
import net.runelite.api.WallObject;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.api.events.FocusChanged;
|
import net.runelite.api.events.FocusChanged;
|
||||||
import net.runelite.api.events.GameObjectDespawned;
|
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.MenuOptionClicked;
|
||||||
import net.runelite.api.events.DecorativeObjectSpawned;
|
import net.runelite.api.events.DecorativeObjectSpawned;
|
||||||
import net.runelite.api.events.DecorativeObjectDespawned;
|
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.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.input.KeyListener;
|
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
|
@Subscribe
|
||||||
public void onGameObjectSpawned(GameObjectSpawned event)
|
public void onGameObjectSpawned(GameObjectSpawned event)
|
||||||
{
|
{
|
||||||
@@ -296,6 +322,12 @@ public class ObjectIndicatorsPlugin extends Plugin implements KeyListener
|
|||||||
|
|
||||||
final GameObject[] tileGameObjects = tile.getGameObjects();
|
final GameObject[] tileGameObjects = tile.getGameObjects();
|
||||||
final DecorativeObject tileDecorativeObject = tile.getDecorativeObject();
|
final DecorativeObject tileDecorativeObject = tile.getDecorativeObject();
|
||||||
|
final WallObject tileWallObject = tile.getWallObject();
|
||||||
|
|
||||||
|
if (tileWallObject != null && tileWallObject.getId() == id)
|
||||||
|
{
|
||||||
|
return tileWallObject;
|
||||||
|
}
|
||||||
|
|
||||||
if (tileDecorativeObject != null && tileDecorativeObject.getId() == id)
|
if (tileDecorativeObject != null && tileDecorativeObject.getId() == id)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user