Incorporate height into the GroundItems overlay
This commit is contained in:
@@ -26,6 +26,8 @@ package net.runelite.api;
|
|||||||
|
|
||||||
public interface ItemLayer extends TileObject
|
public interface ItemLayer extends TileObject
|
||||||
{
|
{
|
||||||
|
int getHeight();
|
||||||
|
|
||||||
Renderable getBottom();
|
Renderable getBottom();
|
||||||
|
|
||||||
Renderable getMiddle();
|
Renderable getMiddle();
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ public interface TileObject
|
|||||||
|
|
||||||
Point getCanvasLocation();
|
Point getCanvasLocation();
|
||||||
|
|
||||||
|
Point getCanvasLocation(int zOffset);
|
||||||
|
|
||||||
Polygon getCanvasTilePoly();
|
Polygon getCanvasTilePoly();
|
||||||
|
|
||||||
Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset);
|
Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset);
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
|
|
||||||
for (int i = 0; i < itemIds.size(); ++i)
|
for (int i = 0; i < itemIds.size(); ++i)
|
||||||
{
|
{
|
||||||
Point point = itemLayer.getCanvasLocation();
|
Point point = itemLayer.getCanvasLocation(itemLayer.getHeight());
|
||||||
// if the item is offscreen, don't bother drawing it
|
// if the item is offscreen, don't bother drawing it
|
||||||
if (point == null || (viewport != null && !viewport.contains(point)))
|
if (point == null || (viewport != null && !viewport.contains(point)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -85,16 +85,23 @@ public abstract class TileObjectMixin implements TileObject
|
|||||||
@Inject
|
@Inject
|
||||||
public Point getRegionLocation()
|
public Point getRegionLocation()
|
||||||
{
|
{
|
||||||
Point locaLocation = getLocalLocation();
|
Point localLocation = getLocalLocation();
|
||||||
return new Point(locaLocation.getX() >>> LOCAL_COORD_BITS, locaLocation.getY() >>> LOCAL_COORD_BITS);
|
return new Point(localLocation.getX() >>> LOCAL_COORD_BITS, localLocation.getY() >>> LOCAL_COORD_BITS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Inject
|
@Inject
|
||||||
public Point getCanvasLocation()
|
public Point getCanvasLocation()
|
||||||
{
|
{
|
||||||
Point locaLocation = getLocalLocation();
|
return getCanvasLocation(0);
|
||||||
return Perspective.worldToCanvas(client, locaLocation.getX(), locaLocation.getY(), 0);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Inject
|
||||||
|
public Point getCanvasLocation(int zOffset)
|
||||||
|
{
|
||||||
|
Point localLocation = getLocalLocation();
|
||||||
|
return Perspective.worldToCanvas(client, localLocation.getX(), localLocation.getY(), 0, zOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user