diff --git a/OpenRA.Mods.RA/LightPaletteRotator.cs b/OpenRA.Mods.RA/LightPaletteRotator.cs index ec2e166a3f..ba32a4f8d5 100644 --- a/OpenRA.Mods.RA/LightPaletteRotator.cs +++ b/OpenRA.Mods.RA/LightPaletteRotator.cs @@ -15,7 +15,13 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - class LightPaletteRotatorInfo : TraitInfo { } + class LightPaletteRotatorInfo : ITraitInfo + { + public readonly string[] ExcludePalettes = {}; + + public object Create(ActorInitializer init) { return new LightPaletteRotator(this); } + } + class LightPaletteRotator : ITick, IPaletteModifier { float t = 0; @@ -24,10 +30,20 @@ namespace OpenRA.Mods.RA t += .5f; } + readonly LightPaletteRotatorInfo info; + + public LightPaletteRotator(LightPaletteRotatorInfo info) + { + this.info = info; + } + public void AdjustPalette(Dictionary palettes) { foreach (var pal in palettes) { + if (info.ExcludePalettes.Contains(pal.Key)) + continue; + var rotate = (int)t % 18; if (rotate > 9) rotate = 18 - rotate; diff --git a/mods/ra/rules/system.yaml b/mods/ra/rules/system.yaml index e31a1b2b44..b2b0e2d5a5 100644 --- a/mods/ra/rules/system.yaml +++ b/mods/ra/rules/system.yaml @@ -511,9 +511,11 @@ World: ObserverWidget: OBSERVER_ROOT ScreenShaker: WaterPaletteRotation: + ExcludePalettes: player ChronoshiftPaletteEffect: NukePaletteEffect: LightPaletteRotator: + ExcludePalettes: terrain BuildingInfluence: ChooseBuildTabOnSelect: BridgeLayer: