summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-07-28 15:02:48 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:26 +0100
commit1a29b9c975564261bfe4c715223f535bb71d8f09 (patch)
treef717b1c0cd2615e4c28e64eec45580387b12f2e6 /play.js
parent9fb38f18590120409dea918132ccf437958de734 (diff)
downloadrommel-in-the-desert-1a29b9c975564261bfe4c715223f535bb71d8f09.tar.gz
Buildup turn structure. Resupply. Initiative challenge.
Diffstat (limited to 'play.js')
-rw-r--r--play.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/play.js b/play.js
index ef1ed55..4cdbaf3 100644
--- a/play.js
+++ b/play.js
@@ -709,10 +709,10 @@ function on_update() {
ui.allied_supply.textContent = view.allied_hand
ui.turn_info.textContent = `Month: ${view.month}\nSupply Commitment: ${view.commit}`
- if (view.actions && (view.actions.real_card || view.actions.dummy_card))
- ui.cards.forEach(elt => elt.classList.add("action"))
- else
- ui.cards.forEach(elt => elt.classList.remove("action"))
+ for (let i = 0; i < 28; ++i)
+ ui.cards[i].classList.toggle("action", !!(view.actions && view.actions.real_card))
+ for (let i = 0; i < 14; ++i)
+ ui.cards[i+28].classList.toggle("action", !!(view.actions && view.actions.dummy_card))
action_button("discard", "Discard")
action_button("keep", "Keep")