summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-03-14 21:31:07 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2025-03-14 21:31:07 -0400
commit824ce80cd1a52e1300d56099e9630cafa3789e17 (patch)
tree0547ce0c351cce8514944736998dad3e3570a575
parent38e7bf07d9ea82993c24423a16b3294ec491acd4 (diff)
downloadvijayanagara-824ce80cd1a52e1300d56099e9630cafa3789e17.tar.gz
Adding score in status boxes
-rw-r--r--play.js9
1 files changed, 9 insertions, 0 deletions
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"