From 1a4469fa24d684f407429f9ab1a61510728441c6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 26 Aug 2024 11:10:59 +0200 Subject: Confirm before PASS when other actions are still possible. --- play.js | 2 +- rules.js | 8 +++++--- 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 { -- cgit v1.2.3