Renormalize line endings and fix copyright headers again.
This commit is contained in:
@@ -49,33 +49,33 @@ namespace OpenRA.Traits
|
||||
DrawControlGroup(wr, self, xy);
|
||||
DrawPips(wr, self, xY);
|
||||
DrawTags(wr, self, new float2(.5f * (bounds.Left + bounds.Right), bounds.Top));
|
||||
DrawUnitPath(self);
|
||||
DrawUnitPath(self);
|
||||
DrawExtraBars(self, xy, Xy);
|
||||
}
|
||||
|
||||
public void DrawRollover(WorldRenderer wr, Actor self)
|
||||
{
|
||||
}
|
||||
|
||||
public void DrawRollover(WorldRenderer wr, Actor self)
|
||||
{
|
||||
var bounds = self.GetBounds(false);
|
||||
|
||||
|
||||
var xy = new float2(bounds.Left, bounds.Top);
|
||||
var Xy = new float2(bounds.Right, bounds.Top);
|
||||
|
||||
DrawHealthBar(self, xy, Xy);
|
||||
DrawExtraBars(self, xy, Xy);
|
||||
}
|
||||
|
||||
void DrawExtraBars(Actor self, float2 xy, float2 Xy)
|
||||
{
|
||||
foreach (var extraBar in self.TraitsImplementing<ISelectionBar>())
|
||||
{
|
||||
var value = extraBar.GetValue();
|
||||
if (value != 0)
|
||||
{
|
||||
xy.Y += 4;
|
||||
Xy.Y += 4;
|
||||
DrawSelectionBar(self, xy, Xy, extraBar.GetValue(), extraBar.GetColor());
|
||||
}
|
||||
}
|
||||
|
||||
DrawHealthBar(self, xy, Xy);
|
||||
DrawExtraBars(self, xy, Xy);
|
||||
}
|
||||
|
||||
void DrawExtraBars(Actor self, float2 xy, float2 Xy)
|
||||
{
|
||||
foreach (var extraBar in self.TraitsImplementing<ISelectionBar>())
|
||||
{
|
||||
var value = extraBar.GetValue();
|
||||
if (value != 0)
|
||||
{
|
||||
xy.Y += 4;
|
||||
Xy.Y += 4;
|
||||
DrawSelectionBar(self, xy, Xy, extraBar.GetValue(), extraBar.GetColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DrawSelectionBox(Actor self, float2 xy, float2 Xy, float2 xY, float2 XY, Color c)
|
||||
@@ -89,29 +89,29 @@ namespace OpenRA.Traits
|
||||
Game.Renderer.LineRenderer.DrawLine(xY, xY + new float2(0, -4), c, c);
|
||||
Game.Renderer.LineRenderer.DrawLine(XY, XY + new float2(-4, 0), c, c);
|
||||
Game.Renderer.LineRenderer.DrawLine(XY, XY + new float2(0, -4), c, c);
|
||||
}
|
||||
|
||||
void DrawSelectionBar(Actor self, float2 xy, float2 Xy, float value, Color barColor)
|
||||
{
|
||||
if (!self.IsInWorld) return;
|
||||
|
||||
var health = self.TraitOrDefault<Health>();
|
||||
if (health == null || health.IsDead) return;
|
||||
|
||||
var c = Color.FromArgb(128, 30, 30, 30);
|
||||
var c2 = Color.FromArgb(128, 10, 10, 10);
|
||||
|
||||
var barColor2 = Color.FromArgb(255, barColor.R / 2, barColor.G / 2, barColor.B / 2);
|
||||
|
||||
var z = float2.Lerp(xy, Xy, value);
|
||||
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -4), Xy + new float2(0, -4), c, c);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -3), Xy + new float2(0, -3), c2, c2);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -2), Xy + new float2(0, -2), c, c);
|
||||
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -3), z + new float2(0, -3), barColor, barColor);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -2), z + new float2(0, -2), barColor2, barColor2);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -4), z + new float2(0, -4), barColor2, barColor2);
|
||||
}
|
||||
|
||||
void DrawSelectionBar(Actor self, float2 xy, float2 Xy, float value, Color barColor)
|
||||
{
|
||||
if (!self.IsInWorld) return;
|
||||
|
||||
var health = self.TraitOrDefault<Health>();
|
||||
if (health == null || health.IsDead) return;
|
||||
|
||||
var c = Color.FromArgb(128, 30, 30, 30);
|
||||
var c2 = Color.FromArgb(128, 10, 10, 10);
|
||||
|
||||
var barColor2 = Color.FromArgb(255, barColor.R / 2, barColor.G / 2, barColor.B / 2);
|
||||
|
||||
var z = float2.Lerp(xy, Xy, value);
|
||||
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -4), Xy + new float2(0, -4), c, c);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -3), Xy + new float2(0, -3), c2, c2);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -2), Xy + new float2(0, -2), c, c);
|
||||
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -3), z + new float2(0, -3), barColor, barColor);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -2), z + new float2(0, -2), barColor2, barColor2);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -4), z + new float2(0, -4), barColor2, barColor2);
|
||||
}
|
||||
|
||||
void DrawHealthBar(Actor self, float2 xy, float2 Xy)
|
||||
@@ -121,7 +121,7 @@ namespace OpenRA.Traits
|
||||
var health = self.TraitOrDefault<Health>();
|
||||
if (health == null || health.IsDead) return;
|
||||
|
||||
var c = Color.FromArgb(128, 30, 30, 30);
|
||||
var c = Color.FromArgb(128, 30, 30, 30);
|
||||
var c2 = Color.FromArgb(128, 10, 10, 10);
|
||||
|
||||
var healthColor = (health.DamageState == DamageState.Critical) ? Color.Red :
|
||||
@@ -133,30 +133,30 @@ namespace OpenRA.Traits
|
||||
healthColor.G / 2,
|
||||
healthColor.B / 2);
|
||||
|
||||
var z = float2.Lerp(xy, Xy, health.HPFraction);
|
||||
|
||||
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -4), Xy + new float2(0, -4), c, c);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -3), Xy + new float2(0, -3), c2, c2);
|
||||
var z = float2.Lerp(xy, Xy, health.HPFraction);
|
||||
|
||||
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -4), Xy + new float2(0, -4), c, c);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -3), Xy + new float2(0, -3), c2, c2);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -2), Xy + new float2(0, -2), c, c);
|
||||
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -3), z + new float2(0, -3), healthColor, healthColor);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -2), z + new float2(0, -2), healthColor2, healthColor2);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -4), z + new float2(0, -4), healthColor2, healthColor2);
|
||||
|
||||
if (health.DisplayHp != health.HP)
|
||||
{
|
||||
var deltaColor = Color.OrangeRed;
|
||||
var deltaColor2 = Color.FromArgb(
|
||||
255,
|
||||
deltaColor.R / 2,
|
||||
deltaColor.G / 2,
|
||||
deltaColor.B / 2);
|
||||
var zz = float2.Lerp(xy, Xy, (float)health.DisplayHp / health.MaxHP);
|
||||
|
||||
Game.Renderer.LineRenderer.DrawLine(z + new float2(0, -3), zz + new float2(0, -3), deltaColor, deltaColor);
|
||||
Game.Renderer.LineRenderer.DrawLine(z + new float2(0, -2), zz + new float2(0, -2), deltaColor2, deltaColor2);
|
||||
Game.Renderer.LineRenderer.DrawLine(z + new float2(0, -4), zz + new float2(0, -4), deltaColor2, deltaColor2);
|
||||
Game.Renderer.LineRenderer.DrawLine(xy + new float2(0, -4), z + new float2(0, -4), healthColor2, healthColor2);
|
||||
|
||||
if (health.DisplayHp != health.HP)
|
||||
{
|
||||
var deltaColor = Color.OrangeRed;
|
||||
var deltaColor2 = Color.FromArgb(
|
||||
255,
|
||||
deltaColor.R / 2,
|
||||
deltaColor.G / 2,
|
||||
deltaColor.B / 2);
|
||||
var zz = float2.Lerp(xy, Xy, (float)health.DisplayHp / health.MaxHP);
|
||||
|
||||
Game.Renderer.LineRenderer.DrawLine(z + new float2(0, -3), zz + new float2(0, -3), deltaColor, deltaColor);
|
||||
Game.Renderer.LineRenderer.DrawLine(z + new float2(0, -2), zz + new float2(0, -2), deltaColor2, deltaColor2);
|
||||
Game.Renderer.LineRenderer.DrawLine(z + new float2(0, -4), zz + new float2(0, -4), deltaColor2, deltaColor2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user