summaryrefslogtreecommitdiff
path: root/ui.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-12-22 14:19:06 +0100
committerTor Andersson <tor@ccxvii.net>2022-11-17 12:53:18 +0100
commit151b9a3c5336f70eaf3acc47b2e9fa10e56ee28f (patch)
tree2026d58fc8228ad81b14bd02cb57a4bcd681cd62 /ui.js
parentd2855ee392024c8ce05cc35233df8457266c1bf7 (diff)
downloadhammer-of-the-scots-151b9a3c5336f70eaf3acc47b2e9fa10e56ee28f.tar.gz
Show card backs when observing the block games.
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index 66790c2..8d525ff 100644
--- a/ui.js
+++ b/ui.js
@@ -40,6 +40,7 @@ function toggle_blocks() {
let ui = {
cards: {},
+ card_backs: {},
areas: {},
known: {},
secret: { England: {}, Scotland: {} },
@@ -348,6 +349,9 @@ function build_map() {
ui.cards[c].addEventListener("click", on_click_card);
}
+ for (let c = 1; c <= 5; ++c)
+ ui.card_backs[c] = document.getElementById("back+"+c);
+
for (let name in AREAS) {
let area = AREAS[name];
let element = svgmap.getElementById("area+"+name);
@@ -641,6 +645,15 @@ function update_cards() {
ui.cards[c].classList.remove('show');
}
+ if (player === 'Observer') {
+ let n = game.hand.length;
+ for (let c = 1; c <= 5; ++c)
+ if (c <= n)
+ ui.card_backs[c].classList.add("show");
+ else
+ ui.card_backs[c].classList.remove("show");
+ }
+
if (game.actions && game.actions.play) {
for (let c of game.actions.play)
ui.cards[c].classList.add('enabled');