From 1ad1a6ddfbc94b649b1f629aed4f12fee414c6f2 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 6 Dec 2024 21:37:49 +0000 Subject: Event and Operation banners in log --- play.js | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) (limited to 'play.js') diff --git a/play.js b/play.js index 0135fd3..6e05560 100644 --- a/play.js +++ b/play.js @@ -837,7 +837,10 @@ let event_side = null function sub_card_name(_match, p1) { let x = p1 | 0 - return `${cards[x].name.replace("*", "")}` + if (scoring_cards.includes(x)) + return `${cards[x].name.replace("*", "")}` + else + return `${cards[x].name.replace("*", "")}` } function sub_power_card_name(_match, p1) { @@ -872,6 +875,7 @@ const die = { function on_log(text, ix) { let p = document.createElement("div") + console.log('text', text) let event_string = text.match(/^C(\d+)/) if (event_string) event_n = parseInt(event_string[1]) @@ -902,16 +906,46 @@ function on_log(text, ix) { text = text.substring(4) p.className = "h2" log_event = 0 - } else if (text.match(/^\.d/)) { - text = "Democrat Action Round" + } else if (text.match(/^\.O\.d/)) { + text = "operations" + p.className = "h2 dem" + log_event = 0 + } else if (text.match(/^\.V\.d/)) { + text = "event" + p.className = "h2 dem" + log_event = 0 + } else if (text.match(/^\.T\.d/)) { + text = "event and operations" p.className = "h2 dem" log_event = 0 - } /*else if (text.match(/\.D$/)) { - p.classList.add("dem") - } */ else if (text.match(/^\.c/)) { - text = "Communist Action Round" + } else if (text.match(/^\.S\.d/)) { + text = text.replace(".S.d", "") + p.className = "h2 dem" + log_event = 0 + } else if (text.match(/^\.O\.c/)) { + text = "operations" + p.className = "h2 com" + log_event = 0 + } else if (text.match(/^\.V\.c/)) { + text = "event" p.className = "h2 com" log_event = 0 + } else if (text.match(/^\.T\.c/)) { + text = "event and operations" + p.className = "h2 com" + log_event = 0 + } else if (text.match(/^\.S\.c/)) { + text = text.replace(".S.c", "") + p.className = "h2 com" + log_event = 0 + } else if (text.match(/\.c/)) { + text = text.replace(".c", "") + p.className = "h2 com" + log_event = 0 + } else if (text.match(/\.d/)) { + text = text.replace(".d", "") + p.className = "h2 dem" + log_event = 0 } else if (text.match(/^\.h3/)) { text = text.substring(4) p.className = "h3" -- cgit v1.2.3