diff --git a/OpenRA.Mods.Common/FileSystem/ContentInstallerFileSystemLoader.cs b/OpenRA.Mods.Common/FileSystem/ContentInstallerFileSystemLoader.cs index c9c9310eeb..6ca45e7e64 100644 --- a/OpenRA.Mods.Common/FileSystem/ContentInstallerFileSystemLoader.cs +++ b/OpenRA.Mods.Common/FileSystem/ContentInstallerFileSystemLoader.cs @@ -13,23 +13,28 @@ using System.Collections.Generic; namespace OpenRA.Mods.Common.FileSystem { + [Desc("A file system that loads game assets installed by the user into their support directory.")] public class ContentInstallerFileSystemLoader : IFileSystemLoader, IFileSystemExternalContent { [FieldLoader.Require] + [Desc("Mod to use for content installation.")] public readonly string ContentInstallerMod = null; [FieldLoader.Require] - public readonly Dictionary Packages = null; + [Desc("A list of mod-provided packages. Anything required to display the initial load screen must be listed here.")] + public readonly Dictionary SystemPackages = null; + [Desc("A list of user-installed packages. If missing (and not marked as optional), these will trigger the content installer.")] public readonly Dictionary ContentPackages = null; - public readonly Dictionary ContentFiles = null; + [Desc("Files that aren't mounted as packages, but still need to trigger the content installer if missing.")] + public readonly Dictionary RequiredContentFiles = null; - bool contentAvailable = true; + bool isContentAvailable = true; public void Mount(OpenRA.FileSystem.FileSystem fileSystem, ObjectCreator objectCreator) { - foreach (var kv in Packages) + foreach (var kv in SystemPackages) fileSystem.Mount(kv.Key, kv.Value); if (ContentPackages != null) @@ -42,23 +47,23 @@ namespace OpenRA.Mods.Common.FileSystem } catch { - contentAvailable = false; + isContentAvailable = false; } } } - if (ContentFiles != null) - foreach (var kv in ContentFiles) + if (RequiredContentFiles != null) + foreach (var kv in RequiredContentFiles) if (!fileSystem.Exists(kv.Key)) - contentAvailable = false; + isContentAvailable = false; } bool IFileSystemExternalContent.InstallContentIfRequired(ModData modData) { - if (!contentAvailable) + if (!isContentAvailable) Game.InitializeMod(ContentInstallerMod, new Arguments()); - return !contentAvailable; + return !isContentAvailable; } } } diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index 896b27cfe5..325b07df1d 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -8,7 +8,7 @@ Metadata: PackageFormats: Mix FileSystem: ContentInstallerFileSystem - Packages: + SystemPackages: ^EngineDir $cnc: cnc ^EngineDir|mods/common: common @@ -30,6 +30,7 @@ FileSystem: ContentInstallerFileSystem ~content|scores-covertops.mix ~content|transit.mix ~content|general.mix + # Below are mod-provided (system) packages that need to be loaded after the content packages so they can override content assets. cnc|bits/snow.mix cnc|bits cnc|bits/jungle diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 9a45c7dee1..7584145fe9 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -8,7 +8,7 @@ Metadata: PackageFormats: D2kSoundResources FileSystem: ContentInstallerFileSystem - Packages: + SystemPackages: ^EngineDir $d2k: d2k ^EngineDir|mods/common: common @@ -21,8 +21,9 @@ FileSystem: ContentInstallerFileSystem content|GAMESFX ~content|Music ~content|Movies + # Below are mod-provided (system) packages that need to be loaded after the content packages so they can override content assets. d2k|bits - ContentFiles: + RequiredContentFiles: content|BLOXBASE.R16 content|BLOXBAT.R16 content|BLOXBGBS.R16 diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index e143a74fe7..5b3d330db3 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -8,7 +8,7 @@ Metadata: PackageFormats: Mix FileSystem: ContentInstallerFileSystem - Packages: + SystemPackages: ^EngineDir $ra: ra ^EngineDir|mods/common: common @@ -36,9 +36,10 @@ FileSystem: ContentInstallerFileSystem ~content|movies ~content|scores.mix ~content|general.mix + # Below are mod-provided (system) packages that need to be loaded after the content packages so they can override content assets. ra|bits ra|bits/desert - ContentFiles: + RequiredContentFiles: content|expand/chrotnk1.aud content|expand/fixit1.aud content|expand/jburn1.aud diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index ce81176a70..37e484d5a2 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -8,7 +8,7 @@ Metadata: PackageFormats: Mix FileSystem: ContentInstallerFileSystem - Packages: + SystemPackages: ^EngineDir $ts: ts ^EngineDir|mods/common: common @@ -38,6 +38,7 @@ FileSystem: ContentInstallerFileSystem content|firestorm/e01vox02.mix content|firestorm/ecache01.mix ~content|firestorm/scores01.mix + # Below are mod-provided (system) packages that need to be loaded after the content packages so they can override content assets. ts|bits ContentInstallerMod: ts-content