From b588b6230417f2506622111737f2aef60af13b99 Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Sun, 5 Jul 2026 18:12:48 +0200 Subject: [PATCH] Fix Kush main menu background It looked ok as long as the window had a 16:9 aspect ratio, however default window size is 4:3 which squishes the balcony. Add a horizontal alignment support for background layers, which allows to fix this issue for any aspect ratio. Signed-off-by: Ralph Sennhauser --- .../mods/public/gui/pregame/BackgroundHandler.js | 14 ++++++++++++++ .../public/gui/pregame/backgrounds/background.js | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/binaries/data/mods/public/gui/pregame/BackgroundHandler.js b/binaries/data/mods/public/gui/pregame/BackgroundHandler.js index c5bc7ec80f..8c16669ef3 100644 --- a/binaries/data/mods/public/gui/pregame/BackgroundHandler.js +++ b/binaries/data/mods/public/gui/pregame/BackgroundHandler.js @@ -29,6 +29,20 @@ class BackgroundLayer "bottom": backgroundsSize.bottom }; } + else if (this.layer.halign) + { + const left = ({ + "left": 0.0, + "center": (backgroundsSize.right - width) / 2, + "right": backgroundsSize.right - width, + }[this.layer.halign] || 0.0) + offset; + this.background.size = { + "left": left, + "top": backgroundsSize.top, + "right": left + width, + "bottom": backgroundsSize.bottom + }; + } else { const right = backgroundsSize.right / 2 + offset; diff --git a/binaries/data/mods/public/gui/pregame/backgrounds/background.js b/binaries/data/mods/public/gui/pregame/backgrounds/background.js index 956835b22a..0b8913e7c2 100644 --- a/binaries/data/mods/public/gui/pregame/backgrounds/background.js +++ b/binaries/data/mods/public/gui/pregame/backgrounds/background.js @@ -59,7 +59,8 @@ export const backgrounds = { { "offset": (time, width) => -0.1, "sprite": "background-kush1-4", - "tiling": true + "tiling": false, + "halign": "right" } ],