From 78754928c9b1c55bdffe40ff33342c7329f3ce77 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 22 Oct 2024 16:11:05 +0200 Subject: political phase - card data --- play.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index f34d5f6..6a76f5f 100644 --- a/play.js +++ b/play.js @@ -496,12 +496,10 @@ function make_tc_deck_hand(n) { return list } -function make_political_card(pc) { +function make_political_card(id) { let e = document.createElement("div") - if (pc === 0) - e.className = "card polcard reverse" - else - e.className = "card polcard c" + pc + e.className = "card polcard c" + id + register_action(e, "political", id) return e } @@ -1100,7 +1098,7 @@ function on_update() { ui.pc_display[pow].replaceChildren() for (let tc of view.saved[pow]) ui.pc_display[pow].appendChild(show_tc(tc)) - if (view.display[pow] >= 0) + if (view.display && view.display[pow] >= 0) ui.pc_display[pow].appendChild(show_tc(view.display[pow])) } @@ -1215,8 +1213,8 @@ function on_update() { function sub_political(match, p1) { let x = p1 | 0 - let n = political_name[x] - return `${n}` + let n = political_cards[x].title + return `${n}` } function sub_piece(match, p1) { -- cgit v1.2.3