From e4df4428aae69eb612516106886ed8d7cc70a479 Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Sun, 8 Oct 2023 13:19:02 +0200 Subject: show psl and ap on aside --- play.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'play.js') diff --git a/play.js b/play.js index 4250a4c..f913a23 100644 --- a/play.js +++ b/play.js @@ -4,6 +4,9 @@ const SCALE = 1.8033333333333332 +const FLN = 0 +const GOV = 1 + const DEPLOY = 1 const ELIMINATED = 2 @@ -47,6 +50,11 @@ let ui = { document.getElementById("role_FLN"), document.getElementById("role_Government"), ], + ap: document.querySelector("#role_FLN .role_ap"), + psl: [ + document.querySelector("#role_FLN .role_psl"), + document.querySelector("#role_Government .role_psl"), + ], markers: { turn: document.getElementById("turn_now"), fln_psl: document.getElementById("fln_psl"), @@ -392,6 +400,14 @@ Node.prototype.appendChildAnimated = function(e) { function update_map() { console.log("VIEW", view) + + ui.player[FLN].classList.toggle("active", view.active === "FLN") + ui.player[GOV].classList.toggle("active", view.active === "Government") + + ui.ap.textContent = view.fln_ap + ui.psl[FLN].textContent = view.fln_psl + ui.psl[GOV].textContent = view.gov_psl + ui.tracker[view.turn % 100].appendChildAnimated(ui.markers.turn) ui.tracker[view.fln_ap].appendChildAnimated(ui.markers.fln_ap) ui.tracker[view.fln_psl].appendChildAnimated(ui.markers.fln_psl) -- cgit v1.2.3