tidy
This commit is contained in:
@@ -92,6 +92,8 @@ namespace OpenRa.Game.Graphics
|
|||||||
lineRenderer.Flush();
|
lineRenderer.Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static readonly string[] pipStrings = { "pip-empty", "pip-green", "pip-yellow", "pip-red", "pip-gray" };
|
||||||
|
|
||||||
public void DrawSelectionBox(Actor selectedUnit, Color c, bool drawHealthBar)
|
public void DrawSelectionBox(Actor selectedUnit, Color c, bool drawHealthBar)
|
||||||
{
|
{
|
||||||
var center = selectedUnit.CenterLocation;
|
var center = selectedUnit.CenterLocation;
|
||||||
@@ -155,28 +157,8 @@ namespace OpenRa.Game.Graphics
|
|||||||
{
|
{
|
||||||
foreach (var pip in pips.GetPips())
|
foreach (var pip in pips.GetPips())
|
||||||
{
|
{
|
||||||
Animation pipImages = new Animation("pips");
|
var pipImages = new Animation("pips");
|
||||||
|
pipImages.PlayRepeating(pipStrings[(int)pip]);
|
||||||
switch(pip)
|
|
||||||
{
|
|
||||||
case PipType.Transparent:
|
|
||||||
pipImages.PlayRepeating("pip-empty");
|
|
||||||
break;
|
|
||||||
case PipType.Green:
|
|
||||||
pipImages.PlayRepeating("pip-green");
|
|
||||||
break;
|
|
||||||
case PipType.Yellow:
|
|
||||||
pipImages.PlayRepeating("pip-yellow");
|
|
||||||
break;
|
|
||||||
case PipType.Red:
|
|
||||||
pipImages.PlayRepeating("pip-red");
|
|
||||||
break;
|
|
||||||
case PipType.Gray:
|
|
||||||
pipImages.PlayRepeating("pip-gray");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
spriteRenderer.DrawSprite(pipImages.Image, pipxyBase + pipxyOffset, 0);
|
spriteRenderer.DrawSprite(pipImages.Image, pipxyBase + pipxyOffset, 0);
|
||||||
pipxyOffset += new float2(4, 0);
|
pipxyOffset += new float2(4, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user