From 0bc087f7bd86dbba740c0aa1d12d2edf3f8bb05d Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 11 Nov 2016 20:16:33 +0000 Subject: [PATCH] Rename BridgeLayer to LegacyBridgeLayer. --- OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 2 +- OpenRA.Mods.Common/Traits/Buildings/Bridge.cs | 4 ++-- .../World/{BridgeLayer.cs => LegacyBridgeLayer.cs} | 10 +++++----- OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs | 4 ++++ mods/cnc/rules/world.yaml | 2 +- mods/ra/rules/world.yaml | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) rename OpenRA.Mods.Common/Traits/World/{BridgeLayer.cs => LegacyBridgeLayer.cs} (91%) diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 6b2b65d5be..733c0e2af3 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -503,7 +503,7 @@ - + diff --git a/OpenRA.Mods.Common/Traits/Buildings/Bridge.cs b/OpenRA.Mods.Common/Traits/Buildings/Bridge.cs index fcde0b6f0b..c586e7f8ed 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Bridge.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Bridge.cs @@ -135,7 +135,7 @@ namespace OpenRA.Mods.Common.Traits return tileSet.GetTerrainIndex(new TerrainTile(template, (byte)index)); } - public void LinkNeighbouringBridges(World world, BridgeLayer bridges) + public void LinkNeighbouringBridges(World world, LegacyBridgeLayer bridges) { for (var d = 0; d <= 1; d++) { @@ -171,7 +171,7 @@ namespace OpenRA.Mods.Common.Traits } public LegacyBridgeHut GetHut(int index) { return huts[index]; } - public Bridge GetNeighbor(int[] offset, BridgeLayer bridges) + public Bridge GetNeighbor(int[] offset, LegacyBridgeLayer bridges) { if (offset == null) return null; diff --git a/OpenRA.Mods.Common/Traits/World/BridgeLayer.cs b/OpenRA.Mods.Common/Traits/World/LegacyBridgeLayer.cs similarity index 91% rename from OpenRA.Mods.Common/Traits/World/BridgeLayer.cs rename to OpenRA.Mods.Common/Traits/World/LegacyBridgeLayer.cs index dfcac3caaf..e65742de0b 100644 --- a/OpenRA.Mods.Common/Traits/World/BridgeLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/LegacyBridgeLayer.cs @@ -17,22 +17,22 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { - class BridgeLayerInfo : ITraitInfo + class LegacyBridgeLayerInfo : ITraitInfo { [ActorReference] public readonly string[] Bridges = { "bridge1", "bridge2" }; - public object Create(ActorInitializer init) { return new BridgeLayer(init.Self, this); } + public object Create(ActorInitializer init) { return new LegacyBridgeLayer(init.Self, this); } } - class BridgeLayer : IWorldLoaded + class LegacyBridgeLayer : IWorldLoaded { - readonly BridgeLayerInfo info; + readonly LegacyBridgeLayerInfo info; readonly Dictionary> bridgeTypes = new Dictionary>(); CellLayer bridges; - public BridgeLayer(Actor self, BridgeLayerInfo info) + public LegacyBridgeLayer(Actor self, LegacyBridgeLayerInfo info) { this.info = info; } diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index ed928992d7..35d2495410 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -532,10 +532,14 @@ namespace OpenRA.Mods.Common.UtilityCommands } } + // Reworking bridge logic if (engineVersion < 20161210) { if (node.Key == "BridgeHut") RenameNodeKey(node, "LegacyBridgeHut"); + + if (node.Key == "BridgeLayer") + RenameNodeKey(node, "LegacyBridgeLayer"); } UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); diff --git a/mods/cnc/rules/world.yaml b/mods/cnc/rules/world.yaml index 85a0516be6..c9767972a4 100644 --- a/mods/cnc/rules/world.yaml +++ b/mods/cnc/rules/world.yaml @@ -58,7 +58,7 @@ World: HelpCommand: ScreenShaker: BuildingInfluence: - BridgeLayer: + LegacyBridgeLayer: Bridges: bridge1, bridge2, bridge3, bridge4 ProductionQueueFromSelection: ProductionTabsWidget: PRODUCTION_TABS diff --git a/mods/ra/rules/world.yaml b/mods/ra/rules/world.yaml index b8b4f374eb..8f6e232f0b 100644 --- a/mods/ra/rules/world.yaml +++ b/mods/ra/rules/world.yaml @@ -99,7 +99,7 @@ World: BuildingInfluence: ProductionQueueFromSelection: ProductionPaletteWidget: PRODUCTION_PALETTE - BridgeLayer: + LegacyBridgeLayer: Bridges: bridge1, bridge2, br1, br2, br3, sbridge1, sbridge2, sbridge3, sbridge4 CustomTerrainDebugOverlay: CrateSpawner: