- add: OldNeoInterface (#108)

* ebal

* setup gui

* AAAAAAAAAA EBLAN
This commit is contained in:
Valtos
2024-03-20 22:54:45 +03:00
committed by GitHub
parent 4a06c1509a
commit f6b107353a
178 changed files with 1370 additions and 696 deletions

View File

@@ -0,0 +1,52 @@
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Prototypes;
namespace Content.Client.MainMenu;
public sealed class BackgroundControl : TextureRect
{
[Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
private IRenderTexture? _buffer;
private readonly ShaderInstance _glitchShader;
public BackgroundControl()
{
IoCManager.InjectDependencies(this);
_glitchShader = _prototype.Index<ShaderPrototype>("Cyberglitch").Instance().Duplicate();
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_buffer?.Dispose();
}
protected override void Resized()
{
base.Resized();
_buffer?.Dispose();
_buffer = _clyde.CreateRenderTarget(PixelSize, RenderTargetColorFormat.Rgba8Srgb, default);
}
protected override void Draw(DrawingHandleScreen handle)
{
if (_buffer is null)
return;
handle.RenderInRenderTarget(_buffer, () =>
{
base.Draw(handle);
}, Color.Transparent);
handle.UseShader(_glitchShader);
handle.DrawTextureRect(_buffer.Texture, PixelSizeBox);
handle.UseShader(null);
}
}