From 2b557144914e935301e86565abd110f030232896 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 3 Sep 2022 17:14:32 +0200 Subject: Broken border color for disrupted and unsupplied units. --- play.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'play.js') 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]) { -- cgit v1.2.3