From 7015a2e12f01387369eade5440e6aa3f329b8e38 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 21 Jan 2016 17:38:26 +0000 Subject: [PATCH] Loads mod assemblies via the virtual filesystem. --- OpenRA.Game/ModData.cs | 9 ++++----- mods/all/mod.yaml | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/OpenRA.Game/ModData.cs b/OpenRA.Game/ModData.cs index e6ad5fd73f..ff4cc1a363 100644 --- a/OpenRA.Game/ModData.cs +++ b/OpenRA.Game/ModData.cs @@ -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; diff --git a/mods/all/mod.yaml b/mods/all/mod.yaml index da73d59a2e..cd68ac6c3e 100644 --- a/mods/all/mod.yaml +++ b/mods/all/mod.yaml @@ -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