From c7af6c04c5fbc3b85752c7b5d81c964d02695d99 Mon Sep 17 00:00:00 2001 From: VariableVince <24507472+VariableVince@users.noreply.github.com> Date: Thu, 17 Jul 2025 02:35:16 +0200 Subject: [PATCH] Fix: "Game speed" not "Replay speed" during Single player game (#1457) ## Description: Fix for regression. In #1145, "Game speed" was added to show in Single player instead of "Replay speed", and then in #1243 again. But after the changes in #1415 it no longer worked, although some code remained. Before: Replay speed when in single player
game After: Game speed instead of Replay speed ## 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 - [] 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: tryout33 --- src/client/graphics/layers/GameRightSidebar.ts | 4 +++- src/client/graphics/layers/ReplayPanel.ts | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/graphics/layers/GameRightSidebar.ts b/src/client/graphics/layers/GameRightSidebar.ts index 95111ee2a..fc5ffdd30 100644 --- a/src/client/graphics/layers/GameRightSidebar.ts +++ b/src/client/graphics/layers/GameRightSidebar.ts @@ -76,7 +76,9 @@ export class GameRightSidebar extends LitElement implements Layer { private toggleReplayPanel(): void { this._isReplayVisible = !this._isReplayVisible; - this.eventBus.emit(new ShowReplayPanelEvent(this._isReplayVisible)); + this.eventBus.emit( + new ShowReplayPanelEvent(this._isReplayVisible, this._isSinglePlayer), + ); } private onPauseButtonClick() { diff --git a/src/client/graphics/layers/ReplayPanel.ts b/src/client/graphics/layers/ReplayPanel.ts index 5167ba58e..e68288596 100644 --- a/src/client/graphics/layers/ReplayPanel.ts +++ b/src/client/graphics/layers/ReplayPanel.ts @@ -11,7 +11,10 @@ import { translateText } from "../../Utils"; import { Layer } from "./Layer"; export class ShowReplayPanelEvent { - constructor(public visible: boolean = true) {} + constructor( + public visible: boolean = true, + public isSingleplayer: boolean = false, + ) {} } @customElement("replay-panel") @@ -36,6 +39,7 @@ export class ReplayPanel extends LitElement implements Layer { if (this.eventBus) { this.eventBus.on(ShowReplayPanelEvent, (event: ShowReplayPanelEvent) => { this.visible = event.visible; + this.isSingleplayer = event.isSingleplayer; }); } }