Fix obsolete Game.Disconnect()

This commit is contained in:
Paul Chote
2011-05-22 13:23:27 +12:00
parent 16cd1679dd
commit 8eb4e663d2
7 changed files with 8 additions and 11 deletions

View File

@@ -346,15 +346,7 @@ namespace OpenRA
AddChatLine(Color.White, "Debug", String.Format(s,args)); AddChatLine(Color.White, "Debug", String.Format(s,args));
} }
// TODO: Fix ra relying on this behavior, then make this sane public static void Disconnect()
[Obsolete] public static void Disconnect()
{
DisconnectOnly();
var shellmap = ChooseShellmap();
StartGame(shellmap);
}
public static void DisconnectOnly()
{ {
if (orderManager.world != null) if (orderManager.world != null)
orderManager.world.traitDict.PrintReport(); orderManager.world.traitDict.PrintReport();

View File

@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Cnc.Widgets
world.WorldActor.QueueActivity(new Wait(mpe.Info.FadeLength)); world.WorldActor.QueueActivity(new Wait(mpe.Info.FadeLength));
world.WorldActor.QueueActivity(new CallFunc(() => world.WorldActor.QueueActivity(new CallFunc(() =>
{ {
Game.DisconnectOnly(); Game.Disconnect();
Widget.RootWidget.RemoveChildren(); Widget.RootWidget.RemoveChildren();
Game.LoadShellMap(); Game.LoadShellMap();
})); }));

View File

@@ -136,7 +136,7 @@ namespace OpenRA.Mods.Cnc.Widgets
Menu = MenuType.None; Menu = MenuType.None;
Game.OpenWindow("SERVER_LOBBY", new WidgetArgs() Game.OpenWindow("SERVER_LOBBY", new WidgetArgs()
{ {
{ "onExit", () => { Game.DisconnectOnly(); Menu = menu; } }, { "onExit", () => { Game.Disconnect(); Menu = menu; } },
{ "onStart", RemoveShellmapUI } { "onStart", RemoveShellmapUI }
}); });
} }

View File

@@ -24,6 +24,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
widget.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => { widget.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => {
widget.GetWidget("CONNECTION_BUTTON_ABORT").Parent.Visible = false; widget.GetWidget("CONNECTION_BUTTON_ABORT").Parent.Visible = false;
Game.Disconnect(); Game.Disconnect();
Game.LoadShellMap();
Widget.CloseWindow(); Widget.CloseWindow();
Widget.OpenWindow("MAINMENU_BG"); Widget.OpenWindow("MAINMENU_BG");
return true; return true;
@@ -44,6 +45,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
widget.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => { widget.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => {
widget.GetWidget("CONNECTION_BUTTON_CANCEL").Parent.Visible = false; widget.GetWidget("CONNECTION_BUTTON_CANCEL").Parent.Visible = false;
Game.Disconnect(); Game.Disconnect();
Game.LoadShellMap();
Widget.CloseWindow(); Widget.CloseWindow();
Widget.OpenWindow("MAINMENU_BG"); Widget.OpenWindow("MAINMENU_BG");
return true; return true;

View File

@@ -30,6 +30,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
optionsBG.GetWidget("DISCONNECT").OnMouseUp = mi => { optionsBG.GetWidget("DISCONNECT").OnMouseUp = mi => {
optionsBG.Visible = false; optionsBG.Visible = false;
Game.Disconnect(); Game.Disconnect();
Game.LoadShellMap();
Widget.CloseWindow(); Widget.CloseWindow();
Widget.OpenWindow("MAINMENU_BG"); Widget.OpenWindow("MAINMENU_BG");
return true; return true;

View File

@@ -30,6 +30,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
optionsBG.GetWidget("DISCONNECT").OnMouseUp = mi => { optionsBG.GetWidget("DISCONNECT").OnMouseUp = mi => {
optionsBG.Visible = false; optionsBG.Visible = false;
Game.Disconnect(); Game.Disconnect();
Game.LoadShellMap();
Widget.CloseWindow(); Widget.CloseWindow();
Widget.OpenWindow("MAINMENU_BG"); Widget.OpenWindow("MAINMENU_BG");
return true; return true;

View File

@@ -102,6 +102,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
disconnectButton.OnMouseUp = mi => disconnectButton.OnMouseUp = mi =>
{ {
Game.Disconnect(); Game.Disconnect();
Game.LoadShellMap();
Widget.CloseWindow(); Widget.CloseWindow();
Widget.OpenWindow("MAINMENU_BG"); Widget.OpenWindow("MAINMENU_BG");
return true; return true;