diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-20 10:33:01 +0200 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-20 10:33:01 +0200 |
commit | a35e8edccdbdfa29c29beb68f30fed84725e682b (patch) | |
tree | 5dff7bcce5cb48f3279b1401c4ae04a5c93f6b0b /play.js | |
parent | 2acd925f3e16d33487d31b9924ae04c9f8c5c073 (diff) | |
download | algeria-a35e8edccdbdfa29c29beb68f30fed84725e682b.tar.gz |
elite airmobile should be able to flush elsewhere
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -186,6 +186,12 @@ function is_unit_selected(unit) { return view.selected === unit } +function is_loc_selected(loc) { + if (Array.isArray(view.selected_loc)) + return view.selected_loc.includes(loc) + return view.selected_loc === loc +} + function is_loc_action(x) { return !!(view.actions && view.actions.loc && view.actions.loc.includes(x)) } @@ -394,8 +400,8 @@ function update_unit(e, u) { e.classList.toggle("neutralized", is_unit_neutralized(u)) e.classList.toggle("airmobile", is_unit_airmobile(u)) e.classList.toggle("fr_xx_dispersed", is_unit_dispersed(u)) - e.classList.toggle("action", !view.battle && is_unit_action(u)) - e.classList.toggle("selected", !view.battle && is_unit_selected(u)) + e.classList.toggle("action", is_unit_action(u)) + e.classList.toggle("selected", is_unit_selected(u)) e.classList.toggle("contacted", is_unit_contacted(u)) e.classList.toggle("eliminated", is_unit_eliminated(u)) } @@ -491,6 +497,7 @@ function update_map() { if (e) { let loc = parseInt(e.dataset.loc) e.classList.toggle("action", is_loc_action(loc)) + e.classList.toggle("target", is_loc_selected(loc)) let em = ui.area_markers[i] if (em) { |