X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=30533f7040a871a58abe0628aab7b800d5d04b87;hb=8aa314fa9fea7d308d877a528c40af23973f372d;hp=df2e8af5944f915486f2d899e67fe0322bbc2e0f;hpb=0f0552a7e966246b9c81dda5e1ca2cb1fddd8961;p=vchess.git diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index df2e8af5..30533f70 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -275,6 +275,8 @@ export default { } this.vr = new V(fen); this.incheck = this.vr.getCheckSquares(); + if (this.cursor >= 0) this.lastMove = this.moves[this.cursor]; + else this.lastMove = null; document.getElementById("analyzeBtn").classList.remove("active"); } }, @@ -490,12 +492,21 @@ export default { let self = this; const initurn = this.vr.turn; (function executeMove() { +console.log("execute move " + move.length); const smove = move[moveIdx++]; + +console.log(smove); + console.log(animate + " " + smove.start.x); + + // NOTE: condition "smove.start.x >= 0" required for Dynamo, // because second move may be empty. if (animate && smove.start.x >= 0) { self.animateMove(smove, () => { playSubmove(smove); + +console.log(moveIdx + " " + move.length); + if (moveIdx < move.length) setTimeout(executeMove, 500); else afterMove(smove, initurn);