Implement mod-defined package loaders.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
@@ -18,7 +19,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
public class ModContentPromptLogic : ChromeLogic
|
||||
{
|
||||
[ObjectCreator.UseCtor]
|
||||
public ModContentPromptLogic(Widget widget, Manifest mod, ModContent content, Action continueLoading)
|
||||
public ModContentPromptLogic(Widget widget, ModData modData, Manifest mod, ModContent content, Action continueLoading)
|
||||
{
|
||||
var panel = widget.Get("CONTENT_PROMPT_PANEL");
|
||||
|
||||
@@ -55,8 +56,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
quickButton.Bounds.Y += headerHeight;
|
||||
quickButton.OnClick = () =>
|
||||
{
|
||||
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 downloadYaml = MiniYaml.Load(modFileSystem, content.Downloads, null);
|
||||
modFileSystem.UnmountAll();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user