diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-18 14:31:32 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:33 +0200 |
commit | 19fd5d79b8e58b6806bb711c2c53054f73b2a282 (patch) | |
tree | b07ef2e730182b16dcf63a87b6a6f9369bb521fb /play.js | |
parent | 495090873cf62a1ca698cee18a2d292fc30aa292 (diff) | |
download | time-of-crisis-19fd5d79b8e58b6806bb711c2c53054f73b2a282.tar.gz |
Lots of stuff.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -509,7 +509,6 @@ function on_update() { stack_cache = {} - ui.body.classList.toggle("p1", view.solo === 1) ui.body.classList.toggle("p2", player_count === 2) ui.body.classList.toggle("p3", player_count === 3) ui.body.classList.toggle("p4", player_count === 4) @@ -657,6 +656,10 @@ function on_update() { } } + for (let region = 0; region < 21; ++region) { + ui.regions[region].classList.toggle("selected", view.selected_region === region) + } + for (let region = 0; region < 12; ++region) { if (has_militia(region)) { let lone_militia = true @@ -738,6 +741,7 @@ function on_update() { avail_stack.push(e) } e.classList.toggle("unavailable", region === UNAVAILABLE) + e.classList.toggle("selected", view.selected_general === pi * 6 + ai) } layout_available(avail_stack, 63, pi * 625 + 0, 30) } @@ -748,7 +752,7 @@ function on_update() { let id = 100 + 100 * pi + ai let region = get_governor_location(first_governor[pi] + ai) let e = ui.governors[pi][ai] - if (region >= 1 && region < 12) { + if (region < 12) { layout_governor(e, PLAYER_CLASS[pi], region) } else { if (region === AVAILABLE) @@ -758,6 +762,7 @@ function on_update() { avail_stack.push(e) } e.classList.toggle("unavailable", region === UNAVAILABLE) + e.classList.toggle("selected", view.selected_governor === pi * 6 + ai) } layout_available(avail_stack, 58, pi * 625 + 325, 27) } @@ -797,9 +802,9 @@ function on_update() { } ui.market.replaceChildren() - for (let pile of view.market) { - if (pile.length > 0) - ui.market.appendChild(ui.cards[pile[0]]) + for (let c of view.market) { + if (c > 0) + ui.market.appendChild(ui.cards[c]) } for (let e of action_register) |