Add a toggle for colorblind friendly progress bar colors (#25318)
* Add a toggle for progress bar colors * yeah this thing * PJB review * optimization
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using System.Numerics;
|
||||
using Content.Client.DoAfter;
|
||||
using Content.Client.UserInterface.Systems;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
@@ -9,11 +9,13 @@ namespace Content.Client.UserInterface.Controls
|
||||
{
|
||||
public float Progress;
|
||||
|
||||
private readonly ProgressColorSystem _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, DoAfterOverlay.GetProgressColor(Progress));
|
||||
handle.DrawRect(dims, _progressColor.GetProgressColor(Progress));
|
||||
|
||||
base.Draw(handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user