From c0fa025b745d80e7a586149e5d042fd49c751a5e Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 27 Mar 2015 17:33:32 +0000 Subject: [PATCH] Indicate current mouseover cell in TerrainGeometryOverlay. --- OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs b/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs index 6e0ab280db..5b18ea44f1 100644 --- a/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs +++ b/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs @@ -41,6 +41,7 @@ namespace OpenRA.Mods.Common.Traits var tileSet = wr.World.TileSet; var lr = Game.Renderer.WorldLineRenderer; var colors = wr.World.TileSet.HeightDebugColors; + var mouseCell = wr.Viewport.ViewToWorld(Viewport.LastMousePos).ToMPos(wr.World.Map); foreach (var uv in wr.Viewport.VisibleCells.MapCoords) { @@ -54,11 +55,16 @@ namespace OpenRA.Mods.Common.Traits var pos = map.CenterOfCell(uv.ToCPos(map)); var screen = corners.Select(c => wr.ScreenPxPosition(pos + c).ToFloat2()).ToArray(); + if (uv == mouseCell) + lr.LineWidth = 3; + for (var i = 0; i < 4; i++) { var j = (i + 1) % 4; lr.DrawLine(screen[i], screen[j], color[i], color[j]); } + + lr.LineWidth = 1; } } }