summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js53
1 files changed, 40 insertions, 13 deletions
diff --git a/play.js b/play.js
index f003f37..48df886 100644
--- a/play.js
+++ b/play.js
@@ -23,10 +23,21 @@ const countries= [
]
const aside_events = [
- "eco_glasnost",
- "helsinki_final_act",
+ "honecker",
"st_nicholas_church",
- "we_are_the_people"
+ "helsinki_final_act",
+ "eco_glasnost",
+ "we_are_the_people",
+ "foreign_currency_debt_burden",
+ "li_peng",
+ "austria_hungary_border_reopened",
+ "grenztruppen",
+ "presidential_visit",
+ "securitate",
+ "laslzo_tokes",
+ "stand_fast",
+ "elena",
+ "new_years_eve_party"
]
let aside_events_showing = false
let show_discard = false
@@ -239,7 +250,7 @@ let ui = {
dem_hand_count: document.getElementById("role_stat_dem"),
com_hand_count: document.getElementById("role_stat_com"),
played_card: 0,
- events_panel: document.getElementById("events_panel"),
+ table_panel: document.getElementById("table_panel"),
hand_panel: document.getElementById("hand_panel"),
turn: document.getElementById("turn-tracker"),
round: document.getElementById("action-round-tracker"),
@@ -402,18 +413,18 @@ if (view.played_card > 0) {
document.getElementById("played_card_panel").classList.add("hide")
}
-// EVENTS PANEL
-document.getElementById("events").replaceChildren()
+// TABLE CARDS PANEL
+document.getElementById("table_cards").replaceChildren()
if (view.table_cards.length > 0) {
- document.getElementById("events_panel").classList.remove("hide")
+ document.getElementById("table_panel").classList.remove("hide")
for (let c of view.table_cards) {
let card = ui.cards[c]
- document.getElementById("events").appendChild(card);
+ document.getElementById("table_cards").appendChild(card);
card.classList.remove("hand_card")
card.classList.add('event_card');
}
} else {
- document.getElementById("events_panel").classList.add("hide")
+ document.getElementById("table_panel").classList.add("hide")
}
// OPPONENT HAND
@@ -494,24 +505,39 @@ if (view.ceausescu_cards.length > 0 && view.is_pwr_struggle === true) {
// UPDATE EVENT MARKERS
for (let id in view.persistent_events) {
- let marker = document.getElementById(id);
+ let marker = document.getElementById(id)
if (marker && view.persistent_events[id]) {
- marker.style.display = 'block';
+ marker.style.display = 'block'
} else if (marker && !view.persistent_events[id]) {
marker.style.display = 'none'
+ } else if (marker && view.persistent_events[id] !== "") {
+ marker.style.display = 'block'
+ } else if(marker && view.persistent_events[id] === '') {
+ marker.style.display = 'none'
}
}
-// CHECK WHETHER ANY EVENT MARKERS ARE SHOWING IN THE ASIDE
+// CHECK WHETHER ANY EVENT MARKERS ARE SHOWING IN THE ASIDE
+aside_events_showing = false
for (let id of aside_events) {
if (view.persistent_events[id]) {
aside_events_showing = true;
}
+
+ //Special check for events which are not true/false
+ if (view.persistent_events['foreign_currency_debt_burden'] !== '') {
+ aside_events_showing = true
+ }
+ if (view.persistent_events['stand_fast'] !== '') {
+ aside_events_showing = true
+ }
}
if (aside_events_showing) {
- document.getElementById('no_events').style.display = 'none'
+ document.getElementById('events_panel').classList.remove("hide")
+} else {
+ document.getElementById('events_panel').classList.add("hide")
}
let systematization = document.getElementById('systematization')
@@ -569,6 +595,7 @@ if (view.persistent_events['the_tyrant_is_gone'] > 0) {
action_button("done", "Done")
action_button("undo", "Undo")
+ console.log('view.persistent_events', view.persistent_events)
}