Added: LocalAssemblies / LocalRules to Manifest.cs (can be used to add a custom set of rules / assemblies to be loaded, other than the ones defined in the mod)
This commit is contained in:
@@ -21,7 +21,8 @@ namespace OpenRA.FileFormats
|
||||
Mods, Folders, Packages, Rules,
|
||||
Sequences, Cursors, Chrome, Assemblies, ChromeLayout,
|
||||
Weapons, Voices, Music, Movies, TileSets;
|
||||
|
||||
public string[] LocalRules = new string[0];
|
||||
public string[] LocalAssemblies = new string[0];
|
||||
public readonly string ShellmapUid, LoadScreen;
|
||||
public readonly int TileSize = 24;
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ namespace OpenRA
|
||||
|
||||
public static void LoadRules(Manifest m, Map map)
|
||||
{
|
||||
Info = LoadYamlRules(m.Rules, map.Rules, (k, y) => new ActorInfo(k.Key.ToLowerInvariant(), k.Value, y));
|
||||
// Added support to extend the list of rules (add it to m.LocalRules)
|
||||
// Should only be used to add ITraitNoSync traits! (otherwise BOOM)
|
||||
Info = LoadYamlRules(m.Rules.Concat(m.LocalRules).ToArray(), map.Rules, (k, y) => new ActorInfo(k.Key.ToLowerInvariant(), k.Value, y));
|
||||
Weapons = LoadYamlRules(m.Weapons, new List<MiniYamlNode>(), (k, _) => new WeaponInfo(k.Key.ToLowerInvariant(), k.Value));
|
||||
Voices = LoadYamlRules(m.Voices, new List<MiniYamlNode>(), (k, _) => new VoiceInfo(k.Value));
|
||||
Music = LoadYamlRules(m.Music, new List<MiniYamlNode>(), (k, _) => new MusicInfo(k.Key, k.Value));
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA
|
||||
.ToList();
|
||||
|
||||
// Namespaces from each mod assembly
|
||||
foreach (var a in manifest.Assemblies)
|
||||
foreach (var a in manifest.Assemblies.Concat(manifest.LocalAssemblies))
|
||||
{
|
||||
var asm = Assembly.LoadFile(Path.GetFullPath(a));
|
||||
asms.AddRange(asm.GetNamespaces().Select(ns => Pair.New(asm, ns)));
|
||||
|
||||
Reference in New Issue
Block a user