Fix map editor radar ignoring color from terrain
This commit is contained in:
committed by
Matthias Mailänder
parent
4fe7daa85e
commit
cb41be113a
@@ -19,17 +19,22 @@ namespace OpenRA.Mods.Common.Traits.Radar
|
||||
[FieldLoader.Require]
|
||||
public readonly string Terrain;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new RadarColorFromTerrain(init.Self, Terrain); }
|
||||
public Color GetColorFromTerrain(World world)
|
||||
{
|
||||
var tileSet = world.Map.Rules.TileSet;
|
||||
return tileSet[tileSet.GetTerrainIndex(Terrain)].Color;
|
||||
}
|
||||
|
||||
public override object Create(ActorInitializer init) { return new RadarColorFromTerrain(init.Self, this); }
|
||||
}
|
||||
|
||||
public class RadarColorFromTerrain : IRadarColorModifier
|
||||
{
|
||||
Color c;
|
||||
readonly Color c;
|
||||
|
||||
public RadarColorFromTerrain(Actor self, string terrain)
|
||||
public RadarColorFromTerrain(Actor self, RadarColorFromTerrainInfo info)
|
||||
{
|
||||
var tileSet = self.World.Map.Rules.TileSet;
|
||||
c = tileSet[tileSet.GetTerrainIndex(terrain)].Color;
|
||||
c = info.GetColorFromTerrain(self.World);
|
||||
}
|
||||
|
||||
public bool VisibleOnRadar(Actor self) { return true; }
|
||||
|
||||
Reference in New Issue
Block a user