diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -647,7 +647,6 @@ function on_update() { ui.power_card_1.replaceChildren() ui.power_card_2.replaceChildren() - console.log('view.is_pwr_struggle', view.is_pwr_struggle, 'view.power_card_1', view.power_card_1, 'view.power_card_2', view.power_card_2) if (!view.is_pwr_struggle) { if (view.played_card > 0) ui.played_card.appendChild(ui.cards[view.played_card]) @@ -695,17 +694,24 @@ function on_update() { ui.ceausescu_hand.appendChild(ui.power_cards[c]) ui.discard.replaceChildren() - for (let c of view.strategy_discard) - ui.discard.appendChild(ui.cards[c]) + 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") ui.removed.replaceChildren() - for (let c of view.strategy_removed) - ui.removed.appendChild(ui.cards[c]) + for (let c of view.strategy_removed) { + if (c === view.played_card) continue + ui.removed.appendChild(ui.cards[c]) } ui.table_cards.replaceChildren() if (view.table_cards) - for (let c of view.table_cards) - ui.table_cards.appendChild(ui.cards[c]) + for (let c of view.table_cards) { + if (c === view.played_card) continue + ui.table_cards.appendChild(ui.cards[c]) } for (let e of action_register) e.classList.toggle("action", is_action(e.my_action, e.my_id)) |