Thin tile outline for NPC indicators
This commit is contained in:
@@ -180,6 +180,7 @@ public class NpcSceneOverlay extends Overlay
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TILE:
|
case TILE:
|
||||||
|
{
|
||||||
int size = 1;
|
int size = 1;
|
||||||
NPCDefinition composition = actor.getTransformedDefinition();
|
NPCDefinition composition = actor.getTransformedDefinition();
|
||||||
if (composition != null)
|
if (composition != null)
|
||||||
@@ -190,6 +191,20 @@ public class NpcSceneOverlay extends Overlay
|
|||||||
final Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
|
final Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
|
||||||
renderPoly(graphics, color, tilePoly);
|
renderPoly(graphics, color, tilePoly);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case THIN_TILE:
|
||||||
|
{
|
||||||
|
int size = 1;
|
||||||
|
NPCDefinition composition = actor.getTransformedDefinition();
|
||||||
|
if (composition != null)
|
||||||
|
{
|
||||||
|
size = composition.getSize();
|
||||||
|
}
|
||||||
|
final LocalPoint lp = actor.getLocalLocation();
|
||||||
|
final Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
|
||||||
|
renderPoly(graphics, color, tilePoly, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case HULL:
|
case HULL:
|
||||||
final Shape objectClickbox = actor.getConvexHull();
|
final Shape objectClickbox = actor.getConvexHull();
|
||||||
graphics.setColor(color);
|
graphics.setColor(color);
|
||||||
@@ -208,8 +223,9 @@ public class NpcSceneOverlay extends Overlay
|
|||||||
modelOutliner.drawOutline(actor, 8, color, TRANSPARENT);
|
modelOutliner.drawOutline(actor, 8, color, TRANSPARENT);
|
||||||
break;
|
break;
|
||||||
case TRUE_LOCATIONS:
|
case TRUE_LOCATIONS:
|
||||||
size = 1;
|
{
|
||||||
composition = actor.getTransformedDefinition();
|
int size = 1;
|
||||||
|
NPCDefinition composition = actor.getTransformedDefinition();
|
||||||
|
|
||||||
if (composition != null)
|
if (composition != null)
|
||||||
{
|
{
|
||||||
@@ -222,6 +238,7 @@ public class NpcSceneOverlay extends Overlay
|
|||||||
getSquare(wp, size).forEach(square ->
|
getSquare(wp, size).forEach(square ->
|
||||||
drawTile(graphics, square, squareColor, 1, 255, 50));
|
drawTile(graphics, square, squareColor, 1, 255, 50));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.isDrawNames() && actor.getName() != null)
|
if (plugin.isDrawNames() && actor.getName() != null)
|
||||||
@@ -260,6 +277,18 @@ public class NpcSceneOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void renderPoly(Graphics2D graphics, Color color, Polygon polygon, int width)
|
||||||
|
{
|
||||||
|
if (polygon != null)
|
||||||
|
{
|
||||||
|
graphics.setColor(color);
|
||||||
|
graphics.setStroke(new BasicStroke(width));
|
||||||
|
graphics.draw(polygon);
|
||||||
|
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20));
|
||||||
|
graphics.fill(polygon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private List<WorldPoint> getSquare(WorldPoint npcLoc, int npcSize)
|
private List<WorldPoint> getSquare(WorldPoint npcLoc, int npcSize)
|
||||||
{
|
{
|
||||||
return new WorldArea(npcLoc.getX(), npcLoc.getY(), npcSize, npcSize, npcLoc.getPlane()).toWorldPointList();
|
return new WorldArea(npcLoc.getX(), npcLoc.getY(), npcSize, npcSize, npcLoc.getPlane()).toWorldPointList();
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public enum RenderStyle
|
|||||||
{
|
{
|
||||||
OFF,
|
OFF,
|
||||||
TILE,
|
TILE,
|
||||||
|
THIN_TILE,
|
||||||
HULL,
|
HULL,
|
||||||
SOUTH_WEST_TILE,
|
SOUTH_WEST_TILE,
|
||||||
THIN_OUTLINE,
|
THIN_OUTLINE,
|
||||||
|
|||||||
Reference in New Issue
Block a user