Fix game browser tooltips being untranslated
This commit is contained in:
@@ -762,14 +762,19 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
if (game.Clients.Length > 0)
|
if (game.Clients.Length > 0)
|
||||||
{
|
{
|
||||||
var displayClients = game.Clients.Select(c => c.Name);
|
var preview = modData.MapCache[game.Map];
|
||||||
if (game.Clients.Length > 10)
|
var tooltip = new CachedTransform<MapStatus, string>(s =>
|
||||||
displayClients = displayClients
|
{
|
||||||
.Take(9)
|
var displayClients = game.Clients.Select(c => c.IsBot ? preview.GetMessage(c.Name) : c.Name);
|
||||||
.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
|
if (game.Clients.Length > 10)
|
||||||
|
displayClients = displayClients
|
||||||
|
.Take(9)
|
||||||
|
.Append(FluentProvider.GetMessage(OtherPlayers, "players", game.Clients.Length - 9));
|
||||||
|
|
||||||
var tooltip = displayClients.JoinWith("\n");
|
return displayClients.JoinWith("\n");
|
||||||
players.GetTooltipText = () => tooltip;
|
});
|
||||||
|
|
||||||
|
players.GetTooltipText = () => tooltip.Update(preview.Status);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
players.GetTooltipText = null;
|
players.GetTooltipText = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user