Fix obsolete Game.Disconnect()
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
@@ -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();
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -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 }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user