From df1bfb67b3007fd2249ffe89d22eed095f977d8f Mon Sep 17 00:00:00 2001 From: RShnitser Date: Sat, 26 Oct 2024 20:44:28 -0400 Subject: [PATCH] add flicker to preview cardboard --- src/utility/hexgrid.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/utility/hexgrid.ts b/src/utility/hexgrid.ts index 9bae5406f..e899a4256 100644 --- a/src/utility/hexgrid.ts +++ b/src/utility/hexgrid.ts @@ -139,6 +139,7 @@ export class HexGrid { materialize_overlay: any; secondary_overlay: any; lastQueryOpt: any; + _flickerTween: any; get allhexes(): Hex[] { return this.hexes.flat(1); @@ -873,6 +874,10 @@ export class HexGrid { this.secondary_overlay.alpha = 0; } + if(this._flickerTween){ + this._flickerTween.stop(true); + } + if (!o.ownCreatureHexShade) { if (o.id instanceof Array) { o.id.forEach((id) => { @@ -1671,6 +1676,18 @@ export class HexGrid { preview.scale.setTo(1, 1); } + this._flickerTween = game.Phaser.add + .tween(preview).to( + { + alpha: 0.1, + }, + 500, + Phaser.Easing.Linear.None, + ) + .yoyo(true) + .repeat(-1) + .start(); + for (let i = 0, size = creatureData.size; i < size; i++) { const hexInstance = this.hexes[pos.y][pos.x - i]; this.cleanHex(hexInstance);