X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FBaseGame.vue;h=8a053765c56a680aac22cb4eb42a220f41e3e549;hb=cd49e617866590dbc68530ad961b109cdbe1ce55;hp=7424aa40c80a4efc42d74f228a9d333ee1edd0fc;hpb=e0f26496c4e0e335055ea63d6cba75167ed7f77e;p=vchess.git diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index 7424aa40..8a053765 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -212,6 +212,10 @@ export default { this.moves = JSON.parse(JSON.stringify(game.moves || [])); // Post-processing: decorate each move with notation and FEN this.vr = new V(game.fenStart); + this.inMultimove = false; //in case of + this.$refs["board"].resetCurrentAttempt(); //also in case of + let analyseBtn = document.getElementById("analyzeBtn"); + if (!!analyseBtn) analyseBtn.classList.remove("active"); const parsedFen = V.ParseFen(game.fenStart); const firstMoveColor = parsedFen.turn; this.firstMoveNumber = Math.floor(parsedFen.movesCount / 2) + 1; @@ -258,8 +262,8 @@ export default { else this.lastMove = null; }, toggleAnalyze: function() { - // Autoplay has priority: - if (this.autoplay) return; + // Freeze while choices are shown (and autoplay has priority) + if (this.$refs["board"].choices.length > 0 || this.autoplay) return; if (this.mode != "analyze") { // Enter analyze mode: if (this.inMultimove) this.cancelCurrentMultimove(); @@ -281,6 +285,8 @@ export default { fen = mv[mv.length-1].fen; } this.vr = new V(fen); + this.inMultimove = false; //in case of + this.$refs["board"].resetCurrentAttempt(); //also in case of this.incheck = this.vr.getCheckSquares(); if (this.cursor >= 0) this.lastMove = this.moves[this.cursor]; else this.lastMove = null; @@ -590,6 +596,8 @@ export default { if (this.inMultimove) { this.cancelCurrentMultimove(); this.incheck = this.vr.getCheckSquares(); + if (this.cursor >= 0) this.lastMove = this.moves[this.cursor]; + else this.lastMove = null; } else { if (!move) { const minCursor =