|
|
|
@ -457,6 +457,12 @@ class Overlay
|
|
|
|
|
config.highlightHoveredBorder(),
|
|
|
|
|
config.highlightHoveredBorderWidth(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if (config.drawTickDistance()) {
|
|
|
|
|
paintTicks(gfx, ot)
|
|
|
|
|
paintTicks(gfx, hpt, ot.size)
|
|
|
|
|
paintTicks(gfx, dpt, ot.size)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (destinationPathTiles != null) {
|
|
|
|
|
paintTiles(
|
|
|
|
@ -465,6 +471,10 @@ class Overlay
|
|
|
|
|
config.highlightDestinationBorder(),
|
|
|
|
|
config.highlightDestinationBorderWidth(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if (config.drawTickDistance()) {
|
|
|
|
|
paintTicks(gfx, destinationPathTiles)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hoveredPathTiles != null) {
|
|
|
|
@ -474,6 +484,10 @@ class Overlay
|
|
|
|
|
config.highlightHoveredBorder(),
|
|
|
|
|
config.highlightHoveredBorderWidth(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if (config.drawTickDistance()) {
|
|
|
|
|
paintTicks(gfx, hoveredPathTiles)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -501,9 +515,35 @@ class Overlay
|
|
|
|
|
OverlayUtil.renderPolygon(gfx, poly, borderColor, Color(0, 0, 0, 0), BasicStroke(borderWidth.toFloat()))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun paintTicks(
|
|
|
|
|
gfx: Graphics2D,
|
|
|
|
|
tiles: Iterable<ScenePoint>,
|
|
|
|
|
offset: Int = 0,
|
|
|
|
|
) {
|
|
|
|
|
for (tile in tiles.withIndex()) {
|
|
|
|
|
renderTick(gfx, tile.value, tile.index + offset)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun renderTick(
|
|
|
|
|
gfx: Graphics2D,
|
|
|
|
|
tile: ScenePoint,
|
|
|
|
|
tick: Int,
|
|
|
|
|
) {
|
|
|
|
|
val lp = LocalPoint.fromScene(tile.getX(), tile.getY())
|
|
|
|
|
val str = "${tick}"
|
|
|
|
|
val loc = Perspective.getCanvasTextLocation(client, gfx, lp, str, 0)
|
|
|
|
|
if (loc == null) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OverlayUtil.renderTextLocation(gfx, loc, str, Color(255, 255, 255))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun isRunning(): Boolean {
|
|
|
|
|
val willRun = client.getVarpValue(173) == 1
|
|
|
|
|
// TODO: handle ctrl-clicks
|
|
|
|
|
// TODO: handle other conditions
|
|
|
|
|
|
|
|
|
|
return willRun
|
|
|
|
|
}
|
|
|
|
|