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

View File

@@ -7,7 +7,7 @@ Metadata:
RequiresMods: RequiresMods:
Folders: Packages:
. .
Cursors: Cursors:
@@ -17,7 +17,7 @@ Chrome:
Assemblies: Assemblies:
./mods/common/OpenRA.Mods.Common.dll ./mods/common/OpenRA.Mods.Common.dll
./mods/ra/OpenRA.Mods.RA.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/cnc/OpenRA.Mods.Cnc.dll
./mods/ts/OpenRA.Mods.TS.dll ./mods/ts/OpenRA.Mods.TS.dll