summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-22 16:11:05 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-22 16:11:05 +0200
commit78754928c9b1c55bdffe40ff33342c7329f3ce77 (patch)
treee7c2b523d843a18ea0aa21750441ec237bcdb690 /play.js
parent5ab7ccf00da33d2fcc02d582b8528596d92f22ed (diff)
downloadmaria-78754928c9b1c55bdffe40ff33342c7329f3ce77.tar.gz
political phase - card data
Diffstat (limited to 'play.js')
-rw-r--r--play.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/play.js b/play.js
index f34d5f6..6a76f5f 100644
--- a/play.js
+++ b/play.js
@@ -496,12 +496,10 @@ function make_tc_deck_hand(n) {
return list
}
-function make_political_card(pc) {
+function make_political_card(id) {
let e = document.createElement("div")
- if (pc === 0)
- e.className = "card polcard reverse"
- else
- e.className = "card polcard c" + pc
+ e.className = "card polcard c" + id
+ register_action(e, "political", id)
return e
}
@@ -1100,7 +1098,7 @@ function on_update() {
ui.pc_display[pow].replaceChildren()
for (let tc of view.saved[pow])
ui.pc_display[pow].appendChild(show_tc(tc))
- if (view.display[pow] >= 0)
+ if (view.display && view.display[pow] >= 0)
ui.pc_display[pow].appendChild(show_tc(view.display[pow]))
}
@@ -1215,8 +1213,8 @@ function on_update() {
function sub_political(match, p1) {
let x = p1 | 0
- let n = political_name[x]
- return `<span class="political_tip ${p}" onmouseenter="on_focus_political_tip(${x})" onmouseleave="on_blur_political_tip(${x})">${n}</span>`
+ let n = political_cards[x].title
+ return `<span class="card_tip" onmouseenter="on_focus_political_tip(${x})" onmouseleave="on_blur_political_tip(${x})">${n}</span>`
}
function sub_piece(match, p1) {