Replace Map.CustomTerrain radar colors with IRadarTerrainLayer.
* TSVeinsRenderer now shows border cells on the radar * BuildableTerrainLayer now uses the radar colors defined on the individual tiles * CliffBackImpassabilityLayer no longer overrides the underlying terrain color.
This commit is contained in:
@@ -675,16 +675,10 @@ namespace OpenRA
|
||||
|
||||
public (Color Left, Color Right) GetTerrainColorPair(MPos uv)
|
||||
{
|
||||
Color left, right;
|
||||
var terrainInfo = Rules.TerrainInfo;
|
||||
var type = terrainInfo.GetTerrainInfo(Tiles[uv]);
|
||||
if (type.MinColor != type.MaxColor)
|
||||
{
|
||||
left = Exts.ColorLerp(Game.CosmeticRandom.NextFloat(), type.MinColor, type.MaxColor);
|
||||
right = Exts.ColorLerp(Game.CosmeticRandom.NextFloat(), type.MinColor, type.MaxColor);
|
||||
}
|
||||
else
|
||||
left = right = type.MinColor;
|
||||
var left = type.GetColor(Game.CosmeticRandom);
|
||||
var right = type.GetColor(Game.CosmeticRandom);
|
||||
|
||||
if (terrainInfo.MinHeightColorBrightness != 1.0f || terrainInfo.MaxHeightColorBrightness != 1.0f)
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.FileSystem;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Support;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA
|
||||
@@ -45,6 +46,14 @@ namespace OpenRA
|
||||
public readonly byte RampType;
|
||||
public readonly Color MinColor;
|
||||
public readonly Color MaxColor;
|
||||
|
||||
public Color GetColor(MersenneTwister random)
|
||||
{
|
||||
if (MinColor != MaxColor)
|
||||
return Exts.ColorLerp(random.NextFloat(), MinColor, MaxColor);
|
||||
|
||||
return MinColor;
|
||||
}
|
||||
}
|
||||
|
||||
public class TerrainTypeInfo
|
||||
|
||||
Reference in New Issue
Block a user