summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.css2
-rw-r--r--play.html1
-rw-r--r--play.js18
3 files changed, 12 insertions, 9 deletions
diff --git a/play.css b/play.css
index 32ad917..818cd5a 100644
--- a/play.css
+++ b/play.css
@@ -320,7 +320,7 @@ body.Lancaster #plan_actions .york { display: none }
gap: 4px;
}
-.marker.turn, .marker.end, .marker.ip, .marker.towns, .marker.cities, .marker.fortresses, .marker.victory_check {
+#pieces .marker {
position: absolute;
}
diff --git a/play.html b/play.html
index 41e9dfb..3bc5d54 100644
--- a/play.html
+++ b/play.html
@@ -72,6 +72,7 @@
<div id="cities" class="marker square cities"></div>
<div id="fortresses" class="marker square fortresses"></div>
<div id="ip" class="marker square ip"></div>
+ <div id="battle" class="hide" style="z-index:50"></div>
</div>
</div>
diff --git a/play.js b/play.js
index 717d7ea..814725f 100644
--- a/play.js
+++ b/play.js
@@ -403,6 +403,7 @@ const ui = {
towns: document.getElementById("towns"),
cities: document.getElementById("cities"),
influence: document.getElementById("ip"),
+ battle: document.getElementById("battle"),
court1_header: document.getElementById("court1_header"),
court2_header: document.getElementById("court2_header"),
@@ -1054,14 +1055,6 @@ function update_locale(loc) {
ui.locale_name[loc].classList.toggle("action", is_action("locale", loc) || is_action("laden_march", loc))
}
-/* TODO: BATTLE marker
- if (view.battle && view.battle.where === loc)
- if (view.battle.storm)
- ui.locale_markers[loc].appendChild(get_cached_element("marker circle storm"))
- else
- ui.locale_markers[loc].appendChild(get_cached_element("marker circle battle"))
-*/
-
if (set_has(view.pieces.exhausted, loc))
ui.depleted[loc].className = "marker small exhausted"
else if (set_has(view.pieces.depleted, loc))
@@ -1344,6 +1337,15 @@ function on_update() {
for (let loc = 0; loc < data.locales.length; ++loc)
update_locale(loc)
+ if (view.battle) {
+ let { x, y, w, h } = data.locales[view.battle.where].box
+ ui.battle.className = "marker circle battle"
+ ui.battle.style.left = ((x+w/2)|0) - 27 + "px"
+ ui.battle.style.top = y + h - 27 + "px"
+ } else {
+ ui.battle.className = "hide"
+ }
+
update_current_card_display()
if (view.turn & 1) {