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.css | 1 - play.js | 7 +++++-- rules.js | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/play.css b/play.css index 5ab9bd6..fcde992 100644 --- a/play.css +++ b/play.css @@ -50,7 +50,6 @@ body.Versailles header.your_turn { background-color: hsl(199, 45%, 70%); } #final, #hand, #discard, #set_aside, #red_objective, #blue_objective { min-height: 350px; } #hand_panel { min-width: 1100px; } -body.censorship #hand_panel { min-width: 1370px; } #final_panel { min-width: 560px; } #set_aside_panel { min-width: 830px; } #discard_panel { min-width: 290px; } 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] = [] diff --git a/rules.js b/rules.js index 6453504..6cb813a 100644 --- a/rules.js +++ b/rules.js @@ -3504,9 +3504,6 @@ exports.view = function (state, player) { set_aside: 0, } - if (game.censorship) - view.censorship = 1 - if (typeof game.red_objective === "object") view.red_objective = 2 else if (game.red_objective > 0) -- cgit v1.2.3