summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-09-08 19:26:04 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:27 +0100
commit4a7765e6e0d237119e761bfd0afa9bf06dbfbd3c (patch)
treef5bf1bb2c9e41425d16c2d691b1df10e9b9e590b /play.js
parent1e159b0e793fe3f53b37109e37d36bf5e45a2d7b (diff)
downloadrommel-in-the-desert-4a7765e6e0d237119e761bfd0afa9bf06dbfbd3c.tar.gz
Appearance tweaks.
Diffstat (limited to 'play.js')
-rw-r--r--play.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/play.js b/play.js
index 8eb6983..5b08e2a 100644
--- a/play.js
+++ b/play.js
@@ -666,8 +666,6 @@ function update_unit(e, u) {
if (is_italian_unit(u))
e.classList.toggle("italian", false)
}
- e.classList.toggle("disrupted", is_unit_disrupted(u))
- e.classList.toggle("unsupplied", is_unit_unsupplied(u))
}
let stack_list = new Array(map_w * map_h + 21)
@@ -720,6 +718,8 @@ function layout_stack(stack, hex, start_x, start_y, wrap, xdir) {
update_unit(e, u)
+ e.classList.toggle("disrupted", is_unit_disrupted(u))
+ e.classList.toggle("unsupplied", is_unit_unsupplied(u))
e.classList.toggle("action", !view.battle && is_unit_action(u))
e.classList.toggle("selected", !view.battle && is_unit_selected(u))
e.classList.toggle("moved", is_unit_moved(u))
@@ -745,6 +745,9 @@ function update_map() {
ui.bardia.classList.toggle("axis", (view.fortress & 1) === 0)
ui.benghazi.classList.toggle("axis", (view.fortress & 2) === 0)
ui.tobruk.classList.toggle("axis", (view.fortress & 4) === 0)
+ ui.bardia.classList.toggle("allied", (view.fortress & 1) !== 0)
+ ui.benghazi.classList.toggle("allied", (view.fortress & 2) !== 0)
+ ui.tobruk.classList.toggle("allied", (view.fortress & 4) !== 0)
for (let i = 0; i < stack_list.length; ++i) {
stack_list[i][0].length = 0