Add registered player tooltip to lobby chat names.

This commit is contained in:
Paul Chote
2026-01-27 17:18:43 +00:00
committed by Gustas Kažukauskas
parent efe7bce08a
commit ef5541cce4
2 changed files with 20 additions and 0 deletions

View File

@@ -659,8 +659,24 @@ namespace OpenRA.Mods.Common.Widgets.Logic
switch (notification.Pool)
{
case TextNotificationPool.Chat:
{
var profileTooltip = chatLine.GetOrNull<ClientTooltipRegionWidget>("PROFILE_TOOLTIP");
var prefix = chatLine.GetOrNull("PREFIX");
var c = orderManager.LobbyInfo.ClientWithIndex(notification.ClientId);
if (profileTooltip != null && prefix != null && c != null)
{
profileTooltip.Bounds = prefix.Bounds;
if (c.Fingerprint != null)
profileTooltip.Template = "REGISTERED_PLAYER_TOOLTIP";
profileTooltip.IsVisible = () => true;
profileTooltip.Bind(orderManager, worldRenderer, c);
}
Game.Sound.PlayNotification(modRules, null, "Sounds", chatLineSound, null);
break;
}
case TextNotificationPool.System:
Game.Sound.PlayNotification(modRules, null, "Sounds", lobbyOptionChangedSound, null);
break;

View File

@@ -11,6 +11,10 @@ Container@CHAT_LINE_TEMPLATE:
X: 5
Height: 16
Shadow: True
ClientTooltipRegion@PROFILE_TOOLTIP:
Visible: false
TooltipContainer: TOOLTIP_CONTAINER
Template: ANONYMOUS_PLAYER_TOOLTIP
Label@TEXT:
X: 5
Height: 16