Add Makruk, Shako and Shogi + a few fixes
[vchess.git] / client / src / components / Board.vue
index e6a0aaf..8a42d34 100644 (file)
@@ -60,8 +60,10 @@ export default {
     if (!!lm) {
       if (!Array.isArray(lm)) lm = [lm];
       lm.forEach(m => {
-        lmHighlights[m.start.x + sizeX * m.start.y] = true;
-        lmHighlights[m.end.x + sizeX * m.end.y] = true;
+        if (V.OnBoard(m.start.x, m.start.y))
+          lmHighlights[m.start.x + sizeX * m.start.y] = true;
+        if (V.OnBoard(m.end.x, m.end.y))
+          lmHighlights[m.end.x + sizeX * m.end.y] = true;
       });
     }
     const showLight = (
@@ -212,7 +214,7 @@ export default {
                 attrs: {
                   src:
                     "/images/pieces/" +
-                    this.vr.getReservePpath(i, playingColor) +
+                    this.vr.getReservePpath(i, playingColor, orientation) +
                     ".svg"
                 }
               }),
@@ -239,7 +241,7 @@ export default {
                 attrs: {
                   src:
                     "/images/pieces/" +
-                    this.vr.getReservePpath(i, oppCol) +
+                    this.vr.getReservePpath(i, oppCol, orientation) +
                     ".svg"
                 }
               }),
@@ -709,6 +711,8 @@ export default {
 </script>
 
 <style lang="sass" scoped>
+@import "@/styles/_board_squares_img.sass";
+
 // NOTE: no variants with reserve of size != 8
 .game.reserve-div
   margin-bottom: 18px
@@ -802,5 +806,4 @@ img.ghost
   background-color: #9f9fff
 .dark-square.chesstempo.highlight-dark
   background-color: #557fff
-
 </style>