2021-03-09 04:33:41 -06:00
|
|
|
using Robust.Client.Graphics;
|
2021-01-24 08:17:45 +00:00
|
|
|
using Robust.Client.Player;
|
2021-03-09 04:33:41 -06:00
|
|
|
using Robust.Shared.Enums;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
using Robust.Shared.Maths;
|
|
|
|
|
using Robust.Shared.Prototypes;
|
2018-12-13 07:47:19 -06:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Client.MobState.Overlays
|
2018-12-13 07:47:19 -06:00
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class CircleMaskOverlay : Overlay
|
2018-12-13 07:47:19 -06:00
|
|
|
{
|
2020-08-24 14:10:28 +02:00
|
|
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
2021-01-24 08:17:45 +00:00
|
|
|
[Dependency] private readonly IPlayerManager _playerManager = 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
|
|
|
|
2021-03-09 04:33:41 -06:00
|
|
|
public CircleMaskOverlay()
|
2018-12-13 07:47:19 -06:00
|
|
|
{
|
|
|
|
|
IoCManager.InjectDependencies(this);
|
2020-07-31 14:01:34 -07:00
|
|
|
_shader = _prototypeManager.Index<ShaderPrototype>("CircleMask").Instance();
|
2018-12-13 07:47:19 -06:00
|
|
|
}
|
|
|
|
|
|
2021-04-19 09:52:40 +02:00
|
|
|
protected override void Draw(in OverlayDrawArgs args)
|
2018-12-13 07:47:19 -06:00
|
|
|
{
|
2021-03-09 04:33:41 -06:00
|
|
|
if (!CritOverlay.LocalPlayerHasState(_playerManager, false, true))
|
2021-01-24 08:17:45 +00:00
|
|
|
return;
|
2021-04-19 09:52:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
var worldHandle = args.WorldHandle;
|
|
|
|
|
worldHandle.UseShader(_shader);
|
2021-12-10 05:47:21 +00:00
|
|
|
var viewport = args.WorldAABB;
|
2018-12-13 07:47:19 -06:00
|
|
|
worldHandle.DrawRect(viewport, Color.White);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|