From 5b72caa4f571b574900cd043de88c8371d54114c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 30 Nov 2023 12:21:52 +0100 Subject: fix role panel --- play.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 6cb2fdc..f07bbb4 100644 --- a/play.js +++ b/play.js @@ -288,27 +288,22 @@ function update_units() { build_map(); function player_info(player, nc, nq) { - let info; - if (nc == 1) - info = "1 card in hand."; - else - info = nc + " cards in hand."; - if (nq > 0) - info += "\n" + nq + " OPS in queue."; + let info = "" if (player == AMERICAN) { - if (view.pennsylvania_and_new_jersey_line_mutinies) - info += "\nPennsylvania and New Jersey Line Mutinies!"; - if (view.congress == CONTINENTAL_CONGRESS_DISPERSED) - info += "\nContinental Congress Dispersed!"; + if (view.pennsylvania_and_new_jersey_line_mutinies || view.congress == CONTINENTAL_CONGRESS_DISPERSED) + info += "\u{1f6ab} " } + if (nq > 0) + info += nq + "\u{231b} " + info += nc + "\u{1f3b4}" return info; } function on_update() { let e; - document.getElementById("british_info").textContent = player_info(BRITISH, view.b_cards, view.b_queue); - document.getElementById("american_info").textContent = player_info(AMERICAN, view.a_cards, view.a_queue); + roles.American.stat.textContent = player_info(AMERICAN, view.a_cards, view.a_queue); + roles.British.stat.textContent = player_info(BRITISH, view.b_cards, view.b_queue); if (!view.last_played) document.getElementById("last_played").className = "card show card_back"; -- cgit v1.2.3