Reimplement connecting / connection failed dialogs.

This commit is contained in:
Paul Chote
2011-05-08 16:12:24 +12:00
parent a607a60b8f
commit 5c59f7703d
10 changed files with 270 additions and 147 deletions

View File

@@ -20,6 +20,7 @@ namespace OpenRA.Mods.Cnc.Widgets
{
Widget panel;
Action onCreate;
Action onExit;
Map map;
bool advertiseOnline;
[ObjectCreator.UseCtor]
@@ -29,6 +30,7 @@ namespace OpenRA.Mods.Cnc.Widgets
{
panel = widget.GetWidget("CREATESERVER_PANEL");
onCreate = openLobby;
this.onExit = onExit;
var settings = Game.Settings;
panel.GetWidget<CncMenuButtonWidget>("BACK_BUTTON").OnClick = onExit;
@@ -68,9 +70,9 @@ namespace OpenRA.Mods.Cnc.Widgets
Game.Settings.Server.AdvertiseOnline = advertiseOnline;
Game.Settings.Save();
Game.CreateAndJoinServer(Game.Settings, map.Uid);
Game.CreateServer(Game.Settings, map.Uid);
Widget.CloseWindow();
onCreate();
CncConnectingLogic.Connect(IPAddress.Loopback.ToString(), Game.Settings.Server.ListenPort, onCreate, onExit);
}
}
}