From d31416c59ce6cf5d62db6fbdc6586472fbb00c4b Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 13 Aug 2023 15:39:20 +0200 Subject: Place/Recall detachments. WIP: place by road --- play.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'play.js') diff --git a/play.js b/play.js index 0ba5099..0ad5f78 100644 --- a/play.js +++ b/play.js @@ -203,6 +203,7 @@ function on_update() { for (let id = 0; id < piece_count; ++id) { let hex = view.pieces[id] >> 1 if (hex >= first_hex) { + // ON MAP ui.pieces[id].classList.remove("hide") ui.pieces[id].classList.toggle("flip", (view.pieces[id] & 1) === 1) let x = ui.hex_x[hex] - ui.stack[hex] * 18 @@ -217,7 +218,17 @@ function on_update() { } ui.pieces[id].style.top = y + "px" ui.pieces[id].style.left = x + "px" + } else if (hex === 100 || hex === 101) { + // AVAILABLE DETACHMENTS + ui.pieces[id].classList.remove("hide") + ui.pieces[id].classList.remove("flip") + let x = 600 + 20 + ui.stack[hex] * 50 + let y = 1650 + 20 + 60 * (hex-100) + ui.stack[hex] += 1 + ui.pieces[id].style.top = y + "px" + ui.pieces[id].style.left = x + "px" } else if (hex >= 1) { + // ON TURN TRACK ui.pieces[id].classList.remove("hide") ui.pieces[id].classList.remove("flip") let x = TURN_X + hex * TURN_DX - ui.stack[hex] * 18 @@ -233,10 +244,13 @@ function on_update() { ui.pieces[id].style.top = y + "px" ui.pieces[id].style.left = x + "px" } else { + // TODO: ENTRY HEXES + // ELIMINATED ui.pieces[id].classList.add("hide") } ui.pieces[id].classList.toggle("action", is_action("piece", id)) ui.pieces[id].classList.toggle("selected", view.who === id) + ui.pieces[id].classList.toggle("target", view.target === id) } if (view.roads) { -- cgit v1.2.3