get the server location from the IP

and show it in the game browser, closes #2555
This commit is contained in:
Matthias Mailänder
2013-08-07 19:23:22 +02:00
parent 9d40b430dc
commit fb042056b0
3 changed files with 17 additions and 0 deletions

View File

@@ -238,6 +238,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
version.GetText = () => GenerateModsLabel(game); version.GetText = () => GenerateModsLabel(game);
version.IsVisible = () => !game.CompatibleVersion(); version.IsVisible = () => !game.CompatibleVersion();
var location = item.Get<LabelWidget>("LOCATION");
location.GetText = () => LobbyUtils.LookupCountry(game.Address.Split(':')[0]);
location.IsVisible = () => game.CompatibleVersion();
if (!canJoin) if (!canJoin)
{ {
title.GetColor = () => Color.Gray; title.GetColor = () => Color.Gray;
@@ -246,6 +250,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
state.GetColor = () => Color.Gray; state.GetColor = () => Color.Gray;
ip.GetColor = () => Color.Gray; ip.GetColor = () => Color.Gray;
version.GetColor = () => Color.Gray; version.GetColor = () => Color.Gray;
location.GetColor = () => Color.Gray;
} }
if (!Filtered(game)) if (!Filtered(game))

View File

@@ -68,6 +68,12 @@ Container@SERVERBROWSER_PANEL:
Y:40 Y:40
Align:Right Align:Right
Height:25 Height:25
Label@LOCATION:
Width:140
X:PARENT_RIGHT-150
Y:40
Align:Right
Height:25
Label@PROGRESS_LABEL: Label@PROGRESS_LABEL:
X:(PARENT_RIGHT - WIDTH) / 2 X:(PARENT_RIGHT - WIDTH) / 2
Y:PARENT_BOTTOM / 2 - HEIGHT Y:PARENT_BOTTOM / 2 - HEIGHT

View File

@@ -95,6 +95,12 @@ Background@JOINSERVER_BG:
Y:40 Y:40
Align:Right Align:Right
Height:25 Height:25
Label@LOCATION:
Width:140
X:PARENT_RIGHT-150
Y:40
Align:Right
Height:25
Label@PROGRESS_LABEL: Label@PROGRESS_LABEL:
X:(PARENT_RIGHT - WIDTH) / 2 X:(PARENT_RIGHT - WIDTH) / 2
Y:PARENT_BOTTOM / 2 - HEIGHT Y:PARENT_BOTTOM / 2 - HEIGHT