From: Laurent Mazet Date: Mon, 23 Nov 2020 21:44:24 +0000 (+0100) Subject: add an option to select who scores: last player or player who pressed on the button X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=f5f53ac7a8cc3a1a2f7bc0a5000522dbbe1a9032;p=trivabble.git add an option to select who scores: last player or player who pressed on the button --- diff --git a/public/config.js.sample b/public/config.js.sample index 2abc6cd..6d36aaa 100644 --- a/public/config.js.sample +++ b/public/config.js.sample @@ -38,6 +38,9 @@ window.TrivabbleConf = { // The default premium for playing seven tiles on a turn PREMIUM_SEVEN_TILES: 50, + // Score is automically affected to last player. If false, score is automatically affected to the player who pressed the Score button + SCORE_LAST_PLAYER: true, + // I don't like trailing commas, here is a nice message for you reading this file :-) HAVE_FUN: true }; diff --git a/public/trivabble.js b/public/trivabble.js index 7e0ede4..4aaf1c0 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -61,6 +61,7 @@ setConf("FLASH_LIGHT_COLOR", "#ee6633"); setConf("API_ENTRY_POINT", Conf.APP_PATH + "/:trivabble"); setConf("PREMIUM_SEVEN_TILES", 50); + setConf("SCORE_LAST_PLAYER", true); function getSetting(key) { let type; @@ -1920,6 +1921,11 @@ totalScore += getSetting("PREMIUM_SEVEN_TILES"); } + /* Ѕcore player who pressed the button */ + if (!getSetting("SCORE_LAST_PLAYER")) { + lastPlayer = getSetting("PlayerName"); + } + myChoice( format(_("{0} points will be added to:"), totalScore), { choices: Object.keys(tablePlayers),