add score to current player
authorLaurent Mazet <mazet@softndesign.org>
Mon, 7 Sep 2020 20:32:51 +0000 (22:32 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Mon, 7 Sep 2020 20:32:51 +0000 (22:32 +0200)
public/trivabble.js

index 6bc774bf2efe0790b604dd1dd439244d91149554..b2a0291d07b2c9dc49730458dfaa7b1d85efe671 100644 (file)
         myConfirm(
             _("Do you want to add score to active player?") + " " + totalScore,
             function () {
-                /* Add score to active player */
+                const scoreCell = tablePlayers[currentPlayer].childNodes[2].childNodes[0];
+                sendCmds([{
+                        cmd: "score",
+                    player: currentPlayer,
+                    score: parseInt(scoreCell.textContent) + totalScore
+                }]);
             }
         );
     }