summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js27
1 files changed, 14 insertions, 13 deletions
diff --git a/play.js b/play.js
index bfe4578..8b5d3d7 100644
--- a/play.js
+++ b/play.js
@@ -370,17 +370,13 @@ const ui = {
event_reminder_list: document.getElementById("event_reminder_list"),
played_card: document.getElementById("played_card"),
- scoring_card: document.getElementById("scoring_card"),
- played_power_card: document.getElementById("played_power_card"),
- power_card_1: document.getElementById("power_card_1"),
- power_card_2: document.getElementById("power_card_2"),
hand: document.getElementById("hand"),
power_hand: document.getElementById("power_hand"),
opp_hand: document.getElementById("opp_hand"),
opp_power_hand: document.getElementById("opp_power_hand"),
discard: document.getElementById("discard"),
removed: document.getElementById("removed"),
- table_cards: document.getElementById("table_cards"),
+ persistent: document.getElementById("persistent"),
ceausescu_hand: document.getElementById("ceausescu_hand"),
samizdat_card: document.getElementById("samizdat_card"),
@@ -703,15 +699,20 @@ function on_update() {
document.getElementById("discard_panel").classList.add("hide")
ui.removed.replaceChildren()
- for (let c of view.strategy_removed) {
- if (c === view.played_card) continue
- ui.removed.appendChild(ui.cards[c]) }
+ for (let c of view.strategy_removed)
+ ui.removed.appendChild(ui.cards[c])
+
+ ui.persistent.replaceChildren()
+ for (let c of view.persistent_events)
+ ui.persistent.appendChild(ui.cards[c])
- ui.table_cards.replaceChildren()
- if (view.table_cards)
- for (let c of view.table_cards) {
- if (c === view.played_card) continue
- ui.table_cards.appendChild(ui.cards[c]) }
+ ui.played_card.replaceChildren()
+ if (view.played_card > 0)
+ ui.played_card.appendChild(ui.cards[view.played_card])
+ if (view.power_card_1 > 0)
+ ui.played_card.appendChild(ui.power_cards[view.power_card_1])
+ if (view.power_card_2 > 0)
+ ui.played_card.appendChild(ui.power_cards[view.power_card_2])
for (let e of action_register)
e.classList.toggle("action", is_action(e.my_action, e.my_id))