From 824ce80cd1a52e1300d56099e9630cafa3789e17 Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Fri, 14 Mar 2025 21:31:07 -0400 Subject: Adding score in status boxes --- play.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/play.js b/play.js index 73ec4b8..5f2bfc5 100644 --- a/play.js +++ b/play.js @@ -884,6 +884,11 @@ function update_player_active(name, x) { roles[name].element.classList.toggle("active", x) } +function update_player_info(name, x) { + if (roles[name]) + roles[name].stat.textContent = x +} + function update_dice_box() { ui.attack_header.textContent = "Attack in " + data.space_name[view.attack.where] ui.attack_attacker.textContent = "Attacker - " + faction_name[view.attack.attacker] @@ -977,6 +982,10 @@ function on_update() { update_player_active(NAME_VE, view.current === VE) update_player_active(NAME_BK, view.current === BK) + update_player_info(NAME_DS, view.vp[0]) + update_player_info(NAME_VE, view.vp[1]) + update_player_info(NAME_BK, view.vp[2]) + ui.this_card.className = make_card_class_name(view.deck[0]) if (view.deck[1] > 0) { ui.deck_outer.className = "card card_back" -- cgit v1.2.3