diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-21 13:56:02 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:37 +0200 |
commit | 45501d068bfed96bfe0713b228f6a018a4528b89 (patch) | |
tree | 5f844e5c600c939a7e0b3bfb8d61ad59c76ba86b /play.js | |
parent | f8d83c065a6ed85026a9bcadbdc961a0afea684e (diff) | |
download | time-of-crisis-45501d068bfed96bfe0713b228f6a018a4528b89.tar.gz |
Card events.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -1033,32 +1033,42 @@ function on_update() { ui.played.replaceChildren() if (view.played) { - for (let c of view.played) + for (let c of view.played) { ui.played.appendChild(ui.cards[c]) + ui.cards[c].classList.toggle("used", set_has(view.used, c)) + } } ui.hand.replaceChildren() if (view.hand) { - for (let c of view.hand) + for (let c of view.hand) { ui.hand.appendChild(ui.cards[c]) + ui.cards[c].classList.remove("used") + } } ui.draw.replaceChildren() if (view.draw) { - for (let c of view.draw) + for (let c of view.draw) { ui.draw.appendChild(ui.cards[c]) + ui.cards[c].classList.remove("used") + } } ui.discard.replaceChildren() if (view.discard) { - for (let c of view.discard) + for (let c of view.discard) { ui.discard.appendChild(ui.cards[c]) + ui.cards[c].classList.remove("used") + } } ui.market.replaceChildren() for (let c of view.market) { - if (c > 0) + if (c > 0) { ui.market.appendChild(ui.cards[c]) + ui.cards[c].classList.remove("used") + } } for (let e of action_register) |