forked from wylab/wylab-station-14
2e1b486e8b
5 lines of eaten iocmanager.injectdependencies led to this.
29 lines
902 B
C#
29 lines
902 B
C#
using System.Numerics;
|
|
using Content.Client.UserInterface.Systems;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
namespace Content.Client.UserInterface.Controls
|
|
{
|
|
public sealed class ProgressTextureRect : TextureRect
|
|
{
|
|
public float Progress;
|
|
|
|
private readonly ProgressColorSystem _progressColor;
|
|
|
|
public ProgressTextureRect()
|
|
{
|
|
_progressColor = IoCManager.Resolve<IEntityManager>().System<ProgressColorSystem>();
|
|
}
|
|
|
|
protected override void Draw(DrawingHandleScreen handle)
|
|
{
|
|
var dims = Texture != null ? GetDrawDimensions(Texture) : UIBox2.FromDimensions(Vector2.Zero, PixelSize);
|
|
dims.Top = Math.Max(dims.Bottom - dims.Bottom * Progress,0);
|
|
handle.DrawRect(dims, _progressColor.GetProgressColor(Progress));
|
|
|
|
base.Draw(handle);
|
|
}
|
|
}
|
|
}
|