api: make getCanvasTilePoly work on multi-tile npcs
This commit is contained in:
@@ -283,7 +283,7 @@ public interface Actor extends Renderable
|
|||||||
void setSpotAnimFrame(int spotAnimFrame);
|
void setSpotAnimFrame(int spotAnimFrame);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the canvas area of the current tile the actor is standing on.
|
* Gets the canvas area of the current tiles the actor is standing on.
|
||||||
*
|
*
|
||||||
* @return the current tile canvas area
|
* @return the current tile canvas area
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ import java.util.Set;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.NPCComposition;
|
|
||||||
import net.runelite.api.Perspective;
|
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.Tile;
|
import net.runelite.api.Tile;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
@@ -157,11 +155,7 @@ class AgilityOverlay extends Overlay
|
|||||||
Color color = config.sepulchreHighlightColor();
|
Color color = config.sepulchreHighlightColor();
|
||||||
for (NPC npc : npcs)
|
for (NPC npc : npcs)
|
||||||
{
|
{
|
||||||
NPCComposition npcComposition = npc.getComposition();
|
Polygon tilePoly = npc.getCanvasTilePoly();
|
||||||
int size = npcComposition.getSize();
|
|
||||||
LocalPoint lp = npc.getLocalLocation();
|
|
||||||
|
|
||||||
Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
|
|
||||||
if (tilePoly != null)
|
if (tilePoly != null)
|
||||||
{
|
{
|
||||||
OverlayUtil.renderPolygon(graphics, tilePoly, color);
|
OverlayUtil.renderPolygon(graphics, tilePoly, color);
|
||||||
|
|||||||
@@ -162,10 +162,7 @@ public class NpcSceneOverlay extends Overlay
|
|||||||
|
|
||||||
if (highlightedNpc.isTile())
|
if (highlightedNpc.isTile())
|
||||||
{
|
{
|
||||||
int size = npcComposition.getSize();
|
Polygon tilePoly = actor.getCanvasTilePoly();
|
||||||
LocalPoint lp = actor.getLocalLocation();
|
|
||||||
Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
|
|
||||||
|
|
||||||
renderPoly(graphics, borderColor, fillColor, tilePoly);
|
renderPoly(graphics, borderColor, fillColor, tilePoly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user