summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-15 12:50:36 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commit7d019c80c7051b8a37d7bf9eb4b376b83a3ed8c3 (patch)
tree372419aaff80cfa5ea42e2702c895fb8a9c984a9 /play.js
parent65dff0c518948bf6d552b92f01901320d40ba448 (diff)
downloadnevsky-7d019c80c7051b8a37d7bf9eb4b376b83a3ed8c3.tar.gz
Red locale highlight for laden march.
Diffstat (limited to 'play.js')
-rw-r--r--play.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/play.js b/play.js
index d37e5bd..1ba6ac3 100644
--- a/play.js
+++ b/play.js
@@ -178,6 +178,10 @@ function is_locale_action(locale) {
return !!(view.actions && view.actions.locale && set_has(view.actions.locale, locale))
}
+function is_laden_march_action(locale) {
+ return !!(view.actions && view.actions.laden_march && set_has(view.actions.laden_march, locale))
+}
+
function is_way_action(way) {
return !!(view.actions && view.actions.way && set_has(view.actions.way, way))
}
@@ -475,6 +479,7 @@ function on_click_locale(evt) {
if (evt.button === 0) {
let id = evt.target.my_id
send_action('locale', id)
+ send_action('laden_march', id)
}
}
@@ -1005,9 +1010,12 @@ function update_veche() {
}
function update_locale(loc) {
- ui.locale[loc].classList.toggle("action", is_locale_action(loc))
- if (ui.locale_extra[loc])
- ui.locale_extra[loc].classList.toggle("action", is_locale_action(loc))
+ ui.locale[loc].classList.toggle("action", is_locale_action(loc) || is_laden_march_action(loc))
+ ui.locale[loc].classList.toggle("laden", is_laden_march_action(loc))
+ if (ui.locale_extra[loc]) {
+ ui.locale_extra[loc].classList.toggle("action", is_locale_action(loc) || is_laden_march_action(loc))
+ ui.locale_extra[loc].classList.toggle("laden", is_laden_march_action(loc))
+ }
ui.locale_markers[loc].replaceChildren()
@@ -1230,9 +1238,6 @@ function on_update() {
update_plan()
update_cards()
- action_button("laden", "Laden")
- action_button("unladen", "Unladen")
-
action_button("use_legate", "Legate")
action_button("sail", "Sail")