From d0d2772604ab579f951a746b53674632d4256ec4 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 23 Mar 2022 15:10:06 +0100 Subject: Show current scenario in game log. --- play.js | 4 +++- rules.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/play.js b/play.js index c6cffa9..4e3212f 100644 --- a/play.js +++ b/play.js @@ -69,7 +69,9 @@ function on_log(text) { text = text.replace(/^([A-Z]):/, ' $1 '); - if (text.match(/^~ .* ~$/)) + if (text.match(/^Scenario: /)) + p.className = 'st', text = text.substring(10); + else if (text.match(/^~ .* ~$/)) p.className = 'br', text = text.substring(2, text.length-2); else if (text.match(/^Start Lancaster turn/)) p.className = 'L'; diff --git a/rules.js b/rules.js index 5bbcefb..717ec41 100644 --- a/rules.js +++ b/rules.js @@ -3412,6 +3412,7 @@ exports.setup = function (seed, scenario, options) { setup_richard_iii(); else throw new Error("Unknown scenario:", scenario); + log("Scenario: " + scenario); start_campaign(); return game; } -- cgit v1.2.3