Implement mod-defined package loaders.

This commit is contained in:
Paul Chote
2017-05-07 12:25:04 +00:00
parent 9b4f602cca
commit 0222ea675c
26 changed files with 993 additions and 838 deletions

View File

@@ -13,7 +13,6 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using OpenRA.FileSystem;
using OpenRA.Graphics;
using OpenRA.Widgets;
@@ -27,6 +26,7 @@ namespace OpenRA
public readonly ObjectCreator ObjectCreator;
public readonly WidgetLoader WidgetLoader;
public readonly MapCache MapCache;
public readonly IPackageLoader[] PackageLoaders;
public readonly ISoundLoader[] SoundLoaders;
public readonly ISpriteLoader[] SpriteLoaders;
public readonly ISpriteSequenceLoader SpriteSequenceLoader;
@@ -49,12 +49,12 @@ namespace OpenRA
{
Languages = new string[0];
// Take a local copy of the manifest
Manifest = new Manifest(mod.Id, mod.Package);
ObjectCreator = new ObjectCreator(Manifest, mods);
PackageLoaders = ObjectCreator.GetLoaders<IPackageLoader>(Manifest.PackageFormats, "package");
ModFiles = new FS(mods);
ModFiles = new FS(mods, PackageLoaders);
ModFiles.LoadFromManifest(Manifest);
Manifest.LoadCustomData(ObjectCreator);