Track the path taken by tokens in combat and display it when reactivating DragRuler in the same turn

This commit is contained in:
Manuel Vögele
2021-04-02 23:24:48 +02:00
parent dec422fa3a
commit c66ec46aed
6 changed files with 125 additions and 21 deletions
+5 -2
View File
@@ -39,11 +39,14 @@ export function getSnapPointForToken(x, y, token) {
return new PIXI.Point(snappedX + canvas.grid.w / 2, snappedY + canvas.grid.h / 2)
}
export function highlightTokenShape(position, shape, color) {
export function highlightTokenShape(position, shape, color, alpha) {
const layer = canvas.grid.highlightLayers[this.name];
if ( !layer )
return false;
const area = getAreaFromPositionAndShape(position, shape);
for (const space of area) {
const [x, y] = getPixelsFromGridPosition(space.x, space.y);
canvas.grid.highlightPosition(this.name, {x, y, color})
canvas.grid.grid.highlightGridPosition(layer, {x, y, color, alpha: 0.25 * alpha});
}
}