summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-08 13:19:02 +0200
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-08 13:19:02 +0200
commite4df4428aae69eb612516106886ed8d7cc70a479 (patch)
treef414fc1f42a6edf6b5f846c0b9fce039dc03b43a /play.js
parent3e186b7b2ff2d70d1b250e9f225776a162bf4d56 (diff)
downloadalgeria-e4df4428aae69eb612516106886ed8d7cc70a479.tar.gz
show psl and ap on aside
Diffstat (limited to 'play.js')
-rw-r--r--play.js16
1 files changed, 16 insertions, 0 deletions
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)