summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-10-05 12:37:18 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 12:53:17 +0100
commit7163815c115caabc70f6a5220e12e03a4ebd1375 (patch)
tree0cdcb86e45f9ab4c05ca6c926d19607549e711cf
parent56ca28352eeef7c9be69797744d6db2ee86dafed (diff)
downloadhammer-of-the-scots-7163815c115caabc70f6a5220e12e03a4ebd1375.tar.gz
Add confirmation when clicking PASS in a battle dialog.
-rw-r--r--ui.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui.js b/ui.js
index 2b14e2b..b4df3fd 100644
--- a/ui.js
+++ b/ui.js
@@ -162,7 +162,11 @@ function on_blur_battle_button(evt) {
function on_click_battle_hit(evt) { send_action('battle_hit', evt.target.block); }
function on_click_battle_fire(evt) { send_action('battle_fire', evt.target.block); }
function on_click_battle_retreat(evt) { send_action('battle_retreat', evt.target.block); }
-function on_click_battle_pass(evt) { send_action('battle_pass', evt.target.block); }
+
+function on_click_battle_pass(evt) {
+ if (window.confirm("Are you sure that you want to PASS with " + block_name(evt.target.block) + "?"))
+ send_action('battle_pass', evt.target.block);
+}
function on_click_card(evt) {
let c = evt.target.id.split("+")[1] | 0;