diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-09-03 17:14:32 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 13:11:27 +0100 |
commit | 2b557144914e935301e86565abd110f030232896 (patch) | |
tree | 425f125f4563299a68de3a380260fca13696c8e5 /play.js | |
parent | 079bc01141cb061e405e29d1df2c87fad8ecddc3 (diff) | |
download | rommel-in-the-desert-2b557144914e935301e86565abd110f030232896.tar.gz |
Broken border color for disrupted and unsupplied units.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -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]) { |