Don’t export certain Init types.
This commit is contained in:
@@ -15,6 +15,8 @@ using OpenRA.Primitives;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
public interface ISuppressInitExport { }
|
||||
|
||||
public class ActorReference : IEnumerable
|
||||
{
|
||||
public string Type;
|
||||
@@ -51,6 +53,9 @@ namespace OpenRA
|
||||
var ret = new MiniYaml(Type);
|
||||
foreach (var init in InitDict)
|
||||
{
|
||||
if (init is ISuppressInitExport)
|
||||
continue;
|
||||
|
||||
var initName = init.GetType().Name;
|
||||
ret.Nodes.Add(new MiniYamlNode(initName.Substring(0, initName.Length - 4), FieldSaver.Save(init)));
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class HideBibPreviewInit : IActorInit<bool>
|
||||
public class HideBibPreviewInit : IActorInit<bool>, ISuppressInitExport
|
||||
{
|
||||
[FieldFromYamlKey] readonly bool value = true;
|
||||
public HideBibPreviewInit() { }
|
||||
|
||||
@@ -349,7 +349,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public interface INotifyPassengerEntered { void PassengerEntered(Actor self, Actor passenger); }
|
||||
public interface INotifyPassengerExited { void PassengerExited(Actor self, Actor passenger); }
|
||||
|
||||
public class RuntimeCargoInit : IActorInit<Actor[]>
|
||||
public class RuntimeCargoInit : IActorInit<Actor[]>, ISuppressInitExport
|
||||
{
|
||||
[FieldFromYamlKey]
|
||||
readonly Actor[] value = { };
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class RuntimeNeighbourInit : IActorInit<Dictionary<CPos, string[]>>
|
||||
public class RuntimeNeighbourInit : IActorInit<Dictionary<CPos, string[]>>, ISuppressInitExport
|
||||
{
|
||||
[FieldFromYamlKey] readonly Dictionary<CPos, string[]> value = null;
|
||||
public RuntimeNeighbourInit() { }
|
||||
|
||||
@@ -41,5 +41,5 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class SkipMakeAnimsInit : IActorInit { }
|
||||
public class SkipMakeAnimsInit : IActorInit, ISuppressInitExport { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user