summaryrefslogtreecommitdiff
path: root/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/ui.js b/ui.js
index 693ca9c..37ca0e6 100644
--- a/ui.js
+++ b/ui.js
@@ -72,6 +72,7 @@ let ui = {
map_location: {},
battle_steps: {},
cards: {},
+ card_backs: {},
};
create_log_entry = function (text) {
@@ -288,9 +289,10 @@ function build_map() {
build_battle_block(b, block, color);
}
- for (let c = 1; c <= 27; ++c) {
+ for (let c = 1; c <= 27; ++c)
ui.cards[c] = document.getElementById("card+" + c);
- }
+ for (let c = 1; c <= 6; ++c)
+ ui.card_backs[c] = document.getElementById("back+" + c);
}
function update_steps(memo, block, steps, element, animate) {
@@ -692,6 +694,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 on_update() {