Implement player stance colors
Adds an option to display actors on radar and support weapon timers in colors denoting the diplomatic stance toward the player.
This commit is contained in:
committed by
Oliver Brakmann
parent
ce8b03a276
commit
eb795909da
@@ -40,7 +40,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public IEnumerable<Pair<CPos, Color>> RadarSignatureCells(Actor self)
|
||||
{
|
||||
var color = modifier != null ? modifier.RadarColorOverride(self) : self.Owner.Color.RGB;
|
||||
var color = Game.Settings.Game.UsePlayerStanceColors ? self.Owner.PlayerStanceColor(self) : self.Owner.Color.RGB;
|
||||
if (modifier != null)
|
||||
color = modifier.RadarColorOverride(self, color);
|
||||
|
||||
if (info.UseLocation)
|
||||
return new[] { Pair.New(self.Location, color) };
|
||||
|
||||
@@ -156,12 +156,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
&& (self.CenterPosition - a.Actor.CenterPosition).LengthSquared <= a.Trait.Info.Range.LengthSquared);
|
||||
}
|
||||
|
||||
Color IRadarColorModifier.RadarColorOverride(Actor self)
|
||||
Color IRadarColorModifier.RadarColorOverride(Actor self, Color color)
|
||||
{
|
||||
var c = self.Owner.Color.RGB;
|
||||
if (self.Owner == self.World.LocalPlayer && Cloaked)
|
||||
c = Color.FromArgb(128, c);
|
||||
return c;
|
||||
color = Color.FromArgb(128, color);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
void GrantUpgrades(Actor self)
|
||||
|
||||
@@ -29,6 +29,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
public bool VisibleOnRadar(Actor self) { return true; }
|
||||
public Color RadarColorOverride(Actor self) { return c; }
|
||||
public Color RadarColorOverride(Actor self, Color color) { return c; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user