diff options
-rw-r--r-- | play.css | 2 | ||||
-rw-r--r-- | play.html | 1 | ||||
-rw-r--r-- | play.js | 18 |
3 files changed, 12 insertions, 9 deletions
@@ -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; } @@ -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> @@ -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) { |