diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-03-25 12:11:10 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-05-03 18:48:16 +0200 |
commit | 231cf0a4cea24c176c99089e822a7268d8cdde62 (patch) | |
tree | 31520b7843f4c330d14e49319d31de9c3de88dff /play.js | |
parent | cde668eb94e84e989bd547fd8571db78c347020a (diff) | |
download | andean-abyss-231cf0a4cea24c176c99089e822a7268d8cdde62.tar.gz |
Shaded/unshaded lines.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -109,6 +109,7 @@ let ui = { card_tip: document.getElementById("card_tip"), next_card: document.getElementById("next_card"), this_card: document.getElementById("this_card"), + shaded_event: document.getElementById("shaded_event"), deck_size: document.getElementById("deck_size"), tokens: { aid: document.getElementById("token_aid"), @@ -288,6 +289,8 @@ function get_layout_radius(s) { } function init_ui() { + register_action(ui.this_card, "event", undefined) + register_action(ui.shaded_event, "shaded", undefined) register_action(ui.tokens.aid, "aid", undefined) register_action(ui.resources[GOVT], "resources", GOVT) register_action(ui.resources[FARC], "resources", FARC) @@ -826,10 +829,16 @@ function on_update() { ui.tokens.propaganda.style.left = "1029px" } - ui.this_card.className = "card card_" + view.deck[0] + if (set_has([1,2,3,7,9,10,11,13], view.deck[0])) + ui.this_card.className = "card card_" + view.deck[0] + " n" + data.card_lines[view.deck[0]] + "c" + else + ui.this_card.className = "card card_" + view.deck[0] + " n" + data.card_lines[view.deck[0]] ui.next_card.className = "card card_" + view.deck[1] ui.deck_size.textContent = view.deck[2] + ui.this_card.classList.toggle("action", !!(view.actions && view.actions.event === 1)) + ui.shaded_event.classList.toggle("action", !!(view.actions && view.actions.shaded === 1)) + layout_sop() layout_score() @@ -1086,7 +1095,7 @@ function on_log(text) { if (text.match(/^>/)) { text = text.substring(1) - p.className = "i" + p.className = "ind" } text = text.replace(/&/g, "&") @@ -1128,6 +1137,10 @@ function on_log(text) { text = text.substring(4) p.className = "h4" } + else if (text.match(/^\.i/)) { + text = text.substring(3) + p.className = "i" + } p.innerHTML = text return p |