From fb9b02a9bac0ac8cad2e473b76d3eda559ee5d66 Mon Sep 17 00:00:00 2001 From: phosit Date: Sun, 29 Dec 2024 11:04:22 +0100 Subject: [PATCH] Never change the names in the "Player Name" column The intent of this branch was to not change the names when a saved game is loaded. So that one can see who was where in the saved game. It was implemented wrong: The names didn't change when no savegame was loaded and changed when a saved game was loaded. This commit make the soved game case and no saved game case consistent. Defect introduced in b90280855f. --- .../GameSetupPage/GameSettings/PerPlayer/PlayerName.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/PerPlayer/PlayerName.js b/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/PerPlayer/PlayerName.js index ac7be77fb5..48bc580327 100644 --- a/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/PerPlayer/PlayerName.js +++ b/binaries/data/mods/public/gui/gamesetup/Pages/GameSetupPage/GameSettings/PerPlayer/PlayerName.js @@ -8,6 +8,7 @@ PlayerSettingControls.PlayerName = class PlayerName extends GameSettingControl this.playerName = Engine.GetGUIObjectByName("playerName[" + this.playerIndex + "]"); g_GameSettings.playerCount.watch(() => this.render(), ["nbPlayers"]); + g_GameSettings.playerName.watch(this.render.bind(this), ["values"]); this.guid = undefined; this.render(); @@ -29,15 +30,14 @@ PlayerSettingControls.PlayerName = class PlayerName extends GameSettingControl render() { - let name = this.guid && this.isSavedGame ? - g_PlayerAssignments[this.guid].name : g_GameSettings.playerName.values[this.playerIndex]; + let name = g_GameSettings.playerName.values[this.playerIndex]; if (g_IsNetworked) { let status = this.guid ? g_PlayerAssignments[this.guid].status : this.ReadyTags.length - 1; name = setStringTags(name, this.ReadyTags[status]); } - else if (name && !this.guid) + else if (name) { name = translate(name); }