diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-06-23 01:57:22 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 18:39:37 +0200 |
commit | 038d51ab138f2a8bfc86cb11e7b968d1e4e12ad8 (patch) | |
tree | ab117a8822ae43cf747fade83de639db4140e314 /play.js | |
parent | e05ce5bf91eefbe70d4ee7780a4c9980ed23c8e9 (diff) | |
download | time-of-crisis-038d51ab138f2a8bfc86cb11e7b968d1e4e12ad8.tar.gz |
Flanking Maneuver.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -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") |