Loads mod assemblies via the virtual filesystem.

This commit is contained in:
Paul Chote
2016-01-21 17:38:26 +00:00
parent 60e86f73d0
commit 7015a2e12f
2 changed files with 6 additions and 7 deletions

View File

@@ -41,11 +41,12 @@ namespace OpenRA
{
Languages = new string[0];
Manifest = new Manifest(mod);
ModFiles.LoadFromManifest(Manifest);
// Allow mods to load types from the core Game assembly, and any additional assemblies they specify.
var assemblies =
new[] { typeof(Game).Assembly }.Concat(
Manifest.Assemblies.Select(path => Assembly.LoadFrom(Platform.ResolvePath(path))));
var assemblies = new[] { typeof(Game).Assembly }
.Concat(Manifest.Assemblies.Select(path => Assembly.Load(ModFiles.Open(path).ReadAllBytes())))
.ToList();
ObjectCreator = new ObjectCreator(assemblies);
Manifest.LoadCustomData(ObjectCreator);
@@ -56,8 +57,6 @@ namespace OpenRA
LoadScreen.Display();
}
ModFiles.LoadFromManifest(Manifest);
WidgetLoader = new WidgetLoader(this);
RulesetCache = new RulesetCache(this);
RulesetCache.LoadingProgress += HandleLoadingProgress;

View File

@@ -7,7 +7,7 @@ Metadata:
RequiresMods:
Folders:
Packages:
.
Cursors:
@@ -17,7 +17,7 @@ Chrome:
Assemblies:
./mods/common/OpenRA.Mods.Common.dll
./mods/ra/OpenRA.Mods.RA.dll
d2k:OpenRA.Mods.D2k.dll
./mods/d2k/OpenRA.Mods.D2k.dll
./mods/cnc/OpenRA.Mods.Cnc.dll
./mods/ts/OpenRA.Mods.TS.dll