From 4cd3c2f9847c152f39fd87fd20e085b5de98ee8b Mon Sep 17 00:00:00 2001 From: VariableVince <24507472+VariableVince@users.noreply.github.com> Date: Wed, 11 Jun 2025 08:13:18 +0200 Subject: [PATCH] Rename Replay speed to Game speed in Singleplayer (#1145) ## Description: Change the title of the replay panel from "Replay speed" to "Game speed" when in a Singleplayer game. BEFORE  AFTER  ## 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: tryout33 --- resources/lang/en.json | 3 ++- src/client/graphics/layers/ReplayPanel.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/resources/lang/en.json b/resources/lang/en.json index 701c383fa..d3b950215 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -446,7 +446,8 @@ "alliances": "Alliances" }, "replay_panel": { - "replay_speed": "Replay speed" + "replay_speed": "Replay speed", + "game_speed": "Game speed" }, "error_modal": { "crashed": "Game crashed!", diff --git a/src/client/graphics/layers/ReplayPanel.ts b/src/client/graphics/layers/ReplayPanel.ts index 529a52ca1..622b233ff 100644 --- a/src/client/graphics/layers/ReplayPanel.ts +++ b/src/client/graphics/layers/ReplayPanel.ts @@ -18,12 +18,15 @@ export class ReplayPanel extends LitElement implements Layer { @state() private _replaySpeedMultiplier: number = defaultReplaySpeedMultiplier; + private _isSinglePlayer: boolean = false; @state() private _isVisible = false; init() { - if (this.game?.config().gameConfig().gameType === GameType.Singleplayer) { + this._isSinglePlayer = + this.game?.config().gameConfig().gameType === GameType.Singleplayer; + if (this._isSinglePlayer) { this.setVisible(true); } } @@ -65,7 +68,9 @@ export class ReplayPanel extends LitElement implements Layer { @contextmenu=${(e) => e.preventDefault()} >