diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 40 |
1 files changed, 24 insertions, 16 deletions
@@ -737,11 +737,11 @@ function on_init() { for (let p = 0; p < 4; ++p) { for (let i = 0; i < 12; ++i) { ui.seat_of_power[p * 12 + i] = create_thing({ className: PLAYER_CLASS[p] + " seat_of_power hide" }) - ui.seat_of_power[p * 12 + i].style.left = LAYOUT_QUAESTOR[i][0] + "px" - ui.seat_of_power[p * 12 + i].style.top = LAYOUT_QUAESTOR[i][1] + "px" + ui.seat_of_power[p * 12 + i].style.left = (LAYOUT_QUAESTOR[i][0] + 16) + "px" + ui.seat_of_power[p * 12 + i].style.top = (LAYOUT_QUAESTOR[i][1]) + "px" ui.breakaway[p * 12 + i] = create_thing({ className: PLAYER_CLASS[p] + " breakaway hide" }) - ui.breakaway[p * 12 + i].style.left = LAYOUT_QUAESTOR[i][0] + "px" - ui.breakaway[p * 12 + i].style.top = LAYOUT_QUAESTOR[i][1] + "px" + ui.breakaway[p * 12 + i].style.left = (LAYOUT_QUAESTOR[i][0] + 16) + "px" + ui.breakaway[p * 12 + i].style.top = (LAYOUT_QUAESTOR[i][1]) + "px" } } @@ -770,8 +770,8 @@ function on_init() { ui.militia[region] = create_thing({ className: "militia hide", my_action: "militia", my_id: region }) ui.capital[region] = document.getElementById(REGION_NAME[region] + "_Capital") ui.quaestor[region] = create_thing({ className: "quaestor hide" }) - ui.quaestor[region].style.left = LAYOUT_QUAESTOR[region][0] + "px" - ui.quaestor[region].style.top = LAYOUT_QUAESTOR[region][1] + "px" + ui.quaestor[region].style.left = (LAYOUT_QUAESTOR[region][0] + 16) + "px" + ui.quaestor[region].style.top = (LAYOUT_QUAESTOR[region][1]) + "px" // at most 3 mobs per province ui.mobs[region * 3 + 0] = create_piece(region, "mob", "mob") @@ -843,11 +843,10 @@ function layout_available(list, dx, x0, y0) { let x = 25 + x0 for (let item of list) { let xo = item.my_id % 6 - if (list.length < 6) - xo -= 1 + //if (list.length < 6) xo -= 1 item.style.left = (x + xo * dx) + "px" item.style.top = y + "px" - item.style.zIndex = 1 + item.style.zIndex = 7 - xo item.my_stack = 0 } } @@ -878,11 +877,18 @@ function layout_mob(region, i, e, visible, x2) { } function layout_barbarian_dice(black, white, tribe) { - let [ x, y, w, h ] = LAYOUT_DICE[tribe] - black.style.top = (y + 4) + "px" - white.style.top = (y + 4) + "px" - black.style.left = (x + 0) + "px" - white.style.left = (x + 50) + "px" + if (tribe >= 0) { + show(black) + show(white) + let [ x, y, w, h ] = LAYOUT_DICE[tribe] + black.style.top = (y + 4) + "px" + white.style.top = (y + 4) + "px" + black.style.left = (x + 0) + "px" + white.style.left = (x + 50) + "px" + } else { + hide(black) + hide(white) + } } function on_update() { @@ -1145,7 +1151,8 @@ 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, avail_stack.length > 5 ? 48 : 63, pi * 625 + 0, 30) + layout_available(avail_stack, 48, pi * 625 + 0, 30) } for (let pi = 0; pi < player_count; ++pi) { @@ -1165,7 +1172,8 @@ 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, avail_stack.length > 5 ? 43 : 58, pi * 625 + 325, 27) + layout_available(avail_stack, 43, pi * 625 + 325, 27) } ui.body.classList.toggle("military", view.color === 0) |