Fix long player locations overrunning the player tooltip.

This commit is contained in:
Paul Chote
2020-04-12 13:06:49 +01:00
committed by abcdefg30
parent 80131e7ec0
commit 6828c4c1e9

View File

@@ -322,8 +322,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (client.Location != null)
{
var locationFont = Game.Renderer.Fonts[locationLabel.Font];
var locationWidth = widget.Bounds.Width - 2 * locationLabel.Bounds.X;
var location = WidgetUtils.TruncateText(client.Location, locationWidth, locationFont);
locationLabel.IsVisible = () => true;
locationLabel.GetText = () => client.Location;
locationLabel.GetText = () => location;
widget.Bounds.Height += locationLabel.Bounds.Height;
ipLabel.Bounds.Y += locationLabel.Bounds.Height;
adminLabel.Bounds.Y += locationLabel.Bounds.Height;