From c0553c1d3484854fcfae1ff1dcb05c81dd9a6f13 Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Wed, 29 Nov 2023 06:27:14 +0100 Subject: show nineteenth amendment voting score --- play.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 4a3506b..e685fbd 100644 --- a/play.js +++ b/play.js @@ -29,6 +29,9 @@ let ui = { turn: document.getElementById("turn"), congress_box: document.getElementById("congress_box"), congress: [ null ], + nineteenth_amendment_score: document.getElementById("nineteenth_amendment_score"), + green_checks_count: document.getElementById("green_checks_count"), + red_xs_count: document.getElementById("red_xs_count"), player: [ document.getElementById("role_Suffragist"), document.getElementById("role_Opposition"), @@ -578,13 +581,11 @@ function on_log(text) { // eslint-disable-line no-unused-vars function support_info() { - // TODO show the # of green_checks and red_xs instead of the congress circles when the 19th has passed instead - return `${view.support_buttons}\u{2b50} ${view.support_hand}\u{1f3b4} ${view.green_checks} \u{2713}` + return `${view.support_buttons}\u{2b50} ${view.support_hand}\u{1f3b4}` } function opposition_info() { - // TODO show the # of green_checks and red_xs instead of the congress circles when the 19th has passed instead - return `${view.opposition_buttons}\u{2b50} ${view.opposition_hand}\u{1f3b4} ${view.red_xs} \u{2717}` + return `${view.opposition_buttons}\u{2b50} ${view.opposition_hand}\u{1f3b4}` } function layout_cubes(list, xorig, yorig) { @@ -631,6 +632,12 @@ function on_update() { // eslint-disable-line no-unused-vars ui.congress[c].classList.toggle("action", is_action("congress")) } + ui.nineteenth_amendment_score.classList.toggle("hide", !view.nineteenth_amendment) + if (view.nineteenth_amendment) { + ui.green_checks_count.textContent = view.green_checks + ui.red_xs_count.textContent = view.red_xs + } + ui.support_button_box.replaceChildren() for (let i = 0; i < view.support_buttons; ++i) { ui.support_button_box.appendChild(ui.support_buttons[i]) -- cgit v1.2.3