diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 4fbdae0ae0..53799a1de7 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -366,7 +366,7 @@ - + diff --git a/OpenRA.Mods.Common/Traits/PaletteEffects/WaterPaletteRotation.cs b/OpenRA.Mods.Common/Traits/PaletteEffects/RotationPaletteEffect.cs similarity index 81% rename from OpenRA.Mods.Common/Traits/PaletteEffects/WaterPaletteRotation.cs rename to OpenRA.Mods.Common/Traits/PaletteEffects/RotationPaletteEffect.cs index 9366e12dc4..8a343594e1 100644 --- a/OpenRA.Mods.Common/Traits/PaletteEffects/WaterPaletteRotation.cs +++ b/OpenRA.Mods.Common/Traits/PaletteEffects/RotationPaletteEffect.cs @@ -16,7 +16,7 @@ using OpenRA.Traits; namespace OpenRA.Mods.Common.Traits { [Desc("Palette effect used for sprinkle \"animations\".")] - class WaterPaletteRotationInfo : ITraitInfo + class RotationPaletteEffectInfo : ITraitInfo { [Desc("Defines which palettes should be excluded from this effect.")] public readonly HashSet ExcludePalettes = new HashSet(); @@ -33,22 +33,23 @@ namespace OpenRA.Mods.Common.Traits [Desc("Step towards next color index per tick.")] public readonly float RotationStep = .25f; - public object Create(ActorInitializer init) { return new WaterPaletteRotation(init.World, this); } + public object Create(ActorInitializer init) { return new RotationPaletteEffect(init.World, this); } } - class WaterPaletteRotation : ITick, IPaletteModifier + class RotationPaletteEffect : ITick, IPaletteModifier { - readonly WaterPaletteRotationInfo info; + readonly RotationPaletteEffectInfo info; readonly World world; float t = 0; uint[] temp; - public WaterPaletteRotation(World world, WaterPaletteRotationInfo info) + public RotationPaletteEffect(World world, RotationPaletteEffectInfo info) { this.world = world; this.info = info; - temp = new uint[info.RotationRange]; /* allocating this on the fly actually hurts our profile */ + // Allocating this on the fly actually hurts our profile + temp = new uint[info.RotationRange]; } public void Tick(Actor self) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 7138902dc0..b6b42cecfd 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -2051,6 +2051,13 @@ namespace OpenRA.Mods.Common.UtilityCommands } } + // WaterPaletteRotation renamed to RotationPaletteEffect + if (engineVersion < 20150903) + { + if (depth == 1 && node.Key == "WaterPaletteRotation") + node.Key = "RotationPaletteEffect"; + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/mods/cnc/rules/palettes.yaml b/mods/cnc/rules/palettes.yaml index 89827675e8..819c0ddfc2 100644 --- a/mods/cnc/rules/palettes.yaml +++ b/mods/cnc/rules/palettes.yaml @@ -72,7 +72,7 @@ MenuEffect: Desaturated CloakPaletteEffect: FlashPaletteEffect: - WaterPaletteRotation: + RotationPaletteEffect@water: ExcludePalettes: effect, chrome RotationBase: 32 diff --git a/mods/ra/rules/palettes.yaml b/mods/ra/rules/palettes.yaml index ce48348e28..a4a91689a8 100644 --- a/mods/ra/rules/palettes.yaml +++ b/mods/ra/rules/palettes.yaml @@ -67,13 +67,13 @@ RemapIndex: 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 PlayerHighlightPalette: MenuPaletteEffect: - WaterPaletteRotation@defaultwater: + RotationPaletteEffect@defaultwater: ExcludePalettes: chrome ExcludeTilesets: DESERT - WaterPaletteRotation@actorswater: + RotationPaletteEffect@actorswater: ExcludePalettes: chrome, terrain ExcludeTilesets: TEMPERAT, SNOW, INTERIOR - WaterPaletteRotation@desertwater: + RotationPaletteEffect@desertwater: ExcludePalettes: chrome, effect, player ExcludeTilesets: TEMPERAT, SNOW, INTERIOR RotationBase: 32