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:
geckosoft
2010-11-01 04:07:05 +01:00
committed by Chris Forbes
parent 8392a44314
commit 3e08f9b1b1
3 changed files with 6 additions and 3 deletions

View File

@@ -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));