summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-07 14:14:09 +0200
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:16:55 +0100
commite40db22f176ec8d93ceea29d41eed54d5507919f (patch)
tree3ff69954f7b9182072c0a0960d95716e340df849 /play.js
parentccaf301dc3dd5cf43d9c73e46ef06dfc856fc3f8 (diff)
downloadplantagenet-e40db22f176ec8d93ceea29d41eed54d5507919f.tar.gz
Fix exile marker display.
Diffstat (limited to 'play.js')
-rw-r--r--play.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/play.js b/play.js
index 5e11467..a184b44 100644
--- a/play.js
+++ b/play.js
@@ -564,6 +564,7 @@ const ui = {
locale_markers_rose: [],
lord_cylinder: [],
lord_mat: [],
+ lord_exile: [],
lord_buttons: [],
map_vassals: [],
forces: [],
@@ -789,9 +790,12 @@ function build_map() {
register_action(e, "lord", ix)
register_tooltip(e, on_focus_cylinder)
document.getElementById("pieces").appendChild(e)
- let exile = document.createElement("div")
- exile.className = "exile hide"
+
+ // TODO: remove this when not in exile
+ let exile = ui.lord_exile[ix] = document.createElement("div")
+ exile.className = "marker small exile hide"
e.appendChild(exile)
+
build_lord_mat(lord, ix, side, lord.id)
})
@@ -1194,12 +1198,13 @@ function update_lord(ix) {
layout_locale_item(locale, ui.lord_cylinder[ix])
ui.lord_cylinder[ix].classList.remove("hide")
update_lord_mat(ix)
+ ui.lord_exile[ix].classList.add("hide")
} else {
let t = locale - 100
if (t > 16) t = 16
calendar_layout_cylinder[t].push(ui.lord_cylinder[ix])
ui.lord_cylinder[ix].classList.remove("hide")
- ui.lord_cylinder[ix].getElementsByClassName("exile")[0].classList.toggle("hide", !is_lord_in_exile(ix))
+ ui.lord_exile[ix].classList.toggle("hide", !is_lord_in_exile(ix))
}
ui.lord_buttons[ix].classList.toggle("action", is_action("lord", ix))
ui.lord_cylinder[ix].classList.toggle("action", is_action("lord", ix))