From 9c03813f63a75f4e8622c8c246cf088b679dd14a Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sun, 13 Jul 2025 15:01:15 -0700 Subject: [PATCH] fix team bar (#1422) ## Description: On team games the bar was about 80 pixels below the top of the screen ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: evan --- src/client/graphics/layers/SpawnTimer.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/client/graphics/layers/SpawnTimer.ts b/src/client/graphics/layers/SpawnTimer.ts index c3a5f97cc..da96c89a1 100644 --- a/src/client/graphics/layers/SpawnTimer.ts +++ b/src/client/graphics/layers/SpawnTimer.ts @@ -59,17 +59,11 @@ export class SpawnTimer implements Layer { const barHeight = 10; const barWidth = this.transformHandler.width(); - let yOffset: number; - if (this.game.inSpawnPhase()) { - // At spawn time, draw at top - yOffset = 0; - } else if (this.game.config().gameConfig().gameMode === GameMode.Team) { - // After spawn, only in team mode, offset based on screen width - const screenW = window.innerWidth; - yOffset = screenW > 1024 ? 80 : 58; - } else { - // Not spawn and not team mode: no bar + if ( + !this.game.inSpawnPhase() && + this.game.config().gameConfig().gameMode !== GameMode.Team + ) { return; } @@ -80,7 +74,7 @@ export class SpawnTimer implements Layer { const segmentWidth = barWidth * ratio; context.fillStyle = this.colors[i]; - context.fillRect(x, yOffset, segmentWidth, barHeight); + context.fillRect(x, 0, segmentWidth, barHeight); x += segmentWidth; filledRatio += ratio;