summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-20 10:33:01 +0200
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-20 10:33:01 +0200
commita35e8edccdbdfa29c29beb68f30fed84725e682b (patch)
tree5dff7bcce5cb48f3279b1401c4ae04a5c93f6b0b /play.js
parent2acd925f3e16d33487d31b9924ae04c9f8c5c073 (diff)
downloadalgeria-a35e8edccdbdfa29c29beb68f30fed84725e682b.tar.gz
elite airmobile should be able to flush elsewhere
Diffstat (limited to 'play.js')
-rw-r--r--play.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/play.js b/play.js
index eb55381..ebb1629 100644
--- a/play.js
+++ b/play.js
@@ -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) {