From 0da3cc2279295813214950eed623fd188db9067f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 28 Sep 2023 19:19:15 +0200 Subject: Improve log messages. --- play.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index b0228af..dd6984b 100644 --- a/play.js +++ b/play.js @@ -472,7 +472,7 @@ function on_click_piece_tip(id) { ui.pieces[id].scrollIntoView({ block:"center", inline:"center", behavior:"smooth" }) } -const DICE = { +const DICE_TEXT = { D0: '[0]', D1: '[1]', D2: '[2]', @@ -482,6 +482,16 @@ const DICE = { D6: '[6]', } +const DICE = { + D0: '', + D1: '', + D2: '', + D3: '', + D4: '', + D5: '', + D6: '', +} + function sub_dice(match) { return DICE[match] } @@ -493,7 +503,7 @@ function sub_hex(match, p1) { n = x + " (" + n + ")" else n = x - return `${n}` + return `${n}` } function sub_piece(match, p1) { @@ -525,8 +535,8 @@ function on_log(text) { text = text.replace(/P(\d+)/g, sub_piece) text = text.replace(/\bD\d\b/g, sub_dice) - text = text.replace(/French/g, 'French') - text = text.replace(/Coalition/g, 'Coalition') + text = text.replace(/^French/g, 'French') + text = text.replace(/^Coalition/g, 'Coalition') if (text.match(/^\.h1 /)) { text = text.substring(4) -- cgit v1.2.3