Merge pull request #10491 from pchote/fix-country-overflow
Fix MP browser country name overflow
This commit is contained in:
@@ -402,8 +402,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var location = item.GetOrNull<LabelWidget>("LOCATION");
|
||||
if (location != null)
|
||||
{
|
||||
var font = Game.Renderer.Fonts[location.Font];
|
||||
var cachedServerLocation = GeoIP.LookupCountry(game.Address.Split(':')[0]);
|
||||
location.GetText = () => cachedServerLocation;
|
||||
var label = WidgetUtils.TruncateText(cachedServerLocation, location.Bounds.Width, font);
|
||||
location.GetText = () => label;
|
||||
location.GetColor = () => canJoin ? location.TextColor : incompatibleGameColor;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ Container@MULTIPLAYER_BROWSER_PANEL:
|
||||
Font: Bold
|
||||
Label@LOCATION:
|
||||
X: 380
|
||||
Width: 120
|
||||
Width: 110
|
||||
Height: 25
|
||||
Text: Country
|
||||
Font: Bold
|
||||
@@ -71,7 +71,7 @@ Container@MULTIPLAYER_BROWSER_PANEL:
|
||||
Height: 25
|
||||
Label@LOCATION:
|
||||
X: 380
|
||||
Width: 120
|
||||
Width: 110
|
||||
Height: 25
|
||||
Label@STATUS:
|
||||
X: 495
|
||||
|
||||
@@ -22,7 +22,7 @@ Container@MULTIPLAYER_BROWSER_PANEL:
|
||||
Font: Bold
|
||||
Label@LOCATION:
|
||||
X: 380
|
||||
Width: 120
|
||||
Width: 110
|
||||
Height: 25
|
||||
Text: Country
|
||||
Font: Bold
|
||||
@@ -72,7 +72,7 @@ Container@MULTIPLAYER_BROWSER_PANEL:
|
||||
Height: 25
|
||||
Label@LOCATION:
|
||||
X: 380
|
||||
Width: 120
|
||||
Width: 110
|
||||
Height: 25
|
||||
Label@STATUS:
|
||||
X: 495
|
||||
|
||||
Reference in New Issue
Block a user