Move the mod-level initialisation code back into the load screen.

This commit is contained in:
Paul Chote
2014-12-13 12:47:34 +13:00
parent 711a1ca5fc
commit ec7a32184e
11 changed files with 97 additions and 104 deletions

View File

@@ -331,45 +331,7 @@ namespace OpenRA
Environment.Exit(0);
}
else
{
var window = args != null ? args.GetValue("Launch.Window", null) : null;
if (!string.IsNullOrEmpty(window))
{
var installData = modData.Manifest.ContentInstaller;
if (installData.InstallerBackgroundWidget != null)
Ui.LoadWidget(installData.InstallerBackgroundWidget, Ui.Root, new WidgetArgs());
Widgets.Ui.OpenWindow(window, new WidgetArgs());
}
else
{
modData.LoadScreen.StartGame();
Settings.Save();
var replay = args != null ? args.GetValue("Launch.Replay", null) : null;
if (!string.IsNullOrEmpty(replay))
Game.JoinReplay(replay);
}
}
}
public static void TestAndContinue()
{
Ui.ResetAll();
var installData = modData.Manifest.ContentInstaller;
if (!installData.TestFiles.All(f => GlobalFileSystem.Exists(f)))
{
var args = new WidgetArgs()
{
{ "continueLoading", () => InitializeMod(Game.Settings.Game.Mod, null) },
};
if (installData.InstallerBackgroundWidget != null)
Ui.LoadWidget(installData.InstallerBackgroundWidget, Ui.Root, args);
Ui.OpenWindow(installData.InstallerMenuWidget, args);
}
else
LoadShellMap();
modData.LoadScreen.StartGame(args);
}
public static void LoadShellMap()

View File

@@ -184,6 +184,6 @@ namespace OpenRA
{
void Init(Manifest m, Dictionary<string, string> info);
void Display();
void StartGame();
void StartGame(Arguments args);
}
}