diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 544ab00424..a4542d7ea2 100755 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -299,8 +299,7 @@ namespace OpenRA JoinLocal(); viewport = new Viewport(new int2(Renderer.Resolution), Rectangle.Empty, Renderer); - Widget.RootWidget.RemoveChildren(); - modData.WidgetLoader.LoadWidget( new Dictionary(), Widget.RootWidget, "INIT_SETUP" ); + modData.LoadScreen.StartGame(); } public static void LoadShellMap() diff --git a/OpenRA.Game/ModData.cs b/OpenRA.Game/ModData.cs index 5e67f008fd..16796ff105 100755 --- a/OpenRA.Game/ModData.cs +++ b/OpenRA.Game/ModData.cs @@ -120,5 +120,10 @@ namespace OpenRA } - public interface ILoadScreen { void Display(); void Init(); } + public interface ILoadScreen + { + void Display(); + void Init(); + void StartGame(); + } } diff --git a/OpenRA.Mods.Cnc/CncLoadScreen.cs b/OpenRA.Mods.Cnc/CncLoadScreen.cs index 6e41b3f84d..a73f7b2342 100644 --- a/OpenRA.Mods.Cnc/CncLoadScreen.cs +++ b/OpenRA.Mods.Cnc/CncLoadScreen.cs @@ -70,6 +70,12 @@ namespace OpenRA.Mods.Cnc Font.DrawText(text, new float2(Renderer.Resolution.Width - textSize.X - 20, Renderer.Resolution.Height - textSize.Y - 20), Color.Black); r.EndFrame( new NullInputHandler() ); } + + public void StartGame() + { + Widget.RootWidget.RemoveChildren(); + Game.modData.WidgetLoader.LoadWidget( new Dictionary(), Widget.RootWidget, "INIT_SETUP" ); + } } } diff --git a/OpenRA.Mods.RA/NullLoadScreen.cs b/OpenRA.Mods.RA/NullLoadScreen.cs index 963e983055..6e01e3453e 100644 --- a/OpenRA.Mods.RA/NullLoadScreen.cs +++ b/OpenRA.Mods.RA/NullLoadScreen.cs @@ -8,6 +8,9 @@ */ #endregion +using System.Collections.Generic; +using OpenRA.Widgets; + namespace OpenRA.Mods.RA { public class NullLoadScreen : ILoadScreen @@ -22,6 +25,12 @@ namespace OpenRA.Mods.RA Game.Renderer.BeginFrame(float2.Zero); Game.Renderer.EndFrame( new NullInputHandler() ); } + + public void StartGame() + { + Widget.RootWidget.RemoveChildren(); + Game.modData.WidgetLoader.LoadWidget( new Dictionary(), Widget.RootWidget, "INIT_SETUP" ); + } } } diff --git a/OpenRA.Mods.RA/RALoadScreen.cs b/OpenRA.Mods.RA/RALoadScreen.cs index ec03594ce3..0d9f70349f 100644 --- a/OpenRA.Mods.RA/RALoadScreen.cs +++ b/OpenRA.Mods.RA/RALoadScreen.cs @@ -47,7 +47,6 @@ namespace OpenRA.Mods.RA LogoPos = new float2(Renderer.Resolution.Width/2 - 128, Renderer.Resolution.Height/2 - 128); } - public void Display() { if (r == null) @@ -67,6 +66,12 @@ namespace OpenRA.Mods.RA Font.DrawText(text, new float2(Renderer.Resolution.Width - textSize.X - 20, Renderer.Resolution.Height - textSize.Y - 20), Color.White); r.EndFrame( new NullInputHandler() ); } + + public void StartGame() + { + Widget.RootWidget.RemoveChildren(); + Game.modData.WidgetLoader.LoadWidget( new Dictionary(), Widget.RootWidget, "INIT_SETUP" ); + } } }