@@ -35,6 +35,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
var tooltipHeight = widget.Bounds.Height;
|
||||
|
||||
var margin = widget.Bounds.Width;
|
||||
|
||||
tooltipContainer.IsVisible = () => (orderManager.LobbyInfo.ClientWithIndex(clientIndex) != null);
|
||||
tooltipContainer.BeforeRender = () =>
|
||||
{
|
||||
var width = Math.Max(adminFont.Measure(admin.GetText()).X, Math.Max(ipFont.Measure(ip.GetText()).X, latencyFont.Measure(latency.GetText()).X));
|
||||
@@ -57,7 +59,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
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;
|
||||
ip.GetText = () => LobbyUtils.DescriptiveIpAddress(orderManager.LobbyInfo.ClientWithIndex(clientIndex).IpAddress);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,6 +182,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
return "Poor";
|
||||
}
|
||||
|
||||
public static string DescriptiveIpAddress(string ip)
|
||||
{
|
||||
if (ip == null)
|
||||
return "Unknown Host";
|
||||
if (ip == "127.0.0.1")
|
||||
return "Local Host";
|
||||
return ip;
|
||||
}
|
||||
|
||||
public static void SetupClientWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, bool visible)
|
||||
{
|
||||
parent.Get("ADMIN_INDICATOR").IsVisible = () => c.IsAdmin;
|
||||
|
||||
Reference in New Issue
Block a user