Change saturation of zone rectangles and outline weighted cells when zones visible

This commit is contained in:
Stone_Red
2026-05-05 02:49:35 +02:00
parent ab45029623
commit 2306b6e9f5
@@ -461,7 +461,8 @@ public class LargeGridPathfindingGame : Game
{ {
Color color = colorLookup[label % 28]; Color color = colorLookup[label % 28];
spriteBatch.FillRectangle(new Rectangle(rectangle.X * 10, rectangle.Y * 10, rectangle.Width * 10, rectangle.Height * 10), color, layerDepth: 0.2f); spriteBatch.FillRectangle(new Rectangle(rectangle.X * 10, rectangle.Y * 10, rectangle.Width * 10, rectangle.Height * 10), Color.Lerp(color, Color.Gray, 0.55f), layerDepth: 0.2f);
} }
} }
@@ -479,8 +480,16 @@ public class LargeGridPathfindingGame : Game
{ {
float blendFactor = Math.Clamp((cellWeight - 1) / 8f, 0f, 1f); float blendFactor = Math.Clamp((cellWeight - 1) / 8f, 0f, 1f);
Color weightColor = Color.Lerp(Color.LightYellow, Color.DarkOrange, blendFactor); Color weightColor = Color.Lerp(Color.LightYellow, Color.DarkOrange, blendFactor);
if (showZones)
{
spriteBatch.DrawRectangle(cellRect, weightColor * 0.75f, layerDepth: 0.25f);
}
else
{
spriteBatch.FillRectangle(cellRect, weightColor * 0.75f, layerDepth: 0.25f); spriteBatch.FillRectangle(cellRect, weightColor * 0.75f, layerDepth: 0.25f);
} }
}
if (cellValue < 0) if (cellValue < 0)
{ {