From d4bfa6838b1a4e7ace1766cb27a3233c881cadfc Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 3 Jul 2024 23:47:32 +0200 Subject: layout french --- play.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/play.js b/play.js index 297866a..4b6e7ce 100644 --- a/play.js +++ b/play.js @@ -525,17 +525,20 @@ function on_update() { if (view.react && view.react.who === g) [ x, y ] = get_army_xy_lerp(view.react.from, view.react.to) - if (s !== FRENCH_REINFORCEMENTS && count_french_cu(s) > 0) - x += 30 - if (view.move && view.move.who === g) { ui.generals[g].classList.add("selected") + if (view.move.carry_french > 0 && view.move.carry_american > 0) + x += 30 x += 30 } else if (view.react && view.react.who === g) { ui.generals[g].classList.add("selected") + if (view.react.carry_french > 0 && view.react.carry_american > 0) + x += 30 x += 30 } else { ui.generals[g].classList.remove("selected") + if (count_french_cu(s) > 0 && count_american_cu(s) > 0) + x += 30 if (s < 66) { let offset = general_offset(g) x += offset * (45 + 9) @@ -546,10 +549,8 @@ function on_update() { let off_x = offset % 3 let off_y = offset / 3 | 0 let ctr_x = total > 3 ? 3 : total - off_x -= (ctr_x - 1) / 2 // off_y -= (total / 3 | 0) / 2 - x += off_x * (45 + 9) y += off_y * (45 + 9) y -= 15 -- cgit v1.2.3