diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-10-05 12:37:18 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:12:55 +0100 |
commit | 457cb00679edcdbcf1c94d3c0bf964996983f033 (patch) | |
tree | 2e7966bf14c529dcb95d4876b5df6ee38a401dfb /ui.js | |
parent | 89e0a163ba7434d9cff2ee6b6d5729a892a286c6 (diff) | |
download | richard-iii-457cb00679edcdbcf1c94d3c0bf964996983f033.tar.gz |
Add confirmation when clicking PASS in a battle dialog.
Diffstat (limited to 'ui.js')
-rw-r--r-- | ui.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -219,10 +219,14 @@ 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_charge(evt) { send_action('battle_charge', evt.target.block); } function on_click_battle_treachery(evt) { send_action('battle_treachery', 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; send_action('play', c); |