From 227dca6e6e4c2f2d5a16527507810bc373b758ec Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 16 Oct 2024 12:21:33 +0200 Subject: Add special panels for Karl Marx and Jules Ducatel events. --- play.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'play.js') diff --git a/play.js b/play.js index 3e0300b..df7b04b 100644 --- a/play.js +++ b/play.js @@ -527,6 +527,8 @@ function on_update() { ui.military_vp.className = `piece cylinder purple vp${5+view.military_vp}` ui.political_vp.className = `piece cylinder orange vp${5+view.political_vp}` + document.getElementById("karl_marx").replaceChildren() + document.getElementById("jules_ducatel").replaceChildren() document.getElementById("hand").replaceChildren() document.getElementById("final").replaceChildren() document.getElementById("discard").replaceChildren() @@ -546,6 +548,26 @@ function on_update() { if (view.discard) document.getElementById("discard").appendChild(ui.cards[view.discard]) + if (view.karl_marx || view.jules_ducatel) { + document.getElementById("event_grid").style.display = null + if (view.karl_marx) { + document.getElementById("karl_marx_panel").classList.remove("hide") + for (let c of view.karl_marx) + document.getElementById("karl_marx").appendChild(ui.cards[c]) + } else { + document.getElementById("karl_marx_panel").classList.add("hide") + } + if (view.jules_ducatel) { + document.getElementById("jules_ducatel_panel").classList.remove("hide") + for (let c of view.jules_ducatel) + document.getElementById("jules_ducatel").appendChild(ui.cards[c]) + } else { + document.getElementById("jules_ducatel_panel").classList.add("hide") + } + } else { + document.getElementById("event_grid").style.display = "none" + } + if (view.hand) { document.getElementById("hand_panel").classList.remove("hide") for (let c of view.hand) -- cgit v1.2.3