Remove long dead ResourceBarStyle.Bevelled code.
This commit is contained in:
@@ -17,7 +17,6 @@ using OpenRA.Widgets;
|
||||
namespace OpenRA.Mods.Common.Widgets
|
||||
{
|
||||
public enum ResourceBarOrientation { Vertical, Horizontal }
|
||||
public enum ResourceBarStyle { Flat, Bevelled }
|
||||
public class ResourceBarWidget : Widget
|
||||
{
|
||||
public readonly string TooltipTemplate;
|
||||
@@ -26,7 +25,6 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
public string TooltipFormat = "";
|
||||
public ResourceBarOrientation Orientation = ResourceBarOrientation.Vertical;
|
||||
public ResourceBarStyle Style = ResourceBarStyle.Flat;
|
||||
public string IndicatorCollection = "sidebar-bits";
|
||||
public string IndicatorImage = "indicator";
|
||||
|
||||
@@ -77,31 +75,9 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
var color = GetBarColor();
|
||||
if (Orientation == ResourceBarOrientation.Vertical)
|
||||
{
|
||||
if (Style == ResourceBarStyle.Bevelled)
|
||||
{
|
||||
var colorDark = Exts.ColorLerp(0.25f, color, Color.Black);
|
||||
for (var i = 0; i < b.Height; i++)
|
||||
{
|
||||
color = (i - 1 < b.Height / 2) ? color : colorDark;
|
||||
var bottom = new float2(b.Left + i, b.Bottom);
|
||||
var top = new float2(b.Left + i, b.Bottom + providedFrac * b.Height);
|
||||
|
||||
// Indent corners
|
||||
if ((i == 0 || i == b.Width - 1) && providedFrac * b.Height > 1)
|
||||
{
|
||||
bottom.Y += 1;
|
||||
top.Y -= 1;
|
||||
}
|
||||
|
||||
Game.Renderer.RgbaColorRenderer.DrawLine(bottom, top, 1, color);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var tl = new float2(b.X, (int)float2.Lerp(b.Bottom, b.Top, providedFrac));
|
||||
var br = tl + new float2(b.Width, (int)(providedFrac * b.Height));
|
||||
Game.Renderer.RgbaColorRenderer.FillRect(tl, br, color);
|
||||
}
|
||||
var tl = new float2(b.X, (int)float2.Lerp(b.Bottom, b.Top, providedFrac));
|
||||
var br = tl + new float2(b.Width, (int)(providedFrac * b.Height));
|
||||
Game.Renderer.RgbaColorRenderer.FillRect(tl, br, color);
|
||||
|
||||
var x = (b.Left + b.Right - indicator.Size.X) / 2;
|
||||
var y = float2.Lerp(b.Bottom, b.Top, usedFrac) - indicator.Size.Y / 2;
|
||||
@@ -109,31 +85,9 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Style == ResourceBarStyle.Bevelled)
|
||||
{
|
||||
var colorDark = Exts.ColorLerp(0.25f, color, Color.Black);
|
||||
for (var i = 0; i < b.Height; i++)
|
||||
{
|
||||
color = (i - 1 < b.Height / 2) ? color : colorDark;
|
||||
var left = new float2(b.Left, b.Top + i);
|
||||
var right = new float2(b.Left + providedFrac * b.Width, b.Top + i);
|
||||
|
||||
// Indent corners
|
||||
if ((i == 0 || i == b.Height - 1) && providedFrac * b.Width > 1)
|
||||
{
|
||||
left.X += 1;
|
||||
right.X -= 1;
|
||||
}
|
||||
|
||||
Game.Renderer.RgbaColorRenderer.DrawLine(left, right, 1, color);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var tl = new float2(b.X, b.Y);
|
||||
var br = tl + new float2((int)(providedFrac * b.Width), b.Height);
|
||||
Game.Renderer.RgbaColorRenderer.FillRect(tl, br, color);
|
||||
}
|
||||
var tl = new float2(b.X, b.Y);
|
||||
var br = tl + new float2((int)(providedFrac * b.Width), b.Height);
|
||||
Game.Renderer.RgbaColorRenderer.FillRect(tl, br, color);
|
||||
|
||||
var x = float2.Lerp(b.Left, b.Right, usedFrac) - indicator.Size.X / 2;
|
||||
var y = (b.Bottom + b.Top - indicator.Size.Y) / 2;
|
||||
|
||||
Reference in New Issue
Block a user