diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-12-22 14:19:06 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:19:39 +0100 |
commit | 4cea44826db08fe343b37e08e76c60f2c623d779 (patch) | |
tree | b5ff80f14dd664e93585a9f2f6d8e6bb66029789 /ui.js | |
parent | 2755c43519032388c56205a453a4ee054e6d3ba9 (diff) | |
download | crusader-rex-4cea44826db08fe343b37e08e76c60f2c623d779.tar.gz |
Show card backs when observing the block games.
Diffstat (limited to 'ui.js')
-rw-r--r-- | ui.js | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -43,6 +43,7 @@ function toggle_blocks() { let ui = { cards: {}, + card_backs: {}, towns: {}, blocks: {}, battle_menu: {}, @@ -342,6 +343,9 @@ function build_map() { ui.cards[c].addEventListener("click", on_click_card); } + for (let c = 1; c <= 6; ++c) + ui.card_backs[c] = document.getElementById("back+"+c); + for (let name in TOWNS) { let town = TOWNS[name]; if (name === F_POOL || name === S_POOL || name === DEAD) @@ -632,6 +636,15 @@ function update_cards() { element.classList.remove("show"); } } + + if (player === 'Observer') { + let n = game.hand.length; + for (let c = 1; c <= 6; ++c) + if (c <= n) + ui.card_backs[c].classList.add("show"); + else + ui.card_backs[c].classList.remove("show"); + } } function compare_blocks(a, b) { |