From: Benjamin Auder Date: Sat, 29 Feb 2020 03:15:20 +0000 (+0100) Subject: Prepare images for Knightmate variant. Fix lastMove.fen early assignment (when =... X-Git-Url: https://git.auder.net/variants/current/doc/DESCRIPTION?a=commitdiff_plain;h=cc00b83cd8e91a3defa99acc95ee8bc7e6c8a819;p=vchess.git Prepare images for Knightmate variant. Fix lastMove.fen early assignment (when == null) in BaseGame --- diff --git a/client/public/images/pieces/Knightmate/bc.svg b/client/public/images/pieces/Knightmate/bc.svg new file mode 100644 index 00000000..09954492 --- /dev/null +++ b/client/public/images/pieces/Knightmate/bc.svg @@ -0,0 +1,105 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Knightmate/bn.svg b/client/public/images/pieces/Knightmate/bn.svg new file mode 100644 index 00000000..ad8982a5 --- /dev/null +++ b/client/public/images/pieces/Knightmate/bn.svg @@ -0,0 +1,83 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Knightmate/wc.svg b/client/public/images/pieces/Knightmate/wc.svg new file mode 100644 index 00000000..12f2b27a --- /dev/null +++ b/client/public/images/pieces/Knightmate/wc.svg @@ -0,0 +1,94 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/public/images/pieces/Knightmate/wn.svg b/client/public/images/pieces/Knightmate/wn.svg new file mode 100644 index 00000000..e6fd8530 --- /dev/null +++ b/client/public/images/pieces/Knightmate/wn.svg @@ -0,0 +1,66 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/client/src/components/BaseGame.vue b/client/src/components/BaseGame.vue index 5fbc257b..100f7efb 100644 --- a/client/src/components/BaseGame.vue +++ b/client/src/components/BaseGame.vue @@ -359,6 +359,9 @@ export default { new Audio("/sounds/move.mp3").play().catch(() => {}); if (this.vr.turn != initurn) { // Turn has changed: move is complete + if (!smove.fen) + // NOTE: only FEN of last sub-move is required (thus setting it here) + smove.fen = this.vr.getFen(); this.inMultimove = false; const score = this.vr.getCurrentScore(); if (score != "*") { @@ -405,7 +408,6 @@ export default { if (received && this.cursor < this.moves.length - 1) this.gotoEnd(); playMove(); - this.lastMove.fen = this.vr.getFen(); this.emitFenIfAnalyze(); }, cancelCurrentMultimove: function() { diff --git a/client/src/translations/rules/Shatranj/en.pug b/client/src/translations/rules/Shatranj/en.pug index 5f65c1a2..ec346ef6 100644 --- a/client/src/translations/rules/Shatranj/en.pug +++ b/client/src/translations/rules/Shatranj/en.pug @@ -8,8 +8,8 @@ ul li There is no castling option. li Stalemate or bare king counts as a win, but two bare kings count as a draw. p. - Note: the general is still represented as a queen, because I didn't find an - appropriate image. Please tell me if you have one :) + Note: I didn't find nice images for general and elephants. + Please tell me if you have some :) p | I implemented a slightly different version of Shatranj diff --git a/client/src/translations/rules/Shatranj/es.pug b/client/src/translations/rules/Shatranj/es.pug index d4c7116c..a5a68d31 100644 --- a/client/src/translations/rules/Shatranj/es.pug +++ b/client/src/translations/rules/Shatranj/es.pug @@ -10,8 +10,8 @@ ul El empate y un rey desnudo cuentan como una victoria, pero solo dos reyes es equivalente a tablas. p. - Nota: el general todavía está representado por una dama, porque - No encontré una imagen adecuada. Dime si tienes uno :) + Nota: no encontré imágenes bonitas para el general y los elefantes. + Dime si tienes algo :) p | Implementé una versión ligeramente diferente de Shatranj como diff --git a/client/src/translations/rules/Shatranj/fr.pug b/client/src/translations/rules/Shatranj/fr.pug index b0a1bdba..3029c3bf 100644 --- a/client/src/translations/rules/Shatranj/fr.pug +++ b/client/src/translations/rules/Shatranj/fr.pug @@ -10,8 +10,8 @@ ul Le pat ainsi qu'un roi nu compte comme une victoire, mais deux rois seuls équivaut à un match nul. p. - Note : le général est encore représenté par une dame, parce que - je n'ai pas trouvé d'image appropriée. Dites-moi si vous en avez une :) + Note : je n'ai pas trouvé de jolies images pour le général et les éléphants. + Dites-moi si vous en avez :) p | J'ai implémenté une version légèrement différente du Shatranj telle que