diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index ab1cc01442..9ff2e0c59e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -296,15 +296,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic return "Poor"; } - public static string DescriptiveIpAddress(string ip) - { - if (ip == null) - return "Unknown Host"; - if (ip == IPAddress.Loopback.ToString()) - return "Local Host"; - return ip; - } - public static void SetupLatencyWidget(Widget parent, Session.Client c, OrderManager orderManager, bool visible) { var block = parent.GetOrNull("LATENCY"); @@ -323,6 +314,29 @@ namespace OpenRA.Mods.Common.Widgets.Logic tooltip.Bind(orderManager, null, c); } + public static void SetupProfileWidget(Widget parent, Session.Client c, OrderManager orderManager, WorldRenderer worldRenderer) + { + var profile = parent.GetOrNull("PROFILE"); + if (profile != null && c.Bot == null) + { + var imageName = (c != null && c.IsAdmin ? "admin-" : "player-") + + (c.Fingerprint != null ? "registered" : "anonymous"); + + profile.GetImageName = () => imageName; + profile.IsVisible = () => true; + } + + var profileTooltip = parent.GetOrNull("PROFILE_TOOLTIP"); + if (profileTooltip != null && c.Bot == null) + { + if (c != null && c.Fingerprint != null) + profileTooltip.Template = "REGISTERED_PLAYER_TOOLTIP"; + + profileTooltip.Bind(orderManager, worldRenderer, c); + profileTooltip.IsVisible = () => true; + } + } + public static void SetupEditableNameWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, WorldRenderer worldRenderer) { var name = parent.Get("NAME"); @@ -360,6 +374,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic return true; }; + SetupProfileWidget(name, c, orderManager, worldRenderer); + HideChildWidget(parent, "SLOT_OPTIONS"); } @@ -370,6 +386,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic var font = Game.Renderer.Fonts[name.Font]; var label = WidgetUtils.TruncateText(c.Name, name.Bounds.Width, font); name.GetText = () => label; + + SetupProfileWidget(parent, c, orderManager, worldRenderer); } public static void SetupEditableSlotWidget(Widget parent, Session.Slot s, Session.Client c, @@ -404,6 +422,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic slot.GetText = () => c != null ? c.Name : string.Empty; slot.OnMouseDown = _ => ShowPlayerActionDropDown(slot, s, c, orderManager, lobby, before, after); + SetupProfileWidget(slot, c, orderManager, worldRenderer); + // Ensure Name selector (if present) is hidden HideChildWidget(parent, "NAME"); } @@ -573,12 +593,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic playerName.GetColor = () => player.Color.RGB; } - public static string GetExternalIP(int clientIndex, OrderManager orderManager) + public static string GetExternalIP(Session.Client client, OrderManager orderManager) { - var client = orderManager.LobbyInfo.ClientWithIndex(clientIndex); var address = client != null ? client.IpAddress : ""; var lc = orderManager.LocalClient; - if (lc != null && lc.Index == clientIndex && address == IPAddress.Loopback.ToString()) + if (lc != null && lc.Index == client.Index && address == IPAddress.Loopback.ToString()) { var externalIP = UPnP.ExternalIP; if (externalIP != null) diff --git a/OpenRA.Mods.Common/Widgets/Logic/PlayerProfileLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/PlayerProfileLogic.cs index 3ec8ace4d2..753236d51c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/PlayerProfileLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/PlayerProfileLogic.cs @@ -10,7 +10,11 @@ #endregion using System; +using System.Linq; +using System.Net; +using System.Text; using OpenRA.Graphics; +using OpenRA.Network; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets.Logic @@ -18,7 +22,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class LocalProfileLogic : ChromeLogic { readonly LocalPlayerProfile localProfile; - readonly Widget detailsContainer; bool notFound; [ObjectCreator.UseCtor] @@ -75,8 +78,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic destroyKey.OnClick = localProfile.DeleteKeypair; destroyKey.IsDisabled = minimalProfile; - detailsContainer = widget.Get("PROFILE_DETAILS"); - detailsContainer.IsVisible = () => localProfile.State == LocalPlayerProfile.LinkState.Linked && !minimalProfile(); localProfile.RefreshPlayerData(() => RefreshComplete(false)); } @@ -88,4 +89,129 @@ namespace OpenRA.Mods.Common.Widgets.Logic Game.RunAfterTick(Ui.ResetTooltips); } } + + public class RegisteredProfileTooltipLogic : ChromeLogic + { + readonly PlayerDatabase playerDatabase; + PlayerProfile profile; + bool profileLoaded; + + [ObjectCreator.UseCtor] + public RegisteredProfileTooltipLogic(Widget widget, WorldRenderer worldRenderer, ModData modData, Session.Client client) + { + playerDatabase = modData.Manifest.Get(); + + var header = widget.Get("HEADER"); + + var profileHeader = header.Get("PROFILE_HEADER"); + var messageHeader = header.Get("MESSAGE_HEADER"); + var message = messageHeader.Get("MESSAGE"); + var messageFont = Game.Renderer.Fonts[message.Font]; + + profileHeader.IsVisible = () => profileLoaded; + messageHeader.IsVisible = () => !profileLoaded; + + var profileWidth = 0; + var messageText = "Loading player profile..."; + var messageWidth = messageFont.Measure(messageText).X + 2 * message.Bounds.Left; + + Action onQueryComplete = i => + { + try + { + if (i.Error == null) + { + var yaml = MiniYaml.FromString(Encoding.UTF8.GetString(i.Result)).First(); + if (yaml.Key == "Player") + { + profile = FieldLoader.Load(yaml.Value); + Game.RunAfterTick(() => + { + var nameLabel = profileHeader.Get("PROFILE_NAME"); + var nameFont = Game.Renderer.Fonts[nameLabel.Font]; + var rankLabel = profileHeader.Get("PROFILE_RANK"); + var rankFont = Game.Renderer.Fonts[rankLabel.Font]; + + var adminContainer = profileHeader.Get("GAME_ADMIN"); + var adminLabel = adminContainer.Get("LABEL"); + var adminFont = Game.Renderer.Fonts[adminLabel.Font]; + + var headerSizeOffset = profileHeader.Bounds.Height - messageHeader.Bounds.Height; + + nameLabel.GetText = () => profile.ProfileName; + rankLabel.GetText = () => profile.ProfileRank; + + profileWidth = Math.Max(profileWidth, nameFont.Measure(profile.ProfileName).X + 2 * nameLabel.Bounds.Left); + profileWidth = Math.Max(profileWidth, rankFont.Measure(profile.ProfileRank).X + 2 * rankLabel.Bounds.Left); + + header.Bounds.Height += headerSizeOffset; + if (client.IsAdmin) + { + profileWidth = Math.Max(profileWidth, adminFont.Measure(adminLabel.Text).X + 2 * adminLabel.Bounds.Left); + + adminContainer.IsVisible = () => true; + profileHeader.Bounds.Height += adminLabel.Bounds.Height; + header.Bounds.Height += adminLabel.Bounds.Height; + } + + profileWidth = Math.Min(profileWidth, widget.Bounds.Width); + header.Bounds.Width = widget.Bounds.Width = profileWidth; + widget.Bounds.Height = header.Bounds.Height; + + profileLoaded = true; + }); + } + } + } + catch (Exception e) + { + Log.Write("debug", "Failed to parse player data result with exception: {0}", e); + } + finally + { + if (profile == null) + { + messageText = "Failed to load player profile."; + messageWidth = messageFont.Measure(messageText).X + 2 * message.Bounds.Left; + header.Bounds.Width = widget.Bounds.Width = messageWidth; + } + } + }; + + message.GetText = () => messageText; + header.Bounds.Height += messageHeader.Bounds.Height; + header.Bounds.Width = widget.Bounds.Width = messageWidth; + widget.Bounds.Height = header.Bounds.Height; + + new Download(playerDatabase.Profile + client.Fingerprint, _ => { }, onQueryComplete); + } + } + + public class AnonymousProfileTooltipLogic : ChromeLogic + { + [ObjectCreator.UseCtor] + public AnonymousProfileTooltipLogic(Widget widget, OrderManager orderManager, Session.Client client) + { + var address = LobbyUtils.GetExternalIP(client, orderManager); + var cachedDescriptiveIP = address ?? "Unknown IP"; + + var nameLabel = widget.Get("NAME"); + var nameFont = Game.Renderer.Fonts[nameLabel.Font]; + widget.Bounds.Width = nameFont.Measure(nameLabel.Text).X + 2 * nameLabel.Bounds.Left; + + var ipLabel = widget.Get("IP"); + ipLabel.GetText = () => cachedDescriptiveIP; + + var locationLabel = widget.Get("LOCATION"); + var cachedCountryLookup = GeoIP.LookupCountry(address); + locationLabel.GetText = () => cachedCountryLookup; + + if (client.IsAdmin) + { + var adminLabel = widget.Get("GAME_ADMIN"); + adminLabel.IsVisible = () => client.IsAdmin; + widget.Bounds.Height += adminLabel.Bounds.Height; + } + } + } } diff --git a/mods/cnc/chrome.yaml b/mods/cnc/chrome.yaml index e5969e266c..37a463d4fe 100644 --- a/mods/cnc/chrome.yaml +++ b/mods/cnc/chrome.yaml @@ -451,6 +451,10 @@ lobby-bits: chrome.png kick: 386,115,11,11 protected: 403,97,10,13 protected-disabled: 403,113,10,13 + admin-registered: 448,112,16,16 + admin-anonymous: 464,112,16,16 + player-registered: 480,112,16,16 + player-anonymous: 496,112,16,16 reload-icon: chrome.png enabled: 256,192,16,16 diff --git a/mods/cnc/chrome/lobby-players.yaml b/mods/cnc/chrome/lobby-players.yaml index 08a8b37ed4..5c54e1c9d0 100644 --- a/mods/cnc/chrome/lobby-players.yaml +++ b/mods/cnc/chrome/lobby-players.yaml @@ -83,8 +83,22 @@ Container@LOBBY_PLAYER_BIN: Width: 190 Height: 25 Text: Name + LeftMargin: 24 MaxLength: 16 Visible: false + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP DropDownButton@SLOT_OPTIONS: X: 15 Width: 190 @@ -170,10 +184,22 @@ Container@LOBBY_PLAYER_BIN: Height: 25 TooltipContainer: TOOLTIP_CONTAINER Template: LATENCY_TOOLTIP + Image@PROFILE: + ImageCollection: lobby-bits + X: 18 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 18 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@NAME: - X: 20 + X: 39 Y: 0 - 1 - Width: 180 + Width: 161 Height: 25 DropDownButton@PLAYER_ACTION: X: 15 @@ -182,6 +208,20 @@ Container@LOBBY_PLAYER_BIN: Font: Regular Visible: false Align: Left + LeftMargin: 24 + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP ColorBlock@COLORBLOCK: X: 215 Y: 6 @@ -285,7 +325,21 @@ Container@LOBBY_PLAYER_BIN: Width: 190 Height: 25 Text: Name + LeftMargin: 24 MaxLength: 16 + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@SPECTATOR: X: 210 Width: 341 @@ -330,10 +384,22 @@ Container@LOBBY_PLAYER_BIN: Height: 25 TooltipContainer: TOOLTIP_CONTAINER Template: LATENCY_TOOLTIP + Image@PROFILE: + ImageCollection: lobby-bits + X: 18 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 18 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@NAME: - X: 20 + X: 39 Y: 0 - 1 - Width: 180 + Width: 161 Height: 25 DropDownButton@PLAYER_ACTION: X: 15 @@ -342,6 +408,20 @@ Container@LOBBY_PLAYER_BIN: Font: Regular Visible: false Align: Left + LeftMargin: 24 + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@SPECTATOR: X: 210 Width: 341 diff --git a/mods/cnc/chrome/tooltips.yaml b/mods/cnc/chrome/tooltips.yaml index 3ce95543c8..13c8db871e 100644 --- a/mods/cnc/chrome/tooltips.yaml +++ b/mods/cnc/chrome/tooltips.yaml @@ -202,3 +202,94 @@ Background@LATENCY_TOOLTIP: Label@LATENCY: Height: 23 Font: Bold + +Background@ANONYMOUS_PLAYER_TOOLTIP: + Logic: AnonymousProfileTooltipLogic + Background: panel-black + Height: 55 + Width: 200 + Children: + Label@NAME: + X: 5 + Text: Anonymous Player + Height: 23 + Font: MediumBold + Label@LOCATION: + X: 5 + Y: 23 + Height: 12 + Font: TinyBold + Label@IP: + X: 5 + Y: 36 + Height: 12 + Font: TinyBold + Container@GAME_ADMIN: + X: 5 + Y: 49 + Height: 12 + Visible: False + Children: + Image@ICON: + Y: 5 + Width: 7 + Height: 5 + ImageCollection: lobby-bits + ImageName: admin + Label@LABEL: + X: 10 + Height: 12 + Text: Game Admin + Font: TinyBold + +Container@REGISTERED_PLAYER_TOOLTIP: + Logic: RegisteredProfileTooltipLogic + Width: 270 + Height: 137 + Children: + Background@HEADER: + Width: PARENT_RIGHT + Background: panel-black + Children: + Container@PROFILE_HEADER: + Width: PARENT_RIGHT + Height: 42 + Children: + Label@PROFILE_NAME: + X: 5 + Width: PARENT_RIGHT - 20 + Height: 23 + Font: MediumBold + Label@PROFILE_RANK: + X: 5 + Y: 23 + Width: PARENT_RIGHT - 20 + Height: 12 + Font: TinyBold + Container@GAME_ADMIN: + X: 5 + Y: 36 + Width: PARENT_RIGHT - 20 + Height: 12 + Visible: False + Children: + Image@ICON: + Y: 5 + Width: 7 + Height: 5 + ImageCollection: lobby-bits + ImageName: admin + Label@LABEL: + X: 10 + Height: 12 + Text: Game Admin + Font: TinyBold + Container@MESSAGE_HEADER: + Height: 26 + Width: PARENT_RIGHT + Children: + Label@MESSAGE: + X: 5 + Width: PARENT_RIGHT - 20 + Height: 23 + Font: Bold diff --git a/mods/cnc/uibits/chrome.png b/mods/cnc/uibits/chrome.png index cb42f96482..64b6dc8603 100644 Binary files a/mods/cnc/uibits/chrome.png and b/mods/cnc/uibits/chrome.png differ diff --git a/mods/common/chrome/lobby-players.yaml b/mods/common/chrome/lobby-players.yaml index 492ca826b3..d5a976f994 100644 --- a/mods/common/chrome/lobby-players.yaml +++ b/mods/common/chrome/lobby-players.yaml @@ -82,7 +82,22 @@ Container@LOBBY_PLAYER_BIN: Width: 165 Height: 25 Text: Name + LeftMargin: 24 MaxLength: 16 + Visible: false + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP DropDownButton@SLOT_OPTIONS: X: 15 Width: 165 @@ -165,10 +180,22 @@ Container@LOBBY_PLAYER_BIN: Height: 25 TooltipContainer: TOOLTIP_CONTAINER Template: LATENCY_TOOLTIP + Image@PROFILE: + ImageCollection: lobby-bits + X: 18 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 18 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@NAME: - X: 20 + X: 39 Y: 0 - 1 - Width: 165 + Width: 146 Height: 25 Text: Name DropDownButton@PLAYER_ACTION: @@ -178,6 +205,20 @@ Container@LOBBY_PLAYER_BIN: Font: Regular Visible: false Align: Left + LeftMargin: 24 + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP ColorBlock@COLORBLOCK: X: 195 Y: 6 @@ -277,7 +318,21 @@ Container@LOBBY_PLAYER_BIN: Width: 165 Height: 25 Text: Name + LeftMargin: 24 MaxLength: 16 + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@SPECTATOR: X: 190 Width: 326 @@ -321,11 +376,23 @@ Container@LOBBY_PLAYER_BIN: Height: 25 TooltipContainer: TOOLTIP_CONTAINER Template: LATENCY_TOOLTIP + Image@PROFILE: + ImageCollection: lobby-bits + X: 18 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 18 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@NAME: - Width: 160 - Height: 25 - X: 20 + X: 39 Y: 0 - 1 + Width: 179 + Height: 25 Text: Name DropDownButton@PLAYER_ACTION: X: 15 diff --git a/mods/common/chrome/tooltips.yaml b/mods/common/chrome/tooltips.yaml index 799426707d..108efd5d30 100644 --- a/mods/common/chrome/tooltips.yaml +++ b/mods/common/chrome/tooltips.yaml @@ -130,6 +130,95 @@ Background@LATENCY_TOOLTIP: Height: 23 Font: Bold +Background@ANONYMOUS_PLAYER_TOOLTIP: + Logic: AnonymousProfileTooltipLogic + Background: dialog4 + Height: 56 + Width: 200 + Children: + Label@NAME: + X: 7 + Text: Anonymous Player + Height: 24 + Font: MediumBold + Label@LOCATION: + X: 7 + Y: 23 + Height: 12 + Font: TinyBold + Label@IP: + X: 7 + Y: 36 + Height: 12 + Font: TinyBold + Container@GAME_ADMIN: + X: 7 + Y: 49 + Height: 12 + Visible: False + Children: + Image@ICON: + Y: 5 + Width: 7 + Height: 5 + ImageCollection: lobby-bits + ImageName: admin + Label@LABEL: + X: 9 + Height: 12 + Text: Game Admin + Font: TinyBold + +Background@REGISTERED_PLAYER_TOOLTIP: + Logic: RegisteredProfileTooltipLogic + Width: 270 + Background: dialog4 + Children: + Container@HEADER: + Width: PARENT_RIGHT + Children: + Container@PROFILE_HEADER: + Height: 43 + Children: + Label@PROFILE_NAME: + X: 7 + Width: PARENT_RIGHT - 20 + Height: 24 + Font: MediumBold + Label@PROFILE_RANK: + X: 7 + Y: 23 + Width: PARENT_RIGHT - 20 + Height: 12 + Font: TinyBold + Container@GAME_ADMIN: + X: 7 + Y: 36 + Width: PARENT_RIGHT - 20 + Height: 12 + Visible: False + Children: + Image@ICON: + Y: 5 + Width: 7 + Height: 5 + ImageCollection: lobby-bits + ImageName: admin + Label@LABEL: + X: 10 + Height: 12 + Text: Game Admin + Font: TinyBold + Container@MESSAGE_HEADER: + Height: 26 + Width: PARENT_RIGHT + Children: + Label@MESSAGE: + X: 7 + Width: PARENT_RIGHT - 14 + Height: 23 + Font: Bold + Background@PRODUCTION_TOOLTIP: Logic: ProductionTooltipLogic Background: dialog4 diff --git a/mods/d2k/chrome.yaml b/mods/d2k/chrome.yaml index ba41440813..6e0bbfb22d 100644 --- a/mods/d2k/chrome.yaml +++ b/mods/d2k/chrome.yaml @@ -212,6 +212,10 @@ lobby-bits: buttons.png huepicker: 193,0,7,15 protected: 200,0,12,13 protected-disabled: 211,0,12,13 + admin-registered: 224,0,16,16 + admin-anonymous: 240,0,16,16 + player-registered: 224,16,16,16 + player-anonymous: 240,16,16,16 reload-icon: chrome.png enabled: 416,312,16,16 diff --git a/mods/d2k/chrome/lobby-players.yaml b/mods/d2k/chrome/lobby-players.yaml index 3477ce4623..b672a126a5 100644 --- a/mods/d2k/chrome/lobby-players.yaml +++ b/mods/d2k/chrome/lobby-players.yaml @@ -82,7 +82,22 @@ Container@LOBBY_PLAYER_BIN: Width: 165 Height: 25 Text: Name + LeftMargin: 24 MaxLength: 16 + Visible: false + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP DropDownButton@SLOT_OPTIONS: X: 15 Width: 165 @@ -165,19 +180,45 @@ Container@LOBBY_PLAYER_BIN: Height: 25 TooltipContainer: TOOLTIP_CONTAINER Template: LATENCY_TOOLTIP + Image@PROFILE: + ImageCollection: lobby-bits + X: 18 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 18 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@NAME: - X: 20 + X: 39 Y: 0 - 1 - Width: 165 + Width: 146 Height: 25 Text: Name DropDownButton@PLAYER_ACTION: X: 15 Width: 165 - Height: 23 + Height: 25 Font: Regular Visible: false Align: Left + LeftMargin: 24 + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP ColorBlock@COLORBLOCK: X: 195 Y: 6 @@ -277,7 +318,21 @@ Container@LOBBY_PLAYER_BIN: Width: 165 Height: 25 Text: Name + LeftMargin: 24 MaxLength: 16 + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@SPECTATOR: X: 190 Width: 326 @@ -321,8 +376,20 @@ Container@LOBBY_PLAYER_BIN: Height: 25 TooltipContainer: TOOLTIP_CONTAINER Template: LATENCY_TOOLTIP + Image@PROFILE: + ImageCollection: lobby-bits + X: 18 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 18 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@NAME: - X: 20 + X: 39 Y: 0 - 1 Width: 160 Height: 25 @@ -330,10 +397,24 @@ Container@LOBBY_PLAYER_BIN: DropDownButton@PLAYER_ACTION: X: 15 Width: 165 - Height: 23 + Height: 25 Font: Regular Visible: false Align: Left + LeftMargin: 24 + Children: + Image@PROFILE: + ImageCollection: lobby-bits + X: 3 + Y: 3 + Visible: false + ClientTooltipRegion@PROFILE_TOOLTIP: + X: 3 + Y: 3 + Width: 16 + Height: 16 + TooltipContainer: TOOLTIP_CONTAINER + Template: ANONYMOUS_PLAYER_TOOLTIP Label@SPECTATOR: X: 190 Width: 326 diff --git a/mods/d2k/chrome/tooltips.yaml b/mods/d2k/chrome/tooltips.yaml index e17ad321bd..2478dbe58f 100644 --- a/mods/d2k/chrome/tooltips.yaml +++ b/mods/d2k/chrome/tooltips.yaml @@ -130,6 +130,98 @@ Background@LATENCY_TOOLTIP: Height: 23 Font: Bold +Background@ANONYMOUS_PLAYER_TOOLTIP: + Logic: AnonymousProfileTooltipLogic + Background: dialog3 + Height: 57 + Width: 200 + Children: + Label@NAME: + X: 7 + Y: 1 + Text: Anonymous Player + Height: 24 + Font: MediumBold + Label@LOCATION: + X: 7 + Y: 24 + Height: 12 + Font: TinyBold + Label@IP: + X: 7 + Y: 37 + Height: 12 + Font: TinyBold + Container@GAME_ADMIN: + X: 7 + Y: 50 + Height: 12 + Visible: False + Children: + Image@ICON: + Y: 5 + Width: 7 + Height: 5 + ImageCollection: lobby-bits + ImageName: admin + Label@LABEL: + X: 10 + Height: 12 + Text: Game Admin + Font: TinyBold + +Background@REGISTERED_PLAYER_TOOLTIP: + Logic: RegisteredProfileTooltipLogic + Background: dialog3 + Width: 270 + Children: + Container@HEADER: + Width: PARENT_RIGHT + Children: + Container@PROFILE_HEADER: + Height: 45 + Children: + Label@PROFILE_NAME: + X: 7 + Y: 1 + Width: PARENT_RIGHT - 20 + Height: 24 + Font: MediumBold + Label@PROFILE_RANK: + X: 7 + Y: 24 + Width: PARENT_RIGHT - 20 + Height: 12 + Font: TinyBold + Container@GAME_ADMIN: + X: 7 + Y: 37 + Width: PARENT_RIGHT - 20 + Height: 12 + Visible: False + Children: + Image@ICON: + Y: 5 + Width: 7 + Height: 5 + ImageCollection: lobby-bits + ImageName: admin + Label@LABEL: + X: 10 + Height: 12 + Text: Game Admin + Font: TinyBold + Container@MESSAGE_HEADER: + Height: 31 + Width: PARENT_RIGHT + Children: + Label@MESSAGE: + X: 7 + Y: 3 + Width: PARENT_RIGHT - 14 + Height: 23 + Font: Bold + Background@PRODUCTION_TOOLTIP: Logic: ProductionTooltipLogic Background: dialog3 diff --git a/mods/d2k/uibits/buttons.png b/mods/d2k/uibits/buttons.png index 308ba9633b..3cf1862b9b 100644 Binary files a/mods/d2k/uibits/buttons.png and b/mods/d2k/uibits/buttons.png differ diff --git a/mods/ra/chrome.yaml b/mods/ra/chrome.yaml index 988579f583..5f2355da25 100644 --- a/mods/ra/chrome.yaml +++ b/mods/ra/chrome.yaml @@ -530,6 +530,10 @@ lobby-bits: buttons.png huepicker: 194,0,7,15 protected: 202,0,10,13 protected-disabled: 213,0,10,13 + admin-registered: 224,0,16,16 + admin-anonymous: 240,0,16,16 + player-registered: 224,16,16,16 + player-anonymous: 240,16,16,16 reload-icon: chrome.png enabled: 512,80,16,16 diff --git a/mods/ra/uibits/buttons.png b/mods/ra/uibits/buttons.png index a73f2a291c..edcc6e3c71 100644 Binary files a/mods/ra/uibits/buttons.png and b/mods/ra/uibits/buttons.png differ diff --git a/mods/ts/chrome.yaml b/mods/ts/chrome.yaml index 0d3780e27a..00459051e0 100644 --- a/mods/ts/chrome.yaml +++ b/mods/ts/chrome.yaml @@ -377,6 +377,10 @@ lobby-bits: buttons.png huepicker: 194,0,7,15 protected: 202,0,10,13 protected-disabled: 213,0,10,13 + admin-registered: 224,0,16,16 + admin-anonymous: 240,0,16,16 + player-registered: 224,16,16,16 + player-anonymous: 240,16,16,16 reload-icon: dialog.png enabled: 160,480,16,16 diff --git a/mods/ts/uibits/buttons.png b/mods/ts/uibits/buttons.png index 0773410ddb..b233ad4785 100644 Binary files a/mods/ts/uibits/buttons.png and b/mods/ts/uibits/buttons.png differ