Remove legacy tooltip code.
This commit is contained in:
@@ -24,7 +24,6 @@ namespace OpenRA.Widgets
|
||||
public Func<Map> Map = () => null;
|
||||
public Func<Dictionary<int2, Session.Client>> SpawnClients = () => new Dictionary<int2, Session.Client>();
|
||||
public Action<MouseInput> OnMouseDown = _ => {};
|
||||
public Action<int, int2> OnTooltip = (_, __) => { };
|
||||
public bool IgnoreMouseInput = false;
|
||||
public bool ShowSpawnPoints = true;
|
||||
|
||||
@@ -147,13 +146,7 @@ namespace OpenRA.Widgets
|
||||
Game.Renderer.RgbaSpriteRenderer.DrawSprite(sprite, pos + offset);
|
||||
|
||||
if ((pos - Viewport.LastMousePos).LengthSquared < 64)
|
||||
{
|
||||
TooltipSpawnIndex = spawnPoints.IndexOf(p) + 1;
|
||||
|
||||
// Legacy tooltip behavior
|
||||
if (TooltipContainer == null)
|
||||
OnTooltip(TooltipSpawnIndex, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<LabelWidget>("MAP_TITLE");
|
||||
|
||||
@@ -158,15 +158,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShowSpawnPointTooltip(OrderManager orderManager, int spawnPoint, int2 position)
|
||||
{
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user