|
|
|
@@ -27,6 +27,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|
|
|
var latency = widget.Get<LabelWidget>("LATENCY");
|
|
|
|
var latency = widget.Get<LabelWidget>("LATENCY");
|
|
|
|
var latencyFont = Game.Renderer.Fonts[latency.Font];
|
|
|
|
var latencyFont = Game.Renderer.Fonts[latency.Font];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var latencyPrefix = widget.Get<LabelWidget>("LATENCY_PREFIX");
|
|
|
|
|
|
|
|
var latencyPrefixFont = Game.Renderer.Fonts[latencyPrefix.Font];
|
|
|
|
|
|
|
|
|
|
|
|
var ip = widget.Get<LabelWidget>("IP");
|
|
|
|
var ip = widget.Get<LabelWidget>("IP");
|
|
|
|
var ipFont = Game.Renderer.Fonts[ip.Font];
|
|
|
|
var ipFont = Game.Renderer.Fonts[ip.Font];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -43,8 +46,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|
|
|
tooltipContainer.IsVisible = () => (orderManager.LobbyInfo.ClientWithIndex(clientIndex) != null);
|
|
|
|
tooltipContainer.IsVisible = () => (orderManager.LobbyInfo.ClientWithIndex(clientIndex) != null);
|
|
|
|
tooltipContainer.BeforeRender = () =>
|
|
|
|
tooltipContainer.BeforeRender = () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
var latencyPrefixSize = latencyPrefix.Bounds.X + latencyPrefixFont.Measure(latencyPrefix.GetText()+" ").X;
|
|
|
|
var width = Math.Max(locationFont.Measure(location.GetText()).X, (Math.Max(adminFont.Measure(admin.GetText()).X,
|
|
|
|
var width = Math.Max(locationFont.Measure(location.GetText()).X, (Math.Max(adminFont.Measure(admin.GetText()).X,
|
|
|
|
Math.Max(ipFont.Measure(ip.GetText()).X, latencyFont.Measure(latency.GetText()).X))));
|
|
|
|
Math.Max(ipFont.Measure(ip.GetText()).X, latencyPrefixSize + latencyFont.Measure(latency.GetText()).X))));
|
|
|
|
widget.Bounds.Width = width + 2 * margin;
|
|
|
|
widget.Bounds.Width = width + 2 * margin;
|
|
|
|
latency.Bounds.Width = widget.Bounds.Width;
|
|
|
|
latency.Bounds.Width = widget.Bounds.Width;
|
|
|
|
ip.Bounds.Width = widget.Bounds.Width;
|
|
|
|
ip.Bounds.Width = widget.Bounds.Width;
|
|
|
|
@@ -63,10 +67,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|
|
|
location.Bounds.Y += admin.Bounds.Height;
|
|
|
|
location.Bounds.Y += admin.Bounds.Height;
|
|
|
|
widget.Bounds.Height += admin.Bounds.Height;
|
|
|
|
widget.Bounds.Height += admin.Bounds.Height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
latencyPrefix.Bounds.Y = latency.Bounds.Y;
|
|
|
|
|
|
|
|
latency.Bounds.X = latencyPrefixSize;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
admin.IsVisible = () => orderManager.LobbyInfo.ClientWithIndex(clientIndex).IsAdmin;
|
|
|
|
admin.IsVisible = () => orderManager.LobbyInfo.ClientWithIndex(clientIndex).IsAdmin;
|
|
|
|
latency.GetText = () => "Latency: {0}".F(LobbyUtils.LatencyDescription(orderManager.LobbyInfo.ClientWithIndex(clientIndex).Latency));
|
|
|
|
latency.GetText = () => LobbyUtils.LatencyDescription(orderManager.LobbyInfo.ClientWithIndex(clientIndex).Latency);
|
|
|
|
latency.GetColor = () => LobbyUtils.LatencyColor(orderManager.LobbyInfo.ClientWithIndex(clientIndex).Latency);
|
|
|
|
latency.GetColor = () => LobbyUtils.LatencyColor(orderManager.LobbyInfo.ClientWithIndex(clientIndex).Latency);
|
|
|
|
var ipAddress = orderManager.LobbyInfo.ClientWithIndex(clientIndex).IpAddress;
|
|
|
|
var ipAddress = orderManager.LobbyInfo.ClientWithIndex(clientIndex).IpAddress;
|
|
|
|
if ((ipAddress == null || ipAddress == "127.0.0.1") && UPnP.NatDevice != null)
|
|
|
|
if ((ipAddress == null || ipAddress == "127.0.0.1") && UPnP.NatDevice != null)
|
|
|
|
|