summaryrefslogtreecommitdiff
path: root/play2.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-02-28 00:27:36 +0100
committerTor Andersson <tor@ccxvii.net>2025-02-28 00:27:36 +0100
commit0c4325ee1410497cbc04dff966409c534b5bc769 (patch)
tree09a3fedcd4b12ff40c91b6205be403de0f1df4ee /play2.js
parentdfac77d2135ef7084852860d995113cc8709a233 (diff)
downloadland-and-freedom-0c4325ee1410497cbc04dff966409c534b5bc769.tar.gz
wip more client
Diffstat (limited to 'play2.js')
-rw-r--r--play2.js23
1 files changed, 21 insertions, 2 deletions
diff --git a/play2.js b/play2.js
index 17e9ac0..494e3c6 100644
--- a/play2.js
+++ b/play2.js
@@ -86,7 +86,7 @@ function build_track(t, action_name, track_name, a, b) {
const bm = t * 11 + s
e = (ui.blank_markers[bm] = document.createElement("div"))
- e.className = "token blank"
+ e.className = "token blank hide"
e.style.top = Math.round(y+4) + "px"
e.style.left = Math.round(x+3) + "px"
register_action(e, "blank_marker", bm)
@@ -210,6 +210,12 @@ function place_cards(e, cards) {
}
}
+const faction_class = {
+ "a": "anarchist",
+ "c": "communist",
+ "m": "moderate",
+}
+
function update_front(container, front) {
var i, n, e, cn
container.replaceChildren()
@@ -226,6 +232,14 @@ function update_front(container, front) {
e.className = cn
container.appendChild(e)
}
+
+ for (i of ["a", "c", "m"]) {
+ if (front.contributions.includes(i)) {
+ let e = document.createElement("div")
+ e.className = "token player " + faction_class[i]
+ container.appendChild(e)
+ }
+ }
}
function on_update() {
@@ -253,12 +267,17 @@ function on_update() {
for (i = 0; i < 5; ++i)
ui.standees[i].style.left = ui.tracks_x[i][view.tracks[i]]
+ for (i = 0; i < 55; ++i) {
+ if (ui.blank_markers[i])
+ ui.blank_markers[i].classList.toggle("hide", !view.triggered_track_effects.includes(i))
+ }
+
for (i = 0; i < 5; ++i) {
ui.medallion_container[i].replaceChildren()
if (i < view.medallions.pool.length)
ui.medallion_container[i].appendChild(ui.medallions[i])
}
-
+
update_front(ui.fronts[0], view.fronts.a)
update_front(ui.fronts[1], view.fronts.m)
update_front(ui.fronts[2], view.fronts.n)