summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/play.js b/play.js
index a201e8a..8672373 100644
--- a/play.js
+++ b/play.js
@@ -372,8 +372,8 @@ const ui = {
played_card: document.getElementById("played_card"),
hand: document.getElementById("hand"),
power_hand: document.getElementById("power_hand"),
+ power_discard: document.getElementById("power_discard"),
opp_hand: document.getElementById("opp_hand"),
- opp_power_hand: document.getElementById("opp_power_hand"),
discard: document.getElementById("discard"),
removed: document.getElementById("removed"),
persistent: document.getElementById("persistent"),
@@ -667,14 +667,20 @@ function on_update() {
ui.hand.replaceChildren()
for (let c of view.hand)
ui.hand.appendChild(ui.cards[c])
+ console.log('ui.hand', ui.hand)
ui.power_hand.replaceChildren()
if (view.power_hand)
for (let c of view.power_hand)
ui.power_hand.appendChild(ui.power_cards[c])
-
+
+ ui.power_discard.replaceChildren()
+ if (view.power_struggle_discard)
+ for (let c of view.power_struggle_discard)
+ ui.power_discard.appendChild(ui.power_cards[c])
+
ui.opp_hand.replaceChildren()
- if (view.show_opp_hand && view.opp_hand)
+ if (view.opp_hand)
for (let c of view.opp_hand)
ui.opp_hand.appendChild(ui.cards[c])
if (view.opp_power_hand)
@@ -687,13 +693,8 @@ function on_update() {
ui.ceausescu_hand.appendChild(ui.power_cards[c])
ui.discard.replaceChildren()
- for (let c of view.strategy_discard) {
- if (c === view.played_card) continue
- ui.discard.appendChild(ui.cards[c]) }
- if (view.discard)
- document.getElementById("discard_panel").classList.remove("hide")
- else
- document.getElementById("discard_panel").classList.add("hide")
+ for (let c of view.strategy_discard)
+ ui.discard.appendChild(ui.cards[c])
ui.removed.replaceChildren()
for (let c of view.strategy_removed)
@@ -761,6 +762,8 @@ function on_update() {
action_button("done", "Done")
action_button("end_round", "End Round")
action_button("undo", "Undo")
+ console.log('view.hand', view.hand)
+ console.log('ui.hand',ui.hand)
}
// =========================== LOG FUNCTIONS ==============================================