Rename Ping -> Latency.

This commit is contained in:
Paul Chote
2013-04-25 13:43:05 +12:00
parent a1d2229a58
commit fd58461d43
7 changed files with 41 additions and 41 deletions

View File

@@ -388,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);
@@ -408,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);
@@ -459,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)

View File

@@ -158,26 +158,26 @@ namespace OpenRA.Mods.RA.Widgets.Logic
}
}
static Color GetPingColor(Session.Client c)
static Color GetLatencyColor(Session.Client c)
{
if (c.Ping < 0) // Ping unknown
if (c.Latency < 0) // Ping unknown
return Color.Gray;
if (c.Ping > 720) // OrderLag > 6
if (c.Latency > 720) // OrderLag > 6
return Color.Red;
if (c.Ping > 360) // OrderLag > 3
if (c.Latency > 360) // OrderLag > 3
return Color.Orange;
return Color.LimeGreen;
}
public static void SetupAdminPingWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager, bool visible)
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<ColorBlockWidget>("PING_COLOR").GetColor = () => GetPingColor(c);
block.Get<ColorBlockWidget>("LATENCY_COLOR").GetColor = () => GetLatencyColor(c);
}
public static void SetupEditableNameWidget(Widget parent, Session.Slot s, Session.Client c, OrderManager orderManager)