summaryrefslogtreecommitdiff
path: root/play.ts
diff options
context:
space:
mode:
authorFrans Bongers <fransbongers@franss-mbp.home>2024-12-27 20:45:12 +0100
committerFrans Bongers <fransbongers@franss-mbp.home>2024-12-27 20:45:12 +0100
commit8749fad48dfca5d4374e15539b160db28a4ed2dc (patch)
tree12c3b418a99cdb15285d3cfebf99120b96dc7af9 /play.ts
parent9d0630a33e0358f943e68008823f355bceb71be1 (diff)
downloadland-and-freedom-8749fad48dfca5d4374e15539b160db28a4ed2dc.tar.gz
refactor selected cards
Diffstat (limited to 'play.ts')
-rw-r--r--play.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/play.ts b/play.ts
index af7f825..898982e 100644
--- a/play.ts
+++ b/play.ts
@@ -76,6 +76,8 @@ const ui = {
},
tracks: document.getElementById('tracks'),
hero_points: document.querySelector('#role_Anarchist .role_stat'),
+ turn_info: document.getElementById('turn_info'),
+ turn_info_card: document.getElementById('turn_info_card'),
year: document.getElementById('year'),
blank_markers: [],
bonuses: [],
@@ -373,7 +375,7 @@ function on_update() {
for (let c of view.hand) {
ui.cards[c].classList.remove('selected');
ui.hand.appendChild(ui.cards[c]);
- if (c === view.selected_card || view.final_bid.includes(c)) {
+ if (view.selected_cards.includes(c)) {
ui.cards[c].classList.add('selected');
}
}
@@ -424,6 +426,15 @@ function on_update() {
}
}
+ // ui.turn_info.replaceChildren();
+ // console.log('played_card', view.played_card);
+ // console.log('turn_info', ui.turn_info);
+ if (view.played_card === null) {
+ ui.turn_info.style.display = 'none';
+ } else {
+ ui.turn_info_card.setAttribute('data-card-id', view.played_card + '');
+ }
+
for (let g = 0; g < view.glory.length; ++g) {
ui.glory[g].setAttribute('data-faction-id', view.glory[g]);
}
@@ -434,9 +445,10 @@ function on_update() {
ui.year.replaceChildren(`Year ${view.year}`);
action_button('add_to_front', '+1 to a Front');
+ action_button('d_liberty', 'Decrease Liberty');
action_button('soviet_support', 'Soviet Support');
action_button('collectivization', 'Collectivization');
- action_button('d_liberty', 'Decrease Liberty');
+
action_button('d_collectivization', 'Decrease Collectivization');
action_button('d_foreign_aid', 'Decrease Foreign Aid');
action_button('d_government', 'Decrease Government');