From 8a171bb452831887f656a8e5a8db24e9b884be50 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 20 Apr 2015 02:52:03 +1200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20export=20certain=20Init=20types?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenRA.Game/Map/ActorReference.cs | 5 +++++ OpenRA.Mods.Common/Traits/Buildings/Bib.cs | 2 +- OpenRA.Mods.Common/Traits/Cargo.cs | 2 +- OpenRA.Mods.Common/Traits/Render/RenderBuildingWall.cs | 2 +- OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenRA.Game/Map/ActorReference.cs b/OpenRA.Game/Map/ActorReference.cs index c5b59b89f2..192d1c5f16 100755 --- a/OpenRA.Game/Map/ActorReference.cs +++ b/OpenRA.Game/Map/ActorReference.cs @@ -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))); } diff --git a/OpenRA.Mods.Common/Traits/Buildings/Bib.cs b/OpenRA.Mods.Common/Traits/Buildings/Bib.cs index 65ddd9b056..8f71047021 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Bib.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Bib.cs @@ -117,7 +117,7 @@ namespace OpenRA.Mods.Common.Traits } } - public class HideBibPreviewInit : IActorInit + public class HideBibPreviewInit : IActorInit, ISuppressInitExport { [FieldFromYamlKey] readonly bool value = true; public HideBibPreviewInit() { } diff --git a/OpenRA.Mods.Common/Traits/Cargo.cs b/OpenRA.Mods.Common/Traits/Cargo.cs index c973075599..389d21162f 100644 --- a/OpenRA.Mods.Common/Traits/Cargo.cs +++ b/OpenRA.Mods.Common/Traits/Cargo.cs @@ -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 + public class RuntimeCargoInit : IActorInit, ISuppressInitExport { [FieldFromYamlKey] readonly Actor[] value = { }; diff --git a/OpenRA.Mods.Common/Traits/Render/RenderBuildingWall.cs b/OpenRA.Mods.Common/Traits/Render/RenderBuildingWall.cs index 7ed6d8868d..37315a130b 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderBuildingWall.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderBuildingWall.cs @@ -146,7 +146,7 @@ namespace OpenRA.Mods.Common.Traits } } - public class RuntimeNeighbourInit : IActorInit> + public class RuntimeNeighbourInit : IActorInit>, ISuppressInitExport { [FieldFromYamlKey] readonly Dictionary value = null; public RuntimeNeighbourInit() { } diff --git a/OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs b/OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs index 93cc375a42..cd653f15e4 100644 --- a/OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs +++ b/OpenRA.Mods.Common/Traits/World/SpawnMapActors.cs @@ -41,5 +41,5 @@ namespace OpenRA.Mods.Common.Traits } } - public class SkipMakeAnimsInit : IActorInit { } + public class SkipMakeAnimsInit : IActorInit, ISuppressInitExport { } }