summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-21 13:56:02 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-07 18:39:37 +0200
commit45501d068bfed96bfe0713b228f6a018a4528b89 (patch)
tree5f844e5c600c939a7e0b3bfb8d61ad59c76ba86b /play.js
parentf8d83c065a6ed85026a9bcadbdc961a0afea684e (diff)
downloadtime-of-crisis-45501d068bfed96bfe0713b228f6a018a4528b89.tar.gz
Card events.
Diffstat (limited to 'play.js')
-rw-r--r--play.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/play.js b/play.js
index 05e0742..da6f215 100644
--- a/play.js
+++ b/play.js
@@ -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)