2020-07-06 16:37:39 -05:00
|
|
|
|
using Content.Shared.GameObjects.Components.Mobs;
|
|
|
|
|
|
using Robust.Client.Graphics.Drawing;
|
2019-04-15 21:11:38 -06:00
|
|
|
|
using Robust.Client.Graphics.Overlays;
|
|
|
|
|
|
using Robust.Client.Graphics.Shaders;
|
|
|
|
|
|
using Robust.Client.Interfaces.Graphics.ClientEye;
|
|
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
using Robust.Shared.Maths;
|
|
|
|
|
|
using Robust.Shared.Prototypes;
|
2018-12-13 07:47:19 -06:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.Graphics.Overlays
|
|
|
|
|
|
{
|
2020-07-06 16:37:39 -05:00
|
|
|
|
public class GradientCircleMaskOverlay : Overlay
|
2018-12-13 07:47:19 -06:00
|
|
|
|
{
|
2020-08-24 14:10:28 +02:00
|
|
|
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
|
|
|
|
|
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
|
|
|
|
|
|
2018-12-13 07:47:19 -06:00
|
|
|
|
public override OverlaySpace Space => OverlaySpace.WorldSpace;
|
2020-07-31 14:01:34 -07:00
|
|
|
|
private readonly ShaderInstance _shader;
|
2018-12-13 07:47:19 -06:00
|
|
|
|
|
2020-07-19 10:32:26 -05:00
|
|
|
|
public GradientCircleMaskOverlay() : base(nameof(SharedOverlayID.GradientCircleMaskOverlay))
|
2018-12-13 07:47:19 -06:00
|
|
|
|
{
|
|
|
|
|
|
IoCManager.InjectDependencies(this);
|
2020-07-31 14:01:34 -07:00
|
|
|
|
_shader = _prototypeManager.Index<ShaderPrototype>("GradientCircleMask").Instance();
|
2018-12-13 07:47:19 -06:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-07-31 14:01:34 -07:00
|
|
|
|
protected override void Draw(DrawingHandleBase handle, OverlaySpace currentSpace)
|
2018-12-13 07:47:19 -06:00
|
|
|
|
{
|
2020-07-31 14:01:34 -07:00
|
|
|
|
handle.UseShader(_shader);
|
2018-12-13 07:47:19 -06:00
|
|
|
|
var worldHandle = (DrawingHandleWorld)handle;
|
|
|
|
|
|
var viewport = _eyeManager.GetWorldViewport();
|
|
|
|
|
|
worldHandle.DrawRect(viewport, Color.White);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|