summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-09-03 17:14:32 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:27 +0100
commit2b557144914e935301e86565abd110f030232896 (patch)
tree425f125f4563299a68de3a380260fca13696c8e5
parent079bc01141cb061e405e29d1df2c87fad8ecddc3 (diff)
downloadrommel-in-the-desert-2b557144914e935301e86565abd110f030232896.tar.gz
Broken border color for disrupted and unsupplied units.
-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]) {