fix RA Desert palette rotation regressions

This commit is contained in:
Matthias Mailänder
2013-03-23 13:18:15 +01:00
parent aa6f12f0a1
commit 3e63751960
2 changed files with 19 additions and 1 deletions

View File

@@ -15,7 +15,13 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA namespace OpenRA.Mods.RA
{ {
class LightPaletteRotatorInfo : TraitInfo<LightPaletteRotator> { } class LightPaletteRotatorInfo : ITraitInfo
{
public readonly string[] ExcludePalettes = {};
public object Create(ActorInitializer init) { return new LightPaletteRotator(this); }
}
class LightPaletteRotator : ITick, IPaletteModifier class LightPaletteRotator : ITick, IPaletteModifier
{ {
float t = 0; float t = 0;
@@ -24,10 +30,20 @@ namespace OpenRA.Mods.RA
t += .5f; t += .5f;
} }
readonly LightPaletteRotatorInfo info;
public LightPaletteRotator(LightPaletteRotatorInfo info)
{
this.info = info;
}
public void AdjustPalette(Dictionary<string,Palette> palettes) public void AdjustPalette(Dictionary<string,Palette> palettes)
{ {
foreach (var pal in palettes) foreach (var pal in palettes)
{ {
if (info.ExcludePalettes.Contains(pal.Key))
continue;
var rotate = (int)t % 18; var rotate = (int)t % 18;
if (rotate > 9) if (rotate > 9)
rotate = 18 - rotate; rotate = 18 - rotate;

View File

@@ -511,9 +511,11 @@ World:
ObserverWidget: OBSERVER_ROOT ObserverWidget: OBSERVER_ROOT
ScreenShaker: ScreenShaker:
WaterPaletteRotation: WaterPaletteRotation:
ExcludePalettes: player
ChronoshiftPaletteEffect: ChronoshiftPaletteEffect:
NukePaletteEffect: NukePaletteEffect:
LightPaletteRotator: LightPaletteRotator:
ExcludePalettes: terrain
BuildingInfluence: BuildingInfluence:
ChooseBuildTabOnSelect: ChooseBuildTabOnSelect:
BridgeLayer: BridgeLayer: