Repository: OpenRA/OpenRA
Pull request #21830: Fix game browser tooltips being untranslated
Author: login: PunkPun
Labels: name: PR: Needs +2
name: PR: For stable
Created: 2025-03-30T09:27:46Z | Merged: 2025-03-30T17:16:53Z

followup on #21815 and #21828

Also make sure we retranslate bots on map status changes to account for the player not having the maps downloaded


Diff:
diff --git a/OpenRA.Game/Map/MapPreview.cs b/OpenRA.Game/Map/MapPreview.cs
index 18a76c88c33b..a22830ddbe89 100644
--- a/OpenRA.Game/Map/MapPreview.cs
+++ b/OpenRA.Game/Map/MapPreview.cs
@@ -253,11 +253,26 @@ public Map ToMap()
 		/// </summary>
 		public string GetMessage(string key, object[] args = null)
 		{
-			// PERF: instead of loading mod level strings per each MapPreview, reuse the already loaded one in FluentProvider.
-			if (FluentProvider.TryGetModMessage(key, out var message, args))
+			if (TryGetMessage(key, out var message, args))
 				return message;
 
-			return innerData.FluentBundle?.GetMessage(key, args) ?? key;
+			return key;
+		}
+
+		/// <summary>
+		/// Functionality mirrors <see cref="FluentProvider.TryGetMessage"/>, except instead of using
+		/// loaded <see cref="Map"/>'s fluent bundle as backup, we use this <see cref="MapPreview"/>'s.
+		/// </summary>
+		public bool TryGetMessage(string key, out string message, object[] args = null)
+		{
+			// PERF: instead of loading mod level strings per each MapPreview, reuse the already loaded one in FluentProvider.
+			if (FluentProvider.TryGetModMessage(key, out message, args))
+				return true;
+
+			if (innerData.FluentBundle == null)
+				return false;
+
+			return innerData.FluentBundle.TryGetMessage(key, out message, args);
 		}
 
 		Sprite minimap;
diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs
index 01aed4fe5ac0..ceeaaa9899e9 100644
--- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs
+++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs
@@ -751,7 +751,7 @@ void UpdatePlayerList()
 					}
 					else
 					{
-						LobbyUtils.SetupNameWidget(template, client, orderManager, worldRenderer);
+						LobbyUtils.SetupNameWidget(template, client, orderManager, worldRenderer, map);
 						LobbyUtils.SetupTeamWidget(template, client);
 						LobbyUtils.SetupHandicapWidget(template, client);
 						LobbyUtils.SetupSpawnWidget(template, client);
@@ -803,7 +803,7 @@ void UpdatePlayerList()
 						LobbyUtils.SetupPlayerActionWidget(template, client, orderManager, worldRenderer,
 							lobby, () => panel = PanelType.Kick, () => panel = PanelType.Players);
 					else
-						LobbyUtils.SetupNameWidget(template, client, orderManager, worldRenderer);
+						LobbyUtils.SetupNameWidget(template, client, orderManager, worldRenderer, map);
 
 					if (client.IsAdmin)
 						LobbyUtils.SetupReadyWidget(template, client);
diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs
index fa642e4aa032..9d894b17853a 100644
--- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs
+++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs
@@ -33,6 +33,9 @@ public static class LobbyUtils
 		[FluentReference]
 		const string Bots = "options-lobby-slot.bots";
 
+		[FluentReference]
+		const string BotPlayer = "label-bot-player";
+
 		[FluentReference]
 		const string BotsDisabled = "options-lobby-slot.bots-disabled";
 
@@ -425,14 +428,22 @@ public static void SetupEditableNameWidget(Widget parent, Session.Client c, Orde
 			HideChildWidget(parent, "SLOT_OPTIONS");
 		}
 
-		public static void SetupNameWidget(Widget parent, Session.Client c, OrderManager orderManager, WorldRenderer worldRenderer)
+		public static void SetupNameWidget(Widget parent, Session.Client c, OrderManager orderManager, WorldRenderer worldRenderer, MapPreview map)
 		{
 			var label = parent.Get<LabelWidget>("NAME");
 			label.IsVisible = () => true;
 			var font = Game.Renderer.Fonts[label.Font];
-			var name = c.IsBot ? FluentProvider.GetMessage(c.Name) : c.Name;
-			var text = WidgetUtils.TruncateText(name, label.Bounds.Width, font);
-			label.GetText = () => text;
+
+			var clientName = new CachedTransform<MapStatus, string>(s =>
+			{
+				var name = c.Name;
+				if (c.IsBot && !map.TryGetMessage(c.Name, out name))
+					name = FluentProvider.GetMessage(BotPlayer);
+
+				return WidgetUtils.TruncateText(name, label.Bounds.Width, font);
+			});
+
+			label.GetText = () => clientName.Update(map.Status);
 
 			SetupProfileWidget(parent, c, orderManager, worldRenderer);
 		}
@@ -450,9 +461,23 @@ public static void SetupEditableSlotWidget(Widget parent, Session.Slot s, Sessio
 
 			var closed = FluentProvider.GetMessage(Closed);
 			var open = FluentProvider.GetMessage(Open);
+
+			var clientName = new CachedTransform<MapStatus, string>(s =>
+			{
+				if (c.IsBot)
+				{
+					if (map.TryGetMessage(c.Name, out var message))
+						return message;
+					else
+						return FluentProvider.GetMessage(BotPlayer);
+				}
+
+				return c.Name;
+			});
+
 			slot.GetText = () => truncated.Update(c != null ?
-				c.IsBot ? map.GetMessage(c.Name) : c.Name
-					: s.Closed ? closed : open);
+				clientName.Update(map.Status)
+				: s.Closed ? closed : open);
 
 			slot.OnMouseDown = _ => ShowSlotDropDown(slot, s, c, orderManager, map, modData);
 
diff --git a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
index 6c12c2cce221..24e3ba6b5542 100644
--- a/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
+++ b/OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
@@ -14,6 +14,7 @@
 using System.Linq;
 using System.Threading.Tasks;
 using BeaconLib;
+using OpenRA.Graphics;
 using OpenRA.Network;
 using OpenRA.Primitives;
 using OpenRA.Server;
@@ -49,6 +50,9 @@ public class ServerListLogic : ChromeLogic
 		[FluentReference("bots")]
 		const string BotsLabel = "label-bots-count";
 
+		[FluentReference]
+		const string BotPlayer = "label-bot-player";
+
 		[FluentReference("spectators")]
 		const string SpectatorsLabel = "label-spectators-count";
 
@@ -604,15 +608,21 @@ void SelectServer(GameServer server)
 				foreach (var option in kv.Value)
 				{
 					var o = option;
-					var playerName = o.IsBot ? currentMap.GetMessage(o.Name) : o.Name;
+					var playerName = new CachedTransform<(MapStatus, int, SpriteFont), string>(s =>
+					{
+						var name = o.IsBot
+							? currentMap.TryGetMessage(o.Name, out var msg) ? msg : FluentProvider.GetMessage(BotPlayer)
+							: o.Name;
+
+						return WidgetUtils.TruncateText(name, s.Item2, s.Item3);
+					});
 
 					var item = ScrollItemWidget.Setup(clientTemplate, () => false, () => { });
 					if (!o.IsSpectator && server.Mod == modData.Manifest.Id)
 					{
 						var label = item.Get<LabelWidget>("LABEL");
 						var font = Game.Renderer.Fonts[label.Font];
-						var name = WidgetUtils.TruncateText(playerName, label.Bounds.Width, font);
-						label.GetText = () => name;
+						label.GetText = () => playerName.Update((currentMap.Status, label.Bounds.Width, font));
 						label.GetColor = () => o.Color;
 
 						var flag = item.Get<ImageWidget>("FLAG");
@@ -624,11 +634,10 @@ void SelectServer(GameServer server)
 					{
 						var label = item.Get<LabelWidget>("NOFLAG_LABEL");
 						var font = Game.Renderer.Fonts[label.Font];
-						var name = WidgetUtils.TruncateText(playerName, label.Bounds.Width, font);
 
 						// Force spectator color to prevent spoofing by the server
 						var color = o.IsSpectator ? Color.White : o.Color;
-						label.GetText = () => name;
+						label.GetText = () => playerName.Update((currentMap.Status, label.Bounds.Width, font));
 						label.GetColor = () => color;
 					}
 
@@ -762,14 +771,22 @@ static int ListOrder(GameServer g)
 
 							if (game.Clients.Length > 0)
 							{
-								var displayClients = game.Clients.Select(c => c.Name);
-								if (game.Clients.Length > 10)
-									displayClients = displayClients
-										.Take(9)
-										.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
-
-								var tooltip = displayClients.JoinWith("\n");
-								players.GetTooltipText = () => tooltip;
+								var preview = modData.MapCache[game.Map];
+								var tooltip = new CachedTransform<MapStatus, string>(s =>
+								{
+									var displayClients = game.Clients.Select(c => c.IsBot
+										? preview.TryGetMessage(c.Name, out var msg) ? msg : FluentProvider.GetMessage(BotPlayer)
+										: c.Name);
+
+									if (game.Clients.Length > 10)
+										displayClients = displayClients
+											.Take(9)
+											.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
+
+									return displayClients.JoinWith("\n");
+								});
+
+								players.GetTooltipText = () => tooltip.Update(preview.Status);
 							}
 							else
 								players.GetTooltipText = null;
diff --git a/mods/common/fluent/common.ftl b/mods/common/fluent/common.ftl
index 23e307006fac..d2d703b12b33 100644
--- a/mods/common/fluent/common.ftl
+++ b/mods/common/fluent/common.ftl
@@ -205,6 +205,9 @@ label-chat-availability =
        *[other] Chat available in { $seconds } seconds...
     }
 
+## LobbyLogic, ServerListLogic
+label-bot-player = AI Player
+
 ## IngameMenuLogic
 menu-ingame =
     .leave = Leave


Reviews:
user: login: pchote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T10:07:02Z
user: login: PunkPun
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T10:08:00Z
user: login: pchote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T10:08:08Z
user: login: PunkPun
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T10:13:02Z
user: login: pchote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T10:14:55Z
user: login: PunkPun
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T10:53:57Z
user: login: pchote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T11:26:38Z
user: login: pchote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T11:27:42Z
user: login: pchote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T11:29:25Z
user: login: PunkPun
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T11:29:36Z
user: login: PunkPun
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T11:35:43Z
user: login: pchote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T11:41:42Z
user: login: PunkPun
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T11:49:33Z
user: login: pchote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T12:07:36Z
user: login: PunkPun
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T12:10:57Z
user: login: pchote
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T12:14:17Z
user: login: PunkPun
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-30T12:21:59Z
user: login: pchote
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-30T12:31:46Z
user: login: penev92
body: I very much disagree with the basic idea of translating bot names, but this is a last minute bugfix and not the place for that discussion, so fine, I guess...
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-30T15:42:30Z

Review comments:
diff_hunk: @@ -762,14 +762,19 @@ static int ListOrder(GameServer g)
 
 							if (game.Clients.Length > 0)
 							{
-								var displayClients = game.Clients.Select(c => c.Name);
-								if (game.Clients.Length > 10)
-									displayClients = displayClients
-										.Take(9)
-										.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
-
-								var tooltip = displayClients.JoinWith("\n");
-								players.GetTooltipText = () => tooltip;
+								var preview = modData.MapCache[game.Map];
+								var tooltip = new CachedTransform<MapStatus, string>(s =>
+								{
+									var displayClients = game.Clients.Select(c => c.IsBot ? preview.GetMessage(c.Name) : c.Name);
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: pchote
body: We should be returning a placeholder "AI Player"(?) rather than the bot id if we can't yet translate it.
created_at: 2025-03-30T10:07:02Z
author_association: MEMBER
diff_hunk: @@ -762,14 +762,19 @@ static int ListOrder(GameServer g)
 
 							if (game.Clients.Length > 0)
 							{
-								var displayClients = game.Clients.Select(c => c.Name);
-								if (game.Clients.Length > 10)
-									displayClients = displayClients
-										.Take(9)
-										.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
-
-								var tooltip = displayClients.JoinWith("\n");
-								players.GetTooltipText = () => tooltip;
+								var preview = modData.MapCache[game.Map];
+								var tooltip = new CachedTransform<MapStatus, string>(s =>
+								{
+									var displayClients = game.Clients.Select(c => c.IsBot ? preview.GetMessage(c.Name) : c.Name);
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: PunkPun
body: that's a good idea
created_at: 2025-03-30T10:08:00Z
author_association: MEMBER
diff_hunk: @@ -762,14 +762,19 @@ static int ListOrder(GameServer g)
 
 							if (game.Clients.Length > 0)
 							{
-								var displayClients = game.Clients.Select(c => c.Name);
-								if (game.Clients.Length > 10)
-									displayClients = displayClients
-										.Take(9)
-										.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
-
-								var tooltip = displayClients.JoinWith("\n");
-								players.GetTooltipText = () => tooltip;
+								var preview = modData.MapCache[game.Map];
+								var tooltip = new CachedTransform<MapStatus, string>(s =>
+								{
+									var displayClients = game.Clients.Select(c => c.IsBot ? preview.GetMessage(c.Name) : c.Name);
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: pchote
body: I'd actually be fine with hardcoding "AI Player" for *all* bots outside of the lobby screen. All this logic could then simply go away.
created_at: 2025-03-30T10:08:08Z
author_association: MEMBER
diff_hunk: @@ -762,14 +762,19 @@ static int ListOrder(GameServer g)
 
 							if (game.Clients.Length > 0)
 							{
-								var displayClients = game.Clients.Select(c => c.Name);
-								if (game.Clients.Length > 10)
-									displayClients = displayClients
-										.Take(9)
-										.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
-
-								var tooltip = displayClients.JoinWith("\n");
-								players.GetTooltipText = () => tooltip;
+								var preview = modData.MapCache[game.Map];
+								var tooltip = new CachedTransform<MapStatus, string>(s =>
+								{
+									var displayClients = game.Clients.Select(c => c.IsBot ? preview.GetMessage(c.Name) : c.Name);
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: PunkPun
body: What about a case where a map simply doesn't use fluent? We need extra handling
created_at: 2025-03-30T10:13:01Z
author_association: MEMBER
diff_hunk: @@ -762,14 +762,19 @@ static int ListOrder(GameServer g)
 
 							if (game.Clients.Length > 0)
 							{
-								var displayClients = game.Clients.Select(c => c.Name);
-								if (game.Clients.Length > 10)
-									displayClients = displayClients
-										.Take(9)
-										.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
-
-								var tooltip = displayClients.JoinWith("\n");
-								players.GetTooltipText = () => tooltip;
+								var preview = modData.MapCache[game.Map];
+								var tooltip = new CachedTransform<MapStatus, string>(s =>
+								{
+									var displayClients = game.Clients.Select(c => c.IsBot ? preview.GetMessage(c.Name) : c.Name);
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: pchote
body: Show "AI Player" for them too.
created_at: 2025-03-30T10:14:55Z
author_association: MEMBER
diff_hunk: @@ -762,14 +762,19 @@ static int ListOrder(GameServer g)
 
 							if (game.Clients.Length > 0)
 							{
-								var displayClients = game.Clients.Select(c => c.Name);
-								if (game.Clients.Length > 10)
-									displayClients = displayClients
-										.Take(9)
-										.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
-
-								var tooltip = displayClients.JoinWith("\n");
-								players.GetTooltipText = () => tooltip;
+								var preview = modData.MapCache[game.Map];
+								var tooltip = new CachedTransform<MapStatus, string>(s =>
+								{
+									var displayClients = game.Clients.Select(c => c.IsBot ? preview.GetMessage(c.Name) : c.Name);
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: PunkPun
body: Now using Unnamed Bot
created_at: 2025-03-30T10:53:57Z
author_association: MEMBER
diff_hunk: @@ -33,6 +33,9 @@ public static class LobbyUtils
 		[FluentReference]
 		const string Bots = "options-lobby-slot.bots";
 
+		[FluentReference]
+		const string UnnamedBot = "label-bot-name";
path: OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs
user: login: pchote
body: IMO `UnnamedBot` isn't a good name for this. How about `GenericBotPlayer`?
created_at: 2025-03-30T11:26:38Z
author_association: MEMBER
diff_hunk: @@ -425,14 +428,27 @@ public static void SetupEditableNameWidget(Widget parent, Session.Client c, Orde
 			HideChildWidget(parent, "SLOT_OPTIONS");
 		}
 
-		public static void SetupNameWidget(Widget parent, Session.Client c, OrderManager orderManager, WorldRenderer worldRenderer)
+		public static void SetupNameWidget(Widget parent, Session.Client c, OrderManager orderManager, WorldRenderer worldRenderer, MapPreview map)
 		{
 			var label = parent.Get<LabelWidget>("NAME");
 			label.IsVisible = () => true;
 			var font = Game.Renderer.Fonts[label.Font];
-			var name = c.IsBot ? FluentProvider.GetMessage(c.Name) : c.Name;
-			var text = WidgetUtils.TruncateText(name, label.Bounds.Width, font);
-			label.GetText = () => text;
+
+			var clientName = new CachedTransform<MapStatus, string>(s =>
+			{
+				var name = c.Name;
+				if (c.IsBot)
+				{
+					if (map.TryGetMessage(c.Name, out var message))
path: OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs
user: login: pchote
body: ```
if (c.IsBot && !map.TryGetMessage(c.Name, out name))
    name = FluentProvider.GetMessage(UnnamedBot);
```
?
created_at: 2025-03-30T11:27:41Z
author_association: MEMBER
diff_hunk: @@ -49,6 +49,9 @@ public class ServerListLogic : ChromeLogic
 		[FluentReference("bots")]
 		const string BotsLabel = "label-bots-count";
 
+		[FluentReference]
+		const string BotName = "label-bot-name";
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: pchote
body: Likewise here.
created_at: 2025-03-30T11:29:25Z
author_association: MEMBER
diff_hunk: @@ -33,6 +33,9 @@ public static class LobbyUtils
 		[FluentReference]
 		const string Bots = "options-lobby-slot.bots";
 
+		[FluentReference]
+		const string UnnamedBot = "label-bot-name";
path: OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs
user: login: PunkPun
body: ofc, apparently I didn't push that change
created_at: 2025-03-30T11:29:36Z
author_association: MEMBER
diff_hunk: @@ -425,14 +428,27 @@ public static void SetupEditableNameWidget(Widget parent, Session.Client c, Orde
 			HideChildWidget(parent, "SLOT_OPTIONS");
 		}
 
-		public static void SetupNameWidget(Widget parent, Session.Client c, OrderManager orderManager, WorldRenderer worldRenderer)
+		public static void SetupNameWidget(Widget parent, Session.Client c, OrderManager orderManager, WorldRenderer worldRenderer, MapPreview map)
 		{
 			var label = parent.Get<LabelWidget>("NAME");
 			label.IsVisible = () => true;
 			var font = Game.Renderer.Fonts[label.Font];
-			var name = c.IsBot ? FluentProvider.GetMessage(c.Name) : c.Name;
-			var text = WidgetUtils.TruncateText(name, label.Bounds.Width, font);
-			label.GetText = () => text;
+
+			var clientName = new CachedTransform<MapStatus, string>(s =>
+			{
+				var name = c.Name;
+				if (c.IsBot)
+				{
+					if (map.TryGetMessage(c.Name, out var message))
path: OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs
user: login: PunkPun
body: it doesn't look as readable
created_at: 2025-03-30T11:35:42Z
author_association: MEMBER
diff_hunk: @@ -33,6 +33,9 @@ public static class LobbyUtils
 		[FluentReference]
 		const string Bots = "options-lobby-slot.bots";
 
+		[FluentReference]
+		const string BotName = "label-bot-name";
path: OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs
user: login: pchote
body: I still somewhat object to this variable name: this is the name of a player/client that is a bot, rather than the bot name itself.
created_at: 2025-03-30T11:41:42Z
author_association: MEMBER
diff_hunk: @@ -33,6 +33,9 @@ public static class LobbyUtils
 		[FluentReference]
 		const string Bots = "options-lobby-slot.bots";
 
+		[FluentReference]
+		const string BotName = "label-bot-name";
path: OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs
user: login: PunkPun
body: there's something wrong on my end, I didn't push all the changes again
created_at: 2025-03-30T11:49:33Z
author_association: MEMBER
diff_hunk: @@ -604,7 +607,9 @@ void SelectServer(GameServer server)
 				foreach (var option in kv.Value)
 				{
 					var o = option;
-					var playerName = o.IsBot ? currentMap.GetMessage(o.Name) : o.Name;
+					var playerName = o.IsBot
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: pchote
body: Should this not be dynamic too?
created_at: 2025-03-30T12:07:35Z
author_association: MEMBER
diff_hunk: @@ -604,7 +607,9 @@ void SelectServer(GameServer server)
 				foreach (var option in kv.Value)
 				{
 					var o = option;
-					var playerName = o.IsBot ? currentMap.GetMessage(o.Name) : o.Name;
+					var playerName = o.IsBot
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: PunkPun
body: it is dynamic, I only added cached transforms where it wasn't
created_at: 2025-03-30T12:10:56Z
author_association: MEMBER
diff_hunk: @@ -604,7 +607,9 @@ void SelectServer(GameServer server)
 				foreach (var option in kv.Value)
 				{
 					var o = option;
-					var playerName = o.IsBot ? currentMap.GetMessage(o.Name) : o.Name;
+					var playerName = o.IsBot
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: pchote
body: If you select a map, and then it updates afterwards, it won't be updating the names in the player list(?)

label.GetText below will keep the value that we determine here, before the map updates.
created_at: 2025-03-30T12:14:17Z
author_association: MEMBER
diff_hunk: @@ -604,7 +607,9 @@ void SelectServer(GameServer server)
 				foreach (var option in kv.Value)
 				{
 					var o = option;
-					var playerName = o.IsBot ? currentMap.GetMessage(o.Name) : o.Name;
+					var playerName = o.IsBot
path: OpenRA.Mods.Common/Widgets/Logic/ServerListLogic.cs
user: login: PunkPun
body: it's an unlikely scenario, but handled it anyhow
created_at: 2025-03-30T12:21:59Z
author_association: MEMBER

PR comments:
user: login: PunkPun
created_at: 2025-03-30T09:34:08Z
body: hmm, the tooltip needs to be made more dynamic as on loading up the game browser the maps are still not downloaded
author_association: MEMBER
user: login: pchote
created_at: 2025-03-30T17:19:33Z
body: 2890ccf2b1ae4b6b1e7de98944cbf086f2203004
27297a1ba954c01eb0a478faaa559548765e6c66
d70c30763b06d6f191e59ff560fbdc90a32ca892

https://github.com/OpenRA/OpenRA/wiki/Changelog/_compare/a682cff8c73a51c91e240b1a84d38a8914dea6bc
author_association: MEMBER