summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/play.js b/play.js
index efd3935..b514a2a 100644
--- a/play.js
+++ b/play.js
@@ -620,7 +620,7 @@ function on_init() {
}
ui.elector = [ [], [], [], [], [], [] ]
- for (let i = 0; i < 30; ++i) {
+ for (let i = 0; i < 50; ++i) {
ui.elector[P_FRANCE].push(create_conquest("marker elector_marker_france"))
ui.elector[P_PRUSSIA].push(create_conquest("marker elector_marker_prussia"))
ui.elector[P_PRAGMATIC].push(create_conquest("marker elector_marker_austria_pragmatic"))
@@ -663,8 +663,10 @@ function on_init() {
ui.combat.id = "combat"
ui.combat.style.zIndex = 2000
- ui.tcbreak = document.createElement("div")
- ui.tcbreak.className = "draw-break"
+ ui.tcbreak1 = document.createElement("div")
+ ui.tcbreak1.className = "draw-break"
+ ui.tcbreak2 = document.createElement("div")
+ ui.tcbreak2.className = "draw-break"
ui.turn = document.createElement("div")
ui.turn.className = "marker turn_marker"
@@ -1153,22 +1155,19 @@ function on_update() {
*/
ui.hand[pow].replaceChildren()
- if (typeof view.hand[pow] === "number") {
- for (let i = 0; i < view.hand[pow]; ++i)
- ui.hand[pow].appendChild(ui.tc_hand[pow][i])
- } else {
- view.hand[pow].sort(cmp_tc)
- for (let c of view.hand[pow]) {
+ for (let c of view.hand1[pow].slice().sort(cmp_tc))
+ ui.hand[pow].appendChild(show_tc(c))
+ if (view.hand2[pow].length > 0) {
+ ui.hand[pow].appendChild(ui.tcbreak1)
+ for (let c of view.hand2[pow].slice().sort(cmp_tc))
ui.hand[pow].appendChild(show_tc(c))
- }
}
}
if (view.draw) {
- view.draw.sort(cmp_tc)
- if (view.hand[view.power].length > 0)
- ui.hand[view.power].appendChild(ui.tcbreak)
- for (let c of view.draw)
+ if (view.hand1[view.power].length + view.hand2[view.power].length > 0)
+ ui.hand[view.power].appendChild(ui.tcbreak2)
+ for (let c of view.draw.slice().sort(cmp_tc))
ui.hand[view.power].appendChild(ui.tc[c])
}