summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-08-04 16:38:49 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-21 00:28:20 +0200
commit237dfed31b0de3b5b6a6e3730b15816a5db5befa (patch)
treea9b43ef5b878b77c1c3f8b9e434a3c85c1a7c22c
parente433c17ab0171a4a16e3b4f1ff4c06ef2de3fa8d (diff)
downloadwashingtons-war-237dfed31b0de3b5b6a6e3730b15816a5db5befa.tar.gz
fix layout errors in boxes
-rw-r--r--play.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/play.js b/play.js
index 3565ae4..ebb70b5 100644
--- a/play.js
+++ b/play.js
@@ -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)