From adf559f1b779690eb0e0bef21b4c29fb69520c75 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 15 Jun 2021 17:52:18 +0200 Subject: Add "Rematch" button for easier repeat match making. --- play.html | 1 + ui.js | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/play.html b/play.html index 98773d9..03a621e 100644 --- a/play.html +++ b/play.html @@ -256,6 +256,7 @@ body.shift .block.known:hover { +
diff --git a/ui.js b/ui.js index 9970ea2..6e192a1 100644 --- a/ui.js +++ b/ui.js @@ -54,8 +54,6 @@ const step_up_animation = [ { transform: 'translateY(0px)' }, ]; -let game = null; - let ui = { spaces: {}, known: {}, @@ -530,7 +528,7 @@ function update_map() { } } -function update_battle(player) { +function update_battle() { function fill_cell(name, list, reserve) { let cell = window[name]; @@ -649,9 +647,7 @@ function update_cards() { } } -function on_update(state, player) { - game = state; - +function on_update() { document.getElementById("turn").className = "year_" + game.year; document.getElementById("caesar_vp").textContent = game.c_vp + " VP"; document.getElementById("pompeius_vp").textContent = game.p_vp + " VP"; @@ -675,7 +671,7 @@ function on_update(state, player) { document.querySelector(".battle_header").textContent = game.battle.title; document.querySelector(".battle_message").textContent = game.battle.flash; document.querySelector(".battle").classList.add("show"); - update_battle(player); + update_battle(); } else { document.querySelector(".battle").classList.remove("show"); } -- cgit v1.2.3