summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-02 15:19:42 +0200
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:16 +0200
commitbd832e6bb275ac07e74e3963179defe49e7505dd (patch)
treece3cacc71ce5d63d7b6442cb58f596a1de89eab8 /play.js
parent8ce60ae049b47177e83560468c36e68a153b9cfb (diff)
downloadandean-abyss-bd832e6bb275ac07e74e3963179defe49e7505dd.tar.gz
Box outline for both shaded and unshaded events.
Diffstat (limited to 'play.js')
-rw-r--r--play.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/play.js b/play.js
index 1951523..3a81923 100644
--- a/play.js
+++ b/play.js
@@ -111,6 +111,7 @@ let ui = {
next_card: document.getElementById("next_card"),
this_card: document.getElementById("this_card"),
shaded_event: document.getElementById("shaded_event"),
+ unshaded_event: document.getElementById("unshaded_event"),
deck_size: document.getElementById("deck_size"),
tokens: {
aid: document.getElementById("token_aid"),
@@ -319,6 +320,7 @@ function on_blur_event() {
function init_ui() {
register_action(ui.this_card, "event", undefined)
+ register_action(ui.unshaded_event, "unshaded", undefined)
register_action(ui.shaded_event, "shaded", undefined)
register_action(ui.tokens.aid, "aid", undefined)
register_action(ui.resources[GOVT], "resources", GOVT)
@@ -800,6 +802,13 @@ function layout_shipments(s, list, xc, yc) {
}
}
+function make_card_class_name(c) {
+ if (set_has([1,2,3,7,9,10,11,13], view.deck[0]))
+ return "card card_" + c + " u" + data.card_unshaded_lines[c] + " s" + data.card_shaded_lines[c] + " c"
+ else
+ return "card card_" + c + " u" + data.card_unshaded_lines[c] + " s" + data.card_shaded_lines[c]
+}
+
function on_update() {
switch (player) {
case "Government": ui.favicon.href = "images/icon_govt.png"; break
@@ -865,15 +874,13 @@ function on_update() {
ui.tokens.propaganda.style.left = "1029px"
}
- 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.this_card.className = make_card_class_name(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))
+ ui.unshaded_event.classList.toggle("action", !!(view.actions && view.actions.unshaded === 1))
layout_sop()
layout_score()