summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.html4
-rw-r--r--play.js20
2 files changed, 18 insertions, 6 deletions
diff --git a/play.html b/play.html
index 8781fa1..45abfbb 100644
--- a/play.html
+++ b/play.html
@@ -488,6 +488,10 @@ svg #lines line.axis_supply.allied_supply {
border-color: brown;
}
+.unit.disrupted.unsupplied {
+ border-color: black brown;
+}
+
.unit.r0 { transform: rotate(0deg); }
.unit.r1 { transform: rotate(-90deg); }
.unit.r2 { transform: rotate(-180deg); }
diff --git a/play.js b/play.js
index 76edae8..e948dcc 100644
--- a/play.js
+++ b/play.js
@@ -761,18 +761,26 @@ function update_map() {
e.style.left = x + "px"
e.style.zIndex = z
- let r = unit_lost_steps(u)
- e.classList.toggle("r0", r === 0)
- e.classList.toggle("r1", r === 1)
- e.classList.toggle("r2", r === 2)
- e.classList.toggle("r3", r === 3)
+ if (is_unit_revealed(u)) {
+ let r = unit_lost_steps(u)
+ e.classList.toggle("r0", r === 0)
+ e.classList.toggle("r1", r === 1)
+ e.classList.toggle("r2", r === 2)
+ e.classList.toggle("r3", r === 3)
+ e.classList.toggle("revealed", true)
+ } else {
+ e.classList.toggle("r0", false)
+ e.classList.toggle("r1", false)
+ e.classList.toggle("r2", false)
+ e.classList.toggle("r3", false)
+ e.classList.toggle("revealed", false)
+ }
e.classList.toggle("action", !view.battle && is_unit_action(u))
e.classList.toggle("selected", !view.battle && is_unit_selected(u))
e.classList.toggle("disrupted", is_unit_disrupted(u))
e.classList.toggle("moved", is_unit_moved(u))
e.classList.toggle("unsupplied", is_unit_unsupplied(u))
- e.classList.toggle("revealed", is_unit_revealed(u))
}
if (ui.hexes[hex]) {