ore is now in openra.game

This commit is contained in:
Chris Forbes
2009-11-04 22:51:17 +13:00
parent 7acd327896
commit 66fd532db8
10 changed files with 304 additions and 150 deletions

View File

@@ -57,9 +57,9 @@ namespace OpenRa.Game.Graphics
var location = new int2(x, y);
var sprites = overlaySprites[o];
var spriteIndex = 0;
if (Map.overlayIsFence[o]) spriteIndex = NearbyFences(x, y);
else if (Map.overlayIsOre[o]) spriteIndex = map.MapTiles[x,y].density;
else if (Map.overlayIsGems[o]) spriteIndex = map.MapTiles[x,y].density;
if (Ore.overlayIsFence[o]) spriteIndex = NearbyFences(x, y);
else if (Ore.overlayIsOre[o]) spriteIndex = map.MapTiles[x,y].density;
else if (Ore.overlayIsGems[o]) spriteIndex = map.MapTiles[x,y].density;
spriteRenderer.DrawSprite(sprites[spriteIndex],
Game.CellSize * (float2)location, 0);
}
@@ -71,8 +71,8 @@ namespace OpenRa.Game.Graphics
bool IsFence( int x, int y )
{
var o = map.MapTiles[ x, y ].overlay;
if (o < Map.overlayIsFence.Length)
return Map.overlayIsFence[o];
if (o < Ore.overlayIsFence.Length)
return Ore.overlayIsFence[o];
return false;
}

View File

@@ -106,9 +106,6 @@ namespace OpenRa.Game.Graphics
Game.OreTime * 1000), new int2(5, 5), Color.White);
}
const float conditionYellow = 0.5f; /* todo: get these from gamerules */
const float conditionRed = 0.25f;
void DrawSelectionBox(Actor selectedUnit, Color c, bool drawHealthBar)
{
var center = selectedUnit.CenterLocation;
@@ -136,8 +133,8 @@ namespace OpenRa.Game.Graphics
lineRenderer.DrawLine(Xy + new float2(0, -2), Xy + new float2(0, -4), c, c);
var healthAmount = (float)selectedUnit.Health / selectedUnit.unitInfo.Strength;
var healthColor = (healthAmount < conditionRed) ? Color.Red
: (healthAmount < conditionYellow) ? Color.Yellow
var healthColor = (healthAmount < Rules.General.ConditionRed) ? Color.Red
: (healthAmount < Rules.General.ConditionYellow) ? Color.Yellow
: Color.LimeGreen;
var healthColor2 = Color.FromArgb(