Add Launch.Connect parameter for launching directly to a server.

This commit is contained in:
Paul Chote
2014-12-13 14:33:54 +13:00
parent 7bfffeadc2
commit 660f6682ff
4 changed files with 55 additions and 2 deletions

View File

@@ -48,7 +48,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic
Ui.OpenWindow("SERVERBROWSER_PANEL", new WidgetArgs
{
{ "onStart", RemoveShellmapUI },
{ "onExit", () => menuType = MenuType.Main }
{ "onExit", () => menuType = MenuType.Main },
{ "directConnectHost", null },
{ "directConnectPort", 0 },
});
};
@@ -173,6 +175,18 @@ namespace OpenRA.Mods.RA.Widgets.Logic
newsButton.IsHighlighted = () => newsHighlighted && Game.LocalTick % 50 < 25;
}
Game.OnRemoteDirectConnect += (host, port) =>
{
menuType = MenuType.None;
Ui.OpenWindow("SERVERBROWSER_PANEL", new WidgetArgs
{
{ "onStart", RemoveShellmapUI },
{ "onExit", () => menuType = MenuType.Main },
{ "directConnectHost", host },
{ "directConnectPort", port },
});
};
}
void SetNewsStatus(string message)