diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-06-15 17:52:18 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:12:55 +0100 |
commit | 76386d85a9279792e14a1fb4f1b422b8248f3eed (patch) | |
tree | 58cbd60ffa2053fb53c45eb391179cf6e0f6c315 | |
parent | be2d48acc6fba15a2fbf5b99c85d0a8a16d7c6c6 (diff) | |
download | richard-iii-76386d85a9279792e14a1fb4f1b422b8248f3eed.tar.gz |
Add "Rematch" button for easier repeat match making.
-rw-r--r-- | play.html | 1 | ||||
-rw-r--r-- | ui.js | 10 |
2 files changed, 4 insertions, 7 deletions
@@ -358,6 +358,7 @@ div.block { Undo </button> + <div id="rematch_button" class="image_button hide" onclick="send_rematch()"><img src="/images/cycle.svg"></div> </div> <div class="grid_role"> @@ -48,8 +48,6 @@ function toggle_blocks() { document.getElementById("map").classList.toggle("hide_blocks"); } -let game = null; - let ui = { cards: {}, areas: {}, @@ -629,7 +627,7 @@ function update_cards() { document.querySelector("#york_card").className = "small_card " + CARDS[game.y_card].image; } -function update_battle(player) { +function update_battle() { function fill_cell(name, list, reserve) { let cell = window[name]; @@ -717,9 +715,7 @@ function update_battle(player) { } } -function on_update(state, player) { - game = state; - +function on_update() { show_action_button("#undo_button", "undo"); show_action_button("#pass_button", "pass"); show_action_button("#end_action_phase_button", "end_action_phase"); @@ -743,7 +739,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"); } |