|
|
|
@ -310,19 +310,15 @@ class Overlay
|
|
|
|
|
&& _hoveredTile != null
|
|
|
|
|
) {
|
|
|
|
|
val hoveredTile = _hoveredTile.sceneLocation
|
|
|
|
|
renderTile(gfx, hoveredTile, Color(0, 0, 255), 1.0)
|
|
|
|
|
|
|
|
|
|
when (val p = findPath(
|
|
|
|
|
findPath(
|
|
|
|
|
playerTrueTile,
|
|
|
|
|
hoveredTile,
|
|
|
|
|
collisionFlags,
|
|
|
|
|
tiles,
|
|
|
|
|
)) {
|
|
|
|
|
null -> emptySequence<ScenePoint>()
|
|
|
|
|
else -> p
|
|
|
|
|
}
|
|
|
|
|
)?.toList()
|
|
|
|
|
} else {
|
|
|
|
|
emptySequence<ScenePoint>()
|
|
|
|
|
null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val destinationPoint = client.getLocalDestinationLocation()
|
|
|
|
@ -334,38 +330,102 @@ class Overlay
|
|
|
|
|
destinationPoint.sceneX,
|
|
|
|
|
destinationPoint.sceneY,
|
|
|
|
|
)
|
|
|
|
|
when (val p = findPath(
|
|
|
|
|
|
|
|
|
|
findPath(
|
|
|
|
|
playerTrueTile,
|
|
|
|
|
destinationTile,
|
|
|
|
|
collisionFlags,
|
|
|
|
|
tiles,
|
|
|
|
|
)) {
|
|
|
|
|
null -> emptySequence<ScenePoint>()
|
|
|
|
|
else -> p
|
|
|
|
|
}
|
|
|
|
|
)?.toList()
|
|
|
|
|
} else {
|
|
|
|
|
emptySequence<ScenePoint>()
|
|
|
|
|
null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
paintTiles(
|
|
|
|
|
gfx,
|
|
|
|
|
hoveredPathTiles,
|
|
|
|
|
config.highlightHoveredBorder(),
|
|
|
|
|
config.highlightHoveredBorderWidth(),
|
|
|
|
|
)
|
|
|
|
|
paintTiles(
|
|
|
|
|
val overlappingTiles = when (config.highlightOverlapping()) {
|
|
|
|
|
true -> {
|
|
|
|
|
if (
|
|
|
|
|
(destinationPathTiles == null)
|
|
|
|
|
|| (hoveredPathTiles == null)
|
|
|
|
|
) {
|
|
|
|
|
null
|
|
|
|
|
} else {
|
|
|
|
|
destinationPathTiles
|
|
|
|
|
.toSet()
|
|
|
|
|
.intersect(hoveredPathTiles.toSet())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
false -> null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doPaint(
|
|
|
|
|
gfx,
|
|
|
|
|
destinationPathTiles,
|
|
|
|
|
config.highlightDestinationBorder(),
|
|
|
|
|
config.highlightDestinationBorderWidth(),
|
|
|
|
|
hoveredPathTiles,
|
|
|
|
|
overlappingTiles,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun doPaint(
|
|
|
|
|
gfx: Graphics2D,
|
|
|
|
|
destinationPathTiles: Iterable<ScenePoint>?,
|
|
|
|
|
hoveredPathTiles: Iterable<ScenePoint>?,
|
|
|
|
|
overlappingTiles: Set<ScenePoint>?,
|
|
|
|
|
) {
|
|
|
|
|
if (overlappingTiles != null) {
|
|
|
|
|
val ot = destinationPathTiles!!.filter({t ->
|
|
|
|
|
overlappingTiles.contains(t)
|
|
|
|
|
})
|
|
|
|
|
val dpt = destinationPathTiles.filter({t ->
|
|
|
|
|
!overlappingTiles.contains(t)
|
|
|
|
|
})
|
|
|
|
|
val hpt = hoveredPathTiles!!.filter({t ->
|
|
|
|
|
!overlappingTiles.contains(t)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
paintTiles(
|
|
|
|
|
gfx,
|
|
|
|
|
ot,
|
|
|
|
|
config.highlightOverlappingBorder(),
|
|
|
|
|
config.highlightOverlappingBorderWidth(),
|
|
|
|
|
)
|
|
|
|
|
paintTiles(
|
|
|
|
|
gfx,
|
|
|
|
|
dpt,
|
|
|
|
|
config.highlightDestinationBorder(),
|
|
|
|
|
config.highlightDestinationBorderWidth(),
|
|
|
|
|
)
|
|
|
|
|
paintTiles(
|
|
|
|
|
gfx,
|
|
|
|
|
hpt,
|
|
|
|
|
config.highlightHoveredBorder(),
|
|
|
|
|
config.highlightHoveredBorderWidth(),
|
|
|
|
|
)
|
|
|
|
|
} else {
|
|
|
|
|
if (destinationPathTiles != null) {
|
|
|
|
|
paintTiles(
|
|
|
|
|
gfx,
|
|
|
|
|
destinationPathTiles,
|
|
|
|
|
config.highlightDestinationBorder(),
|
|
|
|
|
config.highlightDestinationBorderWidth(),
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hoveredPathTiles != null) {
|
|
|
|
|
paintTiles(
|
|
|
|
|
gfx,
|
|
|
|
|
hoveredPathTiles,
|
|
|
|
|
config.highlightHoveredBorder(),
|
|
|
|
|
config.highlightHoveredBorderWidth(),
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fun paintTiles(
|
|
|
|
|
gfx: Graphics2D,
|
|
|
|
|
tiles: Sequence<ScenePoint>,
|
|
|
|
|
tiles: Iterable<ScenePoint>,
|
|
|
|
|
color: Color,
|
|
|
|
|
borderWidth: Double,
|
|
|
|
|
) {
|
|
|
|
|