summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-10-27 20:41:10 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-10-27 20:41:10 +0000
commit3e36074596d23d78b48c0a999b57d5a6f3808030 (patch)
tree6760d8dd3b4adc09a1306350f76c5a68301b3569 /play.js
parent966d67c6d8d0dde94635f4cfaea5181944848a79 (diff)
download1989-dawn-of-freedom-3e36074596d23d78b48c0a999b57d5a6f3808030.tar.gz
New power struggle card layout
Diffstat (limited to 'play.js')
-rw-r--r--play.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/play.js b/play.js
index 9e00d94..7446aad 100644
--- a/play.js
+++ b/play.js
@@ -372,6 +372,8 @@ const ui = {
played_card: document.getElementById("played_card"),
scoring_card: document.getElementById("scoring_card"),
played_power_card: document.getElementById("played_power_card"),
+ power_card_1: document.getElementById("power_card_1"),
+ power_card_2: document.getElementById("power_card_2"),
hand: document.getElementById("hand"),
power_hand: document.getElementById("power_hand"),
opp_hand: document.getElementById("opp_hand"),
@@ -642,17 +644,26 @@ function on_update() {
// UPDATE CARD DISPLAYS
ui.played_card.replaceChildren()
-
+ ui.power_card_1.replaceChildren()
+ ui.power_card_2.replaceChildren()
+
+ console.log('view.is_pwr_struggle', view.is_pwr_struggle, 'view.power_card_1', view.power_card_1, 'view.power_card_2', view.power_card_2)
if (!view.is_pwr_struggle) {
if (view.played_card > 0)
ui.played_card.appendChild(ui.cards[view.played_card])
+ document.getElementById("scoring_card_panel").style.display = "none"
} else {
+ document.getElementById("scoring_card_panel").style.display = "flex"
if (view.played_card > 0)
ui.scoring_card.appendChild(ui.cards[view.played_card])
+ if (view.power_card_1)
+ ui.power_card_1.appendChild(ui.power_cards[view.power_card_1])
+ if (view.power_card_2)
+ ui.power_card_2.appendChild(ui.power_cards[view.power_card_2])
}
- ui.played_power_card.replaceChildren()
+/* ui.played_power_card.replaceChildren()
if (view.played_power_card > 0)
- ui.played_power_card.appendChild(ui.power_cards[view.played_power_card])
+ ui.played_power_card.appendChild(ui.power_cards[view.played_power_card])*/
ui.samizdat_card.replaceChildren()
if (view.samizdat > 0)
@@ -812,7 +823,7 @@ function on_log(text) {
p.className = "h3"
}
- text = text.replace(/([a-zA-Z])\*/g, "")
+ text = text.replace(/([a-zA-Z])\*/g, "$1")
p.innerHTML = text
return p
}