From 03883a0d1495bc6e6fadc3a11aa99286aba5c9e1 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Tue, 2 Jan 2024 16:03:28 +0100
Subject: [PATCH] Fix Dice display

---
 variants/Dice/class.js  | 32 ++++++++++++--------------------
 variants/Dice/style.css | 11 ++++++-----
 2 files changed, 18 insertions(+), 25 deletions(-)

diff --git a/variants/Dice/class.js b/variants/Dice/class.js
index 1bb6f1f..53836eb 100644
--- a/variants/Dice/class.js
+++ b/variants/Dice/class.js
@@ -61,29 +61,21 @@ export default class DiceRules extends ChessRules {
     };
   }
 
-  static get PieceToUnicode() {
-    return {
-      'K': "&#9812;",
-      'Q': "&#9813;",
-      'R': "&#9814;",
-      'B': "&#9815;",
-      'N': "&#9816;",
-      'P': "&#9817;",
-      'k': "&#9818;",
-      'q': "&#9819;",
-      'r': "&#9820;",
-      'b': "&#9821;",
-      'n': "&#9822;",
-      'p': "&#9823;"
-    };
-  }
-
   displayMessage(piece, color) {
-    if (color == 'w')
-      piece = piece.toUpperCase();
+    if (color == 'b') {
+      const blackPieceToCode = {
+        'k': 'l',
+        'p': 'o',
+        'n': 'm',
+        'b': 'v',
+        'q': 'w',
+        'r': 't'
+      };
+      piece = blackPieceToCode[piece];
+    }
     super.displayMessage(this.message,
       '<span>to play:</span> ' +
-      '<span class="symb">' + V.PieceToUnicode[piece] + '</span>'
+      '<span class="symb">' + piece + '</span>'
     );
   }
 
diff --git a/variants/Dice/style.css b/variants/Dice/style.css
index c9ed898..ad11010 100644
--- a/variants/Dice/style.css
+++ b/variants/Dice/style.css
@@ -1,10 +1,9 @@
 @import url("/base_pieces.css");
 
-/* doesn't work:
 @font-face {
   font-family: chess-font;
-  src: url(/assets/FreeSerifBold-rdMp.otf);
-} */
+  src: url(/assets/MERIFONT.TTF);
+}
 
 div.piece-text {
   position: relative;
@@ -17,7 +16,9 @@ div.piece-text {
   font-size: 1.7em;
 }
 
-/*
 div.piece-text > span.symb {
   font-family: chess-font;
-} */
+  display: inline-block;
+  position: relative;
+  top: 5px;
+}
-- 
2.44.0