summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js26
1 files changed, 18 insertions, 8 deletions
diff --git a/play.js b/play.js
index be4b192..ef65b2f 100644
--- a/play.js
+++ b/play.js
@@ -841,13 +841,14 @@ function layout_stack(id, list, region, in_capital, dx, dy) {
function layout_available(list, dx, x0, y0) {
let y = 1650 + 45 - y0
let x = 25 + x0
+ let z = 7
for (let item of list) {
- let xo = item.my_id % 6
- //if (list.length < 6) xo -= 1
- item.style.left = (x + xo * dx) + "px"
+ item.style.left = x + "px"
item.style.top = y + "px"
- item.style.zIndex = 7 - xo
+ item.style.zIndex = z
item.my_stack = 0
+ x += dx
+ z -= 1
}
}
@@ -1151,8 +1152,12 @@ function on_update() {
e.classList.toggle("unavailable", region === UNAVAILABLE)
e.classList.toggle("selected", view.selected_general === pi * 6 + ai)
}
- //layout_available(avail_stack, avail_stack.length > 5 ? 48 : 63, pi * 625 + 0, 30)
- layout_available(avail_stack, 48, pi * 625 + 0, 30)
+ if (avail_stack.length >= 6)
+ layout_available(avail_stack, 48, pi * 625 + 0, 30)
+ else if (avail_stack.length >= 5)
+ layout_available(avail_stack, 63, pi * 625 + 0, 30)
+ else
+ layout_available(avail_stack, 69, pi * 625 + 0, 30)
}
for (let pi = 0; pi < player_count; ++pi) {
@@ -1172,8 +1177,12 @@ function on_update() {
e.classList.toggle("unavailable", region === UNAVAILABLE)
e.classList.toggle("selected", view.selected_governor === pi * 6 + ai)
}
- //layout_available(avail_stack, avail_stack.length > 5 ? 43 : 58, pi * 625 + 325, 27)
- layout_available(avail_stack, 43, pi * 625 + 325, 27)
+ if (avail_stack.length >= 6)
+ layout_available(avail_stack, 43, pi * 625 + 325, 27)
+ else if (avail_stack.length >= 5)
+ layout_available(avail_stack, 58, pi * 625 + 325, 27)
+ else
+ layout_available(avail_stack, 64, pi * 625 + 325, 27)
}
ui.body.classList.toggle("military", view.color === 0)
@@ -1240,6 +1249,7 @@ function on_update() {
action_button("spend_military", "Spend Military")
action_button("spend_senate", "Spend Senate")
+ action_button("reroll", "Reroll")
action_button("roll", "Roll")