Correct bridge / tree / mine color
This commit is contained in:
@@ -169,6 +169,10 @@ namespace OpenRA.Traits
|
||||
|
||||
public Color RadarSignatureColor(Actor self)
|
||||
{
|
||||
var mod = self.traits.WithInterface<IRadarSignatureModifier>().FirstOrDefault();
|
||||
if (mod != null)
|
||||
return mod.RadarColorOverride(self);
|
||||
|
||||
return self.Owner.Color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +61,11 @@ namespace OpenRA.Traits
|
||||
Color RadarSignatureColor(Actor self);
|
||||
}
|
||||
|
||||
public interface IRadarSignatureModifier
|
||||
{
|
||||
Color RadarColorOverride(Actor self);
|
||||
}
|
||||
|
||||
public interface IOccupySpace
|
||||
{
|
||||
int2 TopLeft { get; }
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
@@ -43,6 +44,10 @@ namespace OpenRA.Traits
|
||||
|
||||
public Color RadarSignatureColor(Actor self)
|
||||
{
|
||||
var mod = self.traits.WithInterface<IRadarSignatureModifier>().FirstOrDefault();
|
||||
if (mod != null)
|
||||
return mod.RadarColorOverride(self);
|
||||
|
||||
return self.Owner.Color;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user