Some fixes + work on Dynamo draft. Also listen for clicks in Board.vue
[vchess.git] / client / src / components / BaseGame.vue
index 0ed908a..51d087a 100644 (file)
@@ -21,6 +21,7 @@ div#baseGame
         :vname="game.vname"
         :incheck="incheck"
         @play-move="play"
+        @click-square="clickSquare"
       )
       #turnIndicator(v-if="showTurn") {{ turn }}
       #controls.button-group
@@ -364,6 +365,11 @@ export default {
         );
       }
     },
+    clickSquare: function(square) {
+      // Some variants make use of a single click at specific times:
+      const move = this.vr.doClick(square);
+      if (!!move) this.play(move);
+    },
     // "light": if gotoMove() or gotoEnd()
     play: function(move, received, light, noemit) {
       // Freeze while choices are shown: