From 564038637c2f44646764709dac273a032c0bffe0 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 21 Oct 2023 21:50:54 +0200 Subject: Hide "discard" panel when choosing cards for censorship. --- play.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 79aec26..17df5ce 100644 --- a/play.js +++ b/play.js @@ -511,8 +511,6 @@ 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.querySelector("body").classList.toggle("censorship", view.censorship === 1) - document.getElementById("hand").replaceChildren() document.getElementById("final").replaceChildren() document.getElementById("discard").replaceChildren() @@ -547,6 +545,11 @@ function on_update() { document.getElementById("set_aside_panel").classList.add("hide") } + if (view.hand && view.hand.length === 5) + document.getElementById("discard_panel").classList.add("hide") + else + document.getElementById("discard_panel").classList.remove("hide") + for (let i = 0; i < space_names.length; ++i) layout[i] = [] -- cgit v1.2.3