Fix obsolete Game.Disconnect()
This commit is contained in:
@@ -346,15 +346,7 @@ namespace OpenRA
|
||||
AddChatLine(Color.White, "Debug", String.Format(s,args));
|
||||
}
|
||||
|
||||
// TODO: Fix ra relying on this behavior, then make this sane
|
||||
[Obsolete] public static void Disconnect()
|
||||
{
|
||||
DisconnectOnly();
|
||||
var shellmap = ChooseShellmap();
|
||||
StartGame(shellmap);
|
||||
}
|
||||
|
||||
public static void DisconnectOnly()
|
||||
public static void Disconnect()
|
||||
{
|
||||
if (orderManager.world != null)
|
||||
orderManager.world.traitDict.PrintReport();
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
world.WorldActor.QueueActivity(new Wait(mpe.Info.FadeLength));
|
||||
world.WorldActor.QueueActivity(new CallFunc(() =>
|
||||
{
|
||||
Game.DisconnectOnly();
|
||||
Game.Disconnect();
|
||||
Widget.RootWidget.RemoveChildren();
|
||||
Game.LoadShellMap();
|
||||
}));
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
Menu = MenuType.None;
|
||||
Game.OpenWindow("SERVER_LOBBY", new WidgetArgs()
|
||||
{
|
||||
{ "onExit", () => { Game.DisconnectOnly(); Menu = menu; } },
|
||||
{ "onExit", () => { Game.Disconnect(); Menu = menu; } },
|
||||
{ "onStart", RemoveShellmapUI }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
widget.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => {
|
||||
widget.GetWidget("CONNECTION_BUTTON_ABORT").Parent.Visible = false;
|
||||
Game.Disconnect();
|
||||
Game.LoadShellMap();
|
||||
Widget.CloseWindow();
|
||||
Widget.OpenWindow("MAINMENU_BG");
|
||||
return true;
|
||||
@@ -44,6 +45,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
widget.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => {
|
||||
widget.GetWidget("CONNECTION_BUTTON_CANCEL").Parent.Visible = false;
|
||||
Game.Disconnect();
|
||||
Game.LoadShellMap();
|
||||
Widget.CloseWindow();
|
||||
Widget.OpenWindow("MAINMENU_BG");
|
||||
return true;
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
optionsBG.GetWidget("DISCONNECT").OnMouseUp = mi => {
|
||||
optionsBG.Visible = false;
|
||||
Game.Disconnect();
|
||||
Game.LoadShellMap();
|
||||
Widget.CloseWindow();
|
||||
Widget.OpenWindow("MAINMENU_BG");
|
||||
return true;
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
optionsBG.GetWidget("DISCONNECT").OnMouseUp = mi => {
|
||||
optionsBG.Visible = false;
|
||||
Game.Disconnect();
|
||||
Game.LoadShellMap();
|
||||
Widget.CloseWindow();
|
||||
Widget.OpenWindow("MAINMENU_BG");
|
||||
return true;
|
||||
|
||||
@@ -102,6 +102,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
disconnectButton.OnMouseUp = mi =>
|
||||
{
|
||||
Game.Disconnect();
|
||||
Game.LoadShellMap();
|
||||
Widget.CloseWindow();
|
||||
Widget.OpenWindow("MAINMENU_BG");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user