diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-08-04 16:38:49 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-08-21 00:28:20 +0200 |
commit | 237dfed31b0de3b5b6a6e3730b15816a5db5befa (patch) | |
tree | a9b43ef5b878b77c1c3f8b9e434a3c85c1a7c22c | |
parent | e433c17ab0171a4a16e3b4f1ff4c06ef2de3fa8d (diff) | |
download | washingtons-war-237dfed31b0de3b5b6a6e3730b15816a5db5befa.tar.gz |
fix layout errors in boxes
-rw-r--r-- | play.js | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -440,7 +440,7 @@ function get_army_xy(s) { let x, y if (s >= 66) { x = data.spaces[s].x - y = data.spaces[s].y - 80 + y = data.spaces[s].y - 120 } else { x = data.spaces[s].x y = data.spaces[s].y - 40 @@ -452,10 +452,9 @@ function get_static_xy(s) { let x, y if (s >= 66) { x = data.spaces[s].x - y = data.spaces[s].y + 60 + y = data.spaces[s].y + 20 } else { x = data.spaces[s].x - 20 - y = data.spaces[s].y + 15 y = data.spaces[s].y + 10 } return [ x, y ] @@ -597,13 +596,15 @@ function on_update() { if (s === NOWHERE) continue - let pos = (s < 66) ? ui.layout_static[s] : get_static_xy(s) + let [ x, y ] = (s < 66) ? ui.layout_static[s] : get_static_xy(s) + if (s >= 66) + y -= 60 + if (view.move && view.move.who === g) - pos = ui.layout_move + [ x, y ] = ui.layout_move if (view.react && view.react.who === g) - pos = ui.layout_react + [ x, y ] = ui.layout_react - let [ x, y ] = pos ui.generals[g].classList.toggle("selected", view.selected_general === g) |