summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-15 17:52:18 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:08:56 +0100
commitadf559f1b779690eb0e0bef21b4c29fb69520c75 (patch)
tree53d1c8eb5f7a2ed47d149a5a7130c06a9d7effec
parent526036030fb0466f370848fd28002c6da24c451f (diff)
downloadjulius-caesar-adf559f1b779690eb0e0bef21b4c29fb69520c75.tar.gz
Add "Rematch" button for easier repeat match making.
-rw-r--r--play.html1
-rw-r--r--ui.js10
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 {
<button id="pass_button" onclick="select_pass()" class="hide">Pass</button>
<button id="undo_button" onclick="select_undo()" class="hide">Undo</button>
+ <div id="rematch_button" class="image_button hide" onclick="send_rematch()"><img src="/images/cycle.svg"></div>
</div>
<div class="grid_role">
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");
}