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

@@ -12,6 +12,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.FileSystem;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic
@@ -28,13 +29,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
bool discAvailable;
[ObjectCreator.UseCtor]
public ModContentLogic(Widget widget, Manifest mod, ModContent content, Action onCancel)
public ModContentLogic(Widget widget, ModData modData, Manifest mod, ModContent content, Action onCancel)
{
this.content = content;
var panel = widget.Get("CONTENT_PANEL");
var modFileSystem = new FileSystem.FileSystem(Game.Mods);
var modObjectCreator = new ObjectCreator(mod, Game.Mods);
var modPackageLoaders = modObjectCreator.GetLoaders<IPackageLoader>(mod.PackageFormats, "package");
var modFileSystem = new FileSystem.FileSystem(Game.Mods, modPackageLoaders);
modFileSystem.LoadFromManifest(mod);
var sourceYaml = MiniYaml.Load(modFileSystem, content.Sources, null);