summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-08-26 11:10:59 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-26 11:47:04 +0200
commit1a4469fa24d684f407429f9ab1a61510728441c6 (patch)
treef07b6f6bbde17e6b8b12125a0268fc8751566d95
parent0c5fb248c623c627c7d29c9a2736b74041202d20 (diff)
downloadwashingtons-war-1a4469fa24d684f407429f9ab1a61510728441c6.tar.gz
Confirm before PASS when other actions are still possible.
-rw-r--r--play.js2
-rw-r--r--rules.js8
2 files changed, 6 insertions, 4 deletions
diff --git a/play.js b/play.js
index 312dd0b..ddfd31c 100644
--- a/play.js
+++ b/play.js
@@ -805,8 +805,8 @@ function on_update() {
action_button("next", "Next")
action_button("done", "Done")
action_button("pass", "Pass")
+ confirm_action_button("confirm_pass", "Pass", "Are you sure you want to PASS on this action?")
action_button("undo", "Undo")
-
}
/* TOOLTIPS */
diff --git a/rules.js b/rules.js
index b4d0819..81ee30d 100644
--- a/rules.js
+++ b/rules.js
@@ -1553,11 +1553,11 @@ states.discard_event_pc_action = {
inactive: "to take a PC action",
prompt() {
view.prompt = "Place, flip, or remove PC marker."
- view.actions.pass = 1
if (game.active === P_BRITAIN)
gen_british_discard_event_pc_action()
else
gen_american_discard_event_pc_action()
+ view.actions.confirm_pass = 1
},
space(s) {
push_undo()
@@ -1624,13 +1624,13 @@ states.ops_pc = {
inactive: "to take a PC action",
prompt() {
view.prompt = "Place or flip PC markers. " + game.count + " left."
- view.actions.pass = 1
if (game.count > 0) {
if (game.active === P_BRITAIN)
gen_british_pc_ops()
else
gen_american_pc_ops()
}
+ view.actions.confirm_pass = 1
},
space(s) {
push_undo()
@@ -1945,7 +1945,7 @@ states.ops_general_who = {
if (land)
view.actions.landing_party = 1
gen_activate_general()
- view.actions.pass = 1
+ view.actions.confirm_pass = 1
},
landing_party() {
push_undo()
@@ -4598,6 +4598,8 @@ exports.action = function (state, player, action, arg) {
if (player === game.active) {
let S = states[game.state]
+ if (action === "confirm_pass")
+ action = "pass"
if (action in S) {
S[action](arg)
} else {