From dfbce6202492e578907dcb13da01dc7f0ec9d8ec Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 19 Mar 2014 12:23:49 +1300 Subject: [PATCH] Don't show the main menu when returning to the server browser. Fixes #4902. --- OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs index 7e09dc7ccd..0a5fbdf279 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs @@ -23,11 +23,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic { public class ServerBrowserLogic { + readonly static Action DoNothing = () => { }; + GameServer currentServer; ScrollItemWidget serverTemplate; Action onStart; - Action onExit; enum SearchStatus { Fetching, Failed, NoGames, Hidden } SearchStatus searchStatus = SearchStatus.Fetching; @@ -54,7 +55,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic { panel = widget; this.onStart = onStart; - this.onExit = onExit; serverList = panel.Get("SERVER_LIST"); serverTemplate = serverList.Get("SERVER_TEMPLATE"); @@ -258,7 +258,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic Ui.OpenWindow("DIRECTCONNECT_PANEL", new WidgetArgs { { "openLobby", OpenLobby }, - { "onExit", () => { } } + { "onExit", DoNothing } }); } @@ -267,7 +267,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic Ui.OpenWindow("CREATESERVER_PANEL", new WidgetArgs { { "openLobby", OpenLobby }, - { "onExit", () => { } } + { "onExit", DoNothing } }); } @@ -279,7 +279,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic var host = server.Address.Split(':')[0]; var port = int.Parse(server.Address.Split(':')[1]); - ConnectionLogic.Connect(host, port, "", OpenLobby, onExit); + ConnectionLogic.Connect(host, port, "", OpenLobby, DoNothing); } string GetPlayersLabel(GameServer game)