перенос файлов клиента из папки White в _White
This commit is contained in:
37
Content.Client/_White/Overlays/SaturationScaleOverlay.cs
Normal file
37
Content.Client/_White/Overlays/SaturationScaleOverlay.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client._White.Overlays;
|
||||
|
||||
public sealed class SaturationScaleOverlay : Overlay
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
public override bool RequestScreenTexture => true;
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpace;
|
||||
private readonly ShaderInstance _shader;
|
||||
private const float Saturation = 0.5f;
|
||||
|
||||
public SaturationScaleOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_shader = _prototypeManager.Index<ShaderPrototype>("SaturationScale").InstanceUnique();
|
||||
}
|
||||
|
||||
|
||||
protected override void Draw(in OverlayDrawArgs args)
|
||||
{
|
||||
if (ScreenTexture == null)
|
||||
return;
|
||||
|
||||
_shader.SetParameter("SCREEN_TEXTURE", ScreenTexture);
|
||||
_shader.SetParameter("saturation", Saturation);
|
||||
|
||||
var handle = args.WorldHandle;
|
||||
|
||||
handle.UseShader(_shader);
|
||||
handle.DrawRect(args.WorldBounds, Color.White);
|
||||
handle.UseShader(null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user