killed PrepareOverlay

This commit is contained in:
Chris Forbes
2009-10-31 23:24:39 +13:00
parent a3dba77f99
commit dbef9e4a45
7 changed files with 10 additions and 38 deletions

View File

@@ -39,11 +39,14 @@ namespace OpenRa.Game
for (var j = 0; j < 128; j++)
for (var i = 0; i < 128; i++)
if (Game.UnitInfluence.GetUnitAt(new int2(i, j)) != null)
spriteRenderer.DrawSprite(unitDebug, Game.CellSize * new float2(i, j), 0);
spriteRenderer.DrawSprite(unitDebug, Game.CellSize * new float2(i, j), 0);
var placeBuilding = Game.controller.orderGenerator as PlaceBuilding;
if (placeBuilding == null) return;
var position = Game.controller.MousePosition.ToInt2();
if (!hasOverlay) return;
var bi = (UnitInfo.BuildingInfo)Rules.UnitInfo[name];
var bi = (UnitInfo.BuildingInfo)Rules.UnitInfo[placeBuilding.Name];
var maxDistance = bi.Adjacent + 2; /* real-ra is weird. this is 1 GAP. */
var tooFarFromBase = !Footprint.Tiles(bi, position).Any(
@@ -56,21 +59,5 @@ namespace OpenRa.Game
spriteRenderer.Flush();
}
bool hasOverlay;
int2 position;
string name;
public void KillOverlay()
{
hasOverlay = false;
}
public void SetCurrentOverlay(int2 cell, string name)
{
hasOverlay = true;
position = cell;
this.name = name;
}
}
}