diff --git a/OpenRA.Game/Network/Session.cs b/OpenRA.Game/Network/Session.cs
index 98301611b3..7896ced537 100644
--- a/OpenRA.Game/Network/Session.cs
+++ b/OpenRA.Game/Network/Session.cs
@@ -53,6 +53,7 @@ namespace OpenRA.Network
public string Country;
public int SpawnPoint;
public string Name;
+ public string IpAddress;
public ClientState State;
public int Team;
public string Slot; // slot ID, or null for observer
@@ -61,9 +62,9 @@ namespace OpenRA.Network
public bool IsAdmin;
public bool IsReady { get { return State == ClientState.Ready; } }
public bool IsObserver { get { return Slot == null; } }
- public int Ping = -1;
- public int PingJitter = -1;
- public int[] PingHistory = {};
+ public int Latency = -1;
+ public int LatencyJitter = -1;
+ public int[] LatencyHistory = {};
}
public class Slot
diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj
index 6cf977a09a..a6f99c8a59 100644
--- a/OpenRA.Game/OpenRA.Game.csproj
+++ b/OpenRA.Game/OpenRA.Game.csproj
@@ -223,6 +223,7 @@
+
diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs
index b962608669..70176592d6 100644
--- a/OpenRA.Game/Server/Server.cs
+++ b/OpenRA.Game/Server/Server.cs
@@ -263,11 +263,13 @@ namespace OpenRA.Server
return;
}
+ client.IpAddress = ((IPEndPoint)newConn.socket.RemoteEndPoint).Address.ToString();
+
// Check if IP is banned
if (lobbyInfo.GlobalSettings.Ban != null)
{
- var remote_addr = ((IPEndPoint)newConn.socket.RemoteEndPoint).Address.ToString();
- if (lobbyInfo.GlobalSettings.Ban.Contains(remote_addr))
+
+ if (lobbyInfo.GlobalSettings.Ban.Contains(client.IpAddress))
{
Console.WriteLine("Rejected connection from "+client.Name+"("+newConn.socket.RemoteEndPoint+"); Banned.");
Log.Write("server", "Rejected connection from {0}; Banned.",
@@ -469,16 +471,16 @@ namespace OpenRA.Server
break;
}
- var history = fromClient.PingHistory.ToList();
+ var history = fromClient.LatencyHistory.ToList();
history.Add(Environment.TickCount - pingSent);
// Cap ping history at 5 values (25 seconds)
if (history.Count > 5)
history.RemoveRange(0, history.Count - 5);
- fromClient.Ping = history.Sum() / history.Count;
- fromClient.PingJitter = (history.Max() - history.Min())/2;
- fromClient.PingHistory = history.ToArray();
+ fromClient.Latency = history.Sum() / history.Count;
+ fromClient.LatencyJitter = (history.Max() - history.Min())/2;
+ fromClient.LatencyHistory = history.ToArray();
if (State == ServerState.WaitingPlayers)
SyncLobbyInfo();
diff --git a/OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs b/OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs
new file mode 100644
index 0000000000..d487ea51ae
--- /dev/null
+++ b/OpenRA.Game/Widgets/ClientTooltipRegionWidget.cs
@@ -0,0 +1,67 @@
+#region Copyright & License Information
+/*
+ * Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
+ * This file is part of OpenRA, which is free software. It is made
+ * available to you under the terms of the GNU General Public License
+ * as published by the Free Software Foundation. For more information,
+ * see COPYING.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Threading;
+using OpenRA.FileFormats;
+using OpenRA.Graphics;
+using OpenRA.Network;
+
+namespace OpenRA.Widgets
+{
+ public class ClientTooltipRegionWidget : Widget
+ {
+ public readonly string Template;
+ public readonly string TooltipContainer;
+ Lazy tooltipContainer;
+ OrderManager orderManager;
+ int clientIndex;
+
+ public ClientTooltipRegionWidget() : base()
+ {
+ tooltipContainer = Lazy.New(() => Ui.Root.Get(TooltipContainer));
+ }
+
+ protected ClientTooltipRegionWidget(ClientTooltipRegionWidget other)
+ : base(other)
+ {
+ Template = other.Template;
+ TooltipContainer = other.TooltipContainer;
+ tooltipContainer = Lazy.New(() => Ui.Root.Get(TooltipContainer));
+ orderManager = other.orderManager;
+ clientIndex = other.clientIndex;
+ }
+
+ public override Widget Clone() { return new ClientTooltipRegionWidget(this); }
+
+ public void Bind(OrderManager orderManager, int clientIndex)
+ {
+ this.orderManager = orderManager;
+ this.clientIndex = clientIndex;
+ }
+
+ public override void MouseEntered()
+ {
+ if (TooltipContainer == null)
+ return;
+ tooltipContainer.Value.SetTooltip(Template, new WidgetArgs() {{"orderManager", orderManager}, {"clientIndex", clientIndex}});
+ }
+
+ public override void MouseExited()
+ {
+ if (TooltipContainer == null)
+ return;
+ tooltipContainer.Value.RemoveTooltip();
+ }
+ }
+}
diff --git a/OpenRA.Game/Widgets/MapPreviewWidget.cs b/OpenRA.Game/Widgets/MapPreviewWidget.cs
index 18ce33f525..3da666e6dc 100644
--- a/OpenRA.Game/Widgets/MapPreviewWidget.cs
+++ b/OpenRA.Game/Widgets/MapPreviewWidget.cs
@@ -24,7 +24,6 @@ namespace OpenRA.Widgets
public Func
diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
index df0d79d224..d19315ef96 100644
--- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
+++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj
@@ -430,6 +430,8 @@
+
+
diff --git a/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs
new file mode 100644
index 0000000000..847704bf92
--- /dev/null
+++ b/OpenRA.Mods.RA/Widgets/Logic/ClientTooltipLogic.cs
@@ -0,0 +1,64 @@
+#region Copyright & License Information
+/*
+ * Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
+ * This file is part of OpenRA, which is free software. It is made
+ * available to you under the terms of the GNU General Public License
+ * as published by the Free Software Foundation. For more information,
+ * see COPYING.
+ */
+#endregion
+
+using System;
+using System.Drawing;
+using System.Linq;
+using OpenRA.Widgets;
+using OpenRA.Network;
+
+namespace OpenRA.Mods.RA.Widgets.Logic
+{
+ public class ClientTooltipLogic
+ {
+ [ObjectCreator.UseCtor]
+ public ClientTooltipLogic(Widget widget, TooltipContainerWidget tooltipContainer, OrderManager orderManager, int clientIndex)
+ {
+ var admin = widget.Get("ADMIN");
+ var adminFont = Game.Renderer.Fonts[admin.Font];
+
+ var latency = widget.Get("LATENCY");
+ var latencyFont = Game.Renderer.Fonts[latency.Font];
+
+ var ip = widget.Get("IP");
+ var ipFont = Game.Renderer.Fonts[ip.Font];
+
+ var ipOffset = ip.Bounds.Y;
+ var latencyOffset = latency.Bounds.Y;
+ var tooltipHeight = widget.Bounds.Height;
+
+ var margin = widget.Bounds.Width;
+ tooltipContainer.BeforeRender = () =>
+ {
+ var width = Math.Max(adminFont.Measure(admin.GetText()).X, Math.Max(ipFont.Measure(ip.GetText()).X, latencyFont.Measure(latency.GetText()).X));
+ widget.Bounds.Width = width + 2*margin;
+ latency.Bounds.Width = widget.Bounds.Width;
+ ip.Bounds.Width = widget.Bounds.Width;
+ admin.Bounds.Width = widget.Bounds.Width;
+
+ ip.Bounds.Y = ipOffset;
+ latency.Bounds.Y = latencyOffset;
+ widget.Bounds.Height = tooltipHeight;
+
+ if (admin.IsVisible())
+ {
+ ip.Bounds.Y += admin.Bounds.Height;
+ latency.Bounds.Y += admin.Bounds.Height;
+ widget.Bounds.Height += admin.Bounds.Height;
+ }
+ };
+
+ admin.IsVisible = () => orderManager.LobbyInfo.ClientWithIndex(clientIndex).IsAdmin;
+ latency.GetText = () => "Latency: {0}".F(LobbyUtils.LatencyDescription(orderManager.LobbyInfo.ClientWithIndex(clientIndex).Latency));
+ ip.GetText = () => orderManager.LobbyInfo.ClientWithIndex(clientIndex).IpAddress;
+ }
+ }
+}
+
diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs
index e1604531f8..e57c09181e 100644
--- a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs
+++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs
@@ -112,7 +112,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
mapPreview.IsVisible = () => Map != null;
mapPreview.Map = () => Map;
mapPreview.OnMouseDown = mi => LobbyUtils.SelectSpawnPoint( orderManager, mapPreview, Map, mi );
- mapPreview.OnTooltip = (spawnPoint, pos) => LobbyUtils.ShowSpawnPointTooltip(orderManager, spawnPoint, pos);
mapPreview.SpawnClients = () => LobbyUtils.GetSpawnClients(orderManager, Map);
var mapTitle = lobby.GetOrNull("MAP_TITLE");
@@ -389,7 +388,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
if (template == null || template.Id != EditablePlayerTemplate.Id)
template = EditablePlayerTemplate.Clone();
- LobbyUtils.SetupAdminPingWidget(template, slot, client, orderManager, client.Bot == null);
+ LobbyUtils.SetupClientWidget(template, slot, client, orderManager, client.Bot == null);
if (client.Bot != null)
LobbyUtils.SetupEditableSlotWidget(template, slot, client, orderManager);
@@ -409,7 +408,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
if (template == null || template.Id != NonEditablePlayerTemplate.Id)
template = NonEditablePlayerTemplate.Clone();
- LobbyUtils.SetupAdminPingWidget(template, slot, client, orderManager, client.Bot == null);
+ LobbyUtils.SetupClientWidget(template, slot, client, orderManager, client.Bot == null);
LobbyUtils.SetupNameWidget(template, slot, client);
LobbyUtils.SetupKickWidget(template, slot, client, orderManager);
LobbyUtils.SetupColorWidget(template, slot, client);
@@ -460,7 +459,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
LobbyUtils.SetupReadyWidget(template, null, client);
}
- LobbyUtils.SetupAdminPingWidget(template, null, c, orderManager, true);
+ LobbyUtils.SetupClientWidget(template, null, c, orderManager, true);
template.IsVisible = () => true;
if (idx >= Players.Children.Count)
diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs
index 8cbf698add..09659d261e 100644
--- a/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs
+++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs
@@ -158,35 +158,42 @@ namespace OpenRA.Mods.RA.Widgets.Logic
}
}
- public static void ShowSpawnPointTooltip(OrderManager orderManager, int spawnPoint, int2 position)
+ public static Color LatencyColor(int latency)
{
- var client = orderManager.LobbyInfo.Clients.FirstOrDefault(c => c.SpawnPoint == spawnPoint);
- if (client != null)
- {
- Game.Renderer.Fonts["Bold"].DrawTextWithContrast(client.Name, position + new int2(5, 5), Color.White, Color.Black, 1);
- }
- }
-
- static Color GetPingColor(Session.Client c)
- {
- if (c.Ping < 0) // Ping unknown
+ // Levels set relative to the default order lag of 3 net ticks (360ms)
+ // TODO: Adjust this once dynamic lag is implemented
+ if (latency < 0)
return Color.Gray;
- if (c.Ping > 720) // OrderLag > 6
- return Color.Red;
- if (c.Ping > 360) // OrderLag > 3
+ if (latency < 300)
+ return Color.LimeGreen;
+ if (latency < 600)
return Color.Orange;
-
- return Color.LimeGreen;
+ return Color.Red;
}
- public static void SetupAdminPingWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, bool visible)
+ public static string LatencyDescription(int latency)
+ {
+ if (latency < 0)
+ return "Unknown";
+ if (latency < 300)
+ return "Good";
+ if (latency < 600)
+ return "Moderate";
+ return "Poor";
+ }
+
+ public static void SetupClientWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, bool visible)
{
parent.Get("ADMIN_INDICATOR").IsVisible = () => c.IsAdmin;
- var block = parent.Get("PING_BLOCK");
+ var block = parent.Get("LATENCY");
block.IsVisible = () => visible;
if (visible)
- block.Get("PING_COLOR").GetColor = () => GetPingColor(c);
+ block.Get("LATENCY_COLOR").GetColor = () => LatencyColor(c.Latency);
+
+ var tooltip = parent.Get("CLIENT_REGION");
+ tooltip.IsVisible = () => visible;
+ tooltip.Bind(orderManager, c.Index);
}
public static void SetupEditableNameWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager)
diff --git a/OpenRA.Mods.Cnc/Widgets/Logic/SpawnSelectorTooltipLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/SpawnSelectorTooltipLogic.cs
similarity index 79%
rename from OpenRA.Mods.Cnc/Widgets/Logic/SpawnSelectorTooltipLogic.cs
rename to OpenRA.Mods.RA/Widgets/Logic/SpawnSelectorTooltipLogic.cs
index 6ad7f65538..3745ae98e4 100644
--- a/OpenRA.Mods.Cnc/Widgets/Logic/SpawnSelectorTooltipLogic.cs
+++ b/OpenRA.Mods.RA/Widgets/Logic/SpawnSelectorTooltipLogic.cs
@@ -14,7 +14,7 @@ using System.Linq;
using OpenRA.Widgets;
using OpenRA.Network;
-namespace OpenRA.Mods.Cnc.Widgets.Logic
+namespace OpenRA.Mods.RA.Widgets.Logic
{
public class SpawnSelectorTooltipLogic
{
@@ -25,9 +25,14 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
var label = widget.Get("LABEL");
var flag = widget.Get("FLAG");
var team = widget.Get("TEAM");
-
+ var singleHeight = widget.Get("SINGLE_HEIGHT").Bounds.Height;
+ var doubleHeight = widget.Get("DOUBLE_HEIGHT").Bounds.Height;
var ownerFont = Game.Renderer.Fonts[label.Font];
var teamFont = Game.Renderer.Fonts[team.Font];
+
+ // Width specified in YAML is used as the margin between flag / label and label / border
+ var labelMargin = widget.Bounds.Width;
+
var cachedWidth = 0;
var labelText = "";
string playerCountry = null;
@@ -43,18 +48,18 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
labelText = "Available spawn";
playerCountry = null;
playerTeam = 0;
- widget.Bounds.Height = 25;
+ widget.Bounds.Height = singleHeight;
}
else
{
labelText = client.Name;
playerCountry = client.Country;
playerTeam = client.Team;
- widget.Bounds.Height = playerTeam > 0 ? 40 : 25;
+ widget.Bounds.Height = playerTeam > 0 ? doubleHeight : singleHeight;
teamWidth = teamFont.Measure(team.GetText()).X;
}
- label.Bounds.X = playerCountry != null ? flag.Bounds.Right + 5 : 5;
+ label.Bounds.X = playerCountry != null ? flag.Bounds.Right + labelMargin : labelMargin;
var textWidth = ownerFont.Measure(labelText).X;
if (textWidth != cachedWidth)
@@ -63,7 +68,7 @@ namespace OpenRA.Mods.Cnc.Widgets.Logic
widget.Bounds.Width = 2*label.Bounds.X + textWidth;
}
- widget.Bounds.Width = Math.Max(teamWidth + 10, label.Bounds.Right + 5);
+ widget.Bounds.Width = Math.Max(teamWidth + 2*labelMargin, label.Bounds.Right + labelMargin);
team.Bounds.Width = widget.Bounds.Width;
};
diff --git a/mods/cnc/chrome/lobby.yaml b/mods/cnc/chrome/lobby.yaml
index b5f325c6e0..6c64204219 100644
--- a/mods/cnc/chrome/lobby.yaml
+++ b/mods/cnc/chrome/lobby.yaml
@@ -73,7 +73,7 @@ Container@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Background@PING_BLOCK:
+ Background@LATENCY:
Background:button
X:0
Y:6
@@ -81,11 +81,16 @@ Container@SERVER_LOBBY:
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
TextField@NAME:
Text:Name
X:15
@@ -161,7 +166,7 @@ Container@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Background@PING_BLOCK:
+ Background@LATENCY:
Background:button
X:0
Y:6
@@ -169,11 +174,16 @@ Container@SERVER_LOBBY:
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
Label@NAME:
Text:Name
Width:185
@@ -263,7 +273,7 @@ Container@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Background@PING_BLOCK:
+ Background@LATENCY:
Background:button
X:0
Y:6
@@ -271,11 +281,16 @@ Container@SERVER_LOBBY:
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
TextField@NAME:
Text:Name
X:15
@@ -319,7 +334,7 @@ Container@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Background@PING_BLOCK:
+ Background@LATENCY:
Background:button
X:0
Y:6
@@ -327,11 +342,16 @@ Container@SERVER_LOBBY:
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
Label@NAME:
Text:Name
Width:185
@@ -480,7 +500,6 @@ Container@SERVER_LOBBY:
Height:25
Align:Right
Text:Chat:
- TooltipContainer@TOOLTIP_CONTAINER:
Button@DISCONNECT_BUTTON:
X:0
Y:499
@@ -505,3 +524,4 @@ Container@SERVER_LOBBY:
Width:140
Height:35
Text:Start Game
+ TooltipContainer@TOOLTIP_CONTAINER:
\ No newline at end of file
diff --git a/mods/cnc/chrome/tooltips.yaml b/mods/cnc/chrome/tooltips.yaml
index ed35e8ddb3..7393067200 100644
--- a/mods/cnc/chrome/tooltips.yaml
+++ b/mods/cnc/chrome/tooltips.yaml
@@ -103,8 +103,12 @@ Background@SUPPORT_POWER_TOOLTIP:
Background@SPAWN_TOOLTIP:
Logic:SpawnSelectorTooltipLogic
Background:panel-black
- Width:141
+ Width:5
Children:
+ Container@SINGLE_HEIGHT:
+ Height:26
+ Container@DOUBLE_HEIGHT:
+ Height:40
Label@LABEL:
X:5
Height:23
@@ -118,4 +122,28 @@ Background@SPAWN_TOOLTIP:
Y:21
Height:15
Font:TinyBold
- Align:center
\ No newline at end of file
+ Align:center
+
+Background@CLIENT_TOOLTIP:
+ Logic:ClientTooltipLogic
+ Background:panel-black
+ Height:35
+ Width:5
+ Children:
+ Label@ADMIN:
+ Y:2
+ Height:18
+ Font:Bold
+ Text:Game Admin
+ Align:Center
+ Label@IP:
+ Y:5
+ Width:5
+ Height:10
+ Font:TinyBold
+ Align:Center
+ Label@LATENCY:
+ Y:17
+ Height:10
+ Font:TinyBold
+ Align:Center
diff --git a/mods/d2k/chrome/lobby.yaml b/mods/d2k/chrome/lobby.yaml
index e000aadfec..352a73a78f 100644
--- a/mods/d2k/chrome/lobby.yaml
+++ b/mods/d2k/chrome/lobby.yaml
@@ -34,6 +34,7 @@ Background@SERVER_LOBBY:
Y:4
Width:244
Height:244
+ TooltipContainer:TOOLTIP_CONTAINER
ScrollPanel@PLAYERS:
X:20
Y:67
@@ -53,18 +54,23 @@ Background@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Container@PING_BLOCK:
+ Container@LATENCY:
X:0
Y:6
Width:11
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
TextField@NAME:
Text:Name
X:15
@@ -139,18 +145,23 @@ Background@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Container@PING_BLOCK:
+ Container@LATENCY:
X:0
Y:6
Width:11
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
Label@NAME:
Text:Name
Width:130
@@ -239,18 +250,23 @@ Background@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Container@PING_BLOCK:
+ Container@LATENCY:
X:0
Y:6
Width:11
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
TextField@NAME:
Text:Name
X:15
@@ -301,18 +317,23 @@ Background@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Container@PING_BLOCK:
+ Container@LATENCY:
X:0
Y:6
Width:11
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
Label@NAME:
Text:Name
Width:130
@@ -493,4 +514,5 @@ Background@SERVER_LOBBY:
Width:120
Height:25
Text:Start Game
- Font:Bold
\ No newline at end of file
+ Font:Bold
+ TooltipContainer@TOOLTIP_CONTAINER:
\ No newline at end of file
diff --git a/mods/d2k/chrome/tooltips.yaml b/mods/d2k/chrome/tooltips.yaml
new file mode 100644
index 0000000000..25ee4544b7
--- /dev/null
+++ b/mods/d2k/chrome/tooltips.yaml
@@ -0,0 +1,47 @@
+Background@SPAWN_TOOLTIP:
+ Logic:SpawnSelectorTooltipLogic
+ Background:dialog3
+ Width:7
+ Children:
+ Container@SINGLE_HEIGHT:
+ Height:31
+ Container@DOUBLE_HEIGHT:
+ Height:47
+ Label@LABEL:
+ Y:3
+ Height:23
+ Font:Bold
+ Image@FLAG:
+ X:5
+ Y:5
+ Width:23
+ Height:23
+ Label@TEAM:
+ Y:28
+ Height:15
+ Font:TinyBold
+ Align:center
+
+Background@CLIENT_TOOLTIP:
+ Logic:ClientTooltipLogic
+ Background:dialog3
+ Height:39
+ Width:7
+ Children:
+ Label@ADMIN:
+ Y:4
+ Height:18
+ Font:Bold
+ Text:Game Admin
+ Align:Center
+ Label@IP:
+ Y:7
+ Width:5
+ Height:10
+ Font:TinyBold
+ Align:Center
+ Label@LATENCY:
+ Y:19
+ Height:10
+ Font:TinyBold
+ Align:Center
diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml
index 477dd592b6..0999f09c7c 100644
--- a/mods/d2k/mod.yaml
+++ b/mods/d2k/mod.yaml
@@ -60,6 +60,7 @@ ChromeLayout:
mods/ra/chrome/dropdowns.yaml
mods/ra/chrome/modchooser.yaml
mods/ra/chrome/cheats.yaml
+ mods/d2k/chrome/tooltips.yaml
Weapons:
mods/d2k/weapons/defaults.yaml
diff --git a/mods/ra/chrome/lobby.yaml b/mods/ra/chrome/lobby.yaml
index 39de30bbac..22115f69b3 100644
--- a/mods/ra/chrome/lobby.yaml
+++ b/mods/ra/chrome/lobby.yaml
@@ -34,6 +34,7 @@ Background@SERVER_LOBBY:
Y:4
Width:244
Height:244
+ TooltipContainer:TOOLTIP_CONTAINER
ScrollPanel@PLAYERS:
X:20
Y:67
@@ -53,18 +54,23 @@ Background@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Container@PING_BLOCK:
+ Container@LATENCY:
X:0
Y:6
Width:11
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
TextField@NAME:
Text:Name
X:15
@@ -139,18 +145,23 @@ Background@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Container@PING_BLOCK:
+ Container@LATENCY:
X:0
Y:6
Width:11
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
Label@NAME:
Text:Name
Width:130
@@ -239,18 +250,23 @@ Background@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Container@PING_BLOCK:
+ Container@LATENCY:
X:0
Y:6
Width:11
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
TextField@NAME:
Text:Name
X:15
@@ -301,18 +317,23 @@ Background@SERVER_LOBBY:
ImageName:admin
X:2
Visible:false
- Container@PING_BLOCK:
+ Container@LATENCY:
X:0
Y:6
Width:11
Height:14
Visible:false
Children:
- ColorBlock@PING_COLOR:
+ ColorBlock@LATENCY_COLOR:
X:2
Y:2
Width:PARENT_RIGHT-4
Height:PARENT_BOTTOM-4
+ ClientTooltipRegion@CLIENT_REGION:
+ TooltipContainer:TOOLTIP_CONTAINER
+ Template:CLIENT_TOOLTIP
+ Width:11
+ Height:25
Label@NAME:
Text:Name
Width:130
@@ -499,4 +520,5 @@ Background@SERVER_LOBBY:
Width:120
Height:25
Text:Start Game
- Font:Bold
\ No newline at end of file
+ Font:Bold
+ TooltipContainer@TOOLTIP_CONTAINER:
\ No newline at end of file
diff --git a/mods/ra/chrome/tooltips.yaml b/mods/ra/chrome/tooltips.yaml
new file mode 100644
index 0000000000..2d948ffef7
--- /dev/null
+++ b/mods/ra/chrome/tooltips.yaml
@@ -0,0 +1,47 @@
+Background@SPAWN_TOOLTIP:
+ Logic:SpawnSelectorTooltipLogic
+ Background:dialog4
+ Width:7
+ Children:
+ Container@SINGLE_HEIGHT:
+ Height:29
+ Container@DOUBLE_HEIGHT:
+ Height:44
+ Label@LABEL:
+ Y:2
+ Height:23
+ Font:Bold
+ Image@FLAG:
+ X:7
+ Y:7
+ Width:32
+ Height:16
+ Label@TEAM:
+ Y:23
+ Height:15
+ Font:TinyBold
+ Align:center
+
+Background@CLIENT_TOOLTIP:
+ Logic:ClientTooltipLogic
+ Background:dialog4
+ Height:39
+ Width:7
+ Children:
+ Label@ADMIN:
+ Y:4
+ Height:18
+ Font:Bold
+ Text:Game Admin
+ Align:Center
+ Label@IP:
+ Y:7
+ Width:5
+ Height:10
+ Font:TinyBold
+ Align:Center
+ Label@LATENCY:
+ Y:19
+ Height:10
+ Font:TinyBold
+ Align:Center
diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml
index ae392c4e35..d5f84e3c1b 100644
--- a/mods/ra/mod.yaml
+++ b/mods/ra/mod.yaml
@@ -70,6 +70,7 @@ ChromeLayout:
mods/ra/chrome/modchooser.yaml
mods/ra/chrome/cheats.yaml
mods/ra/chrome/objectives.yaml
+ mods/ra/chrome/tooltips.yaml
Weapons:
mods/ra/weapons.yaml