summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-21 21:50:54 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-21 21:50:54 +0200
commit564038637c2f44646764709dac273a032c0bffe0 (patch)
tree117b88f5db0943edaa3f2f5e93ab6536f8f6b3bf
parentda2bb2de876e0098c69492c45a257168e1b40c49 (diff)
downloadred-flag-over-paris-564038637c2f44646764709dac273a032c0bffe0.tar.gz
Hide "discard" panel when choosing cards for censorship.
-rw-r--r--play.css1
-rw-r--r--play.js7
-rw-r--r--rules.js3
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)