diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-07-06 18:49:50 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-07-07 19:05:52 +0200 |
commit | b1f87e0acdaf88d7759f8293598d42edd303be65 (patch) | |
tree | ddaa0627df65d194d9758fcefc0ce0bf1c4ff028 /play.js | |
parent | 593a5fb24156af994ab0a37b5bd3dc13a99c8e78 (diff) | |
download | time-of-crisis-b1f87e0acdaf88d7759f8293598d42edd303be65.tar.gz |
Fix Militia + Capital action layout.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -972,6 +972,11 @@ function layout_stack(id, list, region, in_capital, dx, dy, z = 1) { stack_count[region] += 1 } + if (in_capital === 2) { + x += 36 + y += 18 + } + for (let i = list.length - 1; i >= 0; --i) { let item = list[i] item.style.left = x + "px" @@ -1283,10 +1288,13 @@ function on_update() { else layout_battle_stack(view.combat.attacker < 0, [ ui.militia[region] ], region, true) } else { + let inside = 1 + if (is_action("capital", region)) + inside = 2 if (has_militia_castra(region)) - layout_stack(-1, [ ui.mcastra[region], ui.militia[region] ], region, true, 16, 16) + layout_stack(-1, [ ui.mcastra[region], ui.militia[region] ], region, inside, 16, 16) else - layout_stack(-1, [ ui.militia[region] ], region, true, 16, 16) + layout_stack(-1, [ ui.militia[region] ], region, inside, 16, 16) } } } @@ -1357,7 +1365,7 @@ function on_update() { if (is_battle_stack(region, "general", pi * 6 + ai)) layout_battle_stack(pi * 6 + ai === view.combat.attacker, stack, region) else - layout_stack(pi * 6 + ai, stack, region, inside, 16, 16) + layout_stack(pi * 6 + ai, stack, region, inside ? 1 : 0, 16, 16) } else { avail_stack.push(e) } |