Remove asset handling from BlankLoadScreen
This commit is contained in:
@@ -15,9 +15,6 @@ namespace OpenRA
|
|||||||
// Referenced from ModMetadata, so needs to be in OpenRA.Game :(
|
// Referenced from ModMetadata, so needs to be in OpenRA.Game :(
|
||||||
public class ContentInstaller : IGlobalModData
|
public class ContentInstaller : IGlobalModData
|
||||||
{
|
{
|
||||||
public readonly string MenuWidget = null;
|
|
||||||
public readonly string MusicMenuWidget = null;
|
|
||||||
public readonly string BackgroundWidget = null;
|
|
||||||
public readonly string[] TestFiles = { };
|
public readonly string[] TestFiles = { };
|
||||||
public readonly string[] DiskTestFiles = { };
|
public readonly string[] DiskTestFiles = { };
|
||||||
public readonly string PackageToExtractFromCD = null;
|
public readonly string PackageToExtractFromCD = null;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
using OpenRA.FileSystem;
|
using OpenRA.FileSystem;
|
||||||
@@ -40,27 +41,13 @@ namespace OpenRA.Mods.Common.LoadScreens
|
|||||||
Ui.ResetAll();
|
Ui.ResetAll();
|
||||||
Game.Settings.Save();
|
Game.Settings.Save();
|
||||||
|
|
||||||
// Check whether the mod content is installed
|
|
||||||
// TODO: The installation code has finally been beaten into shape, so we can
|
|
||||||
// finally move it all into the planned "Manage Content" panel in the modchooser mod.
|
|
||||||
var installData = Game.ModData.Manifest.Get<ContentInstaller>();
|
var installData = Game.ModData.Manifest.Get<ContentInstaller>();
|
||||||
var installModContent = !installData.TestFiles.All(f => GlobalFileSystem.Exists(f));
|
var isModContentInstalled = installData.TestFiles.All(f => GlobalFileSystem.Exists(Path.GetFileName(f)));
|
||||||
var installModMusic = args != null && args.Contains("Install.Music");
|
|
||||||
|
|
||||||
if (installModContent || installModMusic)
|
// Mod assets are missing!
|
||||||
|
if (!isModContentInstalled)
|
||||||
{
|
{
|
||||||
var widgetArgs = new WidgetArgs()
|
Game.InitializeMod("modchooser", new Arguments());
|
||||||
{
|
|
||||||
{ "continueLoading", () => Game.RunAfterTick(() =>
|
|
||||||
Game.InitializeMod(Game.Settings.Game.Mod, args)) },
|
|
||||||
};
|
|
||||||
|
|
||||||
if (installData.BackgroundWidget != null)
|
|
||||||
Ui.LoadWidget(installData.BackgroundWidget, Ui.Root, widgetArgs);
|
|
||||||
|
|
||||||
var menu = installModContent ? installData.MenuWidget : installData.MusicMenuWidget;
|
|
||||||
Ui.OpenWindow(menu, widgetArgs);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user