X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=9878039ee8a260c8484c3095d486b57e67acfabd;hb=691d6952114dd716ca66193a029f5e60be50888c;hp=ccf9d73447f4146f4b948299e7ad8b940be24f92;hpb=d6289b54e43a80375ec91ef74730ebfbe180afa7;p=vchess.git diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index ccf9d734..9878039e 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -274,6 +274,7 @@ export default { fen = mv[mv.length-1].fen; } this.vr = new V(fen); + this.incheck = this.vr.getCheckSquares(); document.getElementById("analyzeBtn").classList.remove("active"); } }, @@ -429,6 +430,10 @@ export default { return; } if (!!received) { + + if (this.mode == "analyze") { console.log("received move"); + console.log(move); } + if (this.mode == "analyze") this.toggleAnalyze(); if (this.cursor < this.moves.length - 1) // To play a received move, cursor must be at the end of the game: @@ -485,12 +490,16 @@ export default { let self = this; const initurn = this.vr.turn; (function executeMove() { +console.log("execute move " + move.length); const smove = move[moveIdx++]; // 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); @@ -522,6 +531,9 @@ export default { }; const afterMove = (smove, initurn) => { if (this.vr.turn != initurn) { + +console.log(smove); + // Turn has changed: move is complete if (!smove.fen) // NOTE: only FEN of last sub-move is required (=> setting it here)