Made all overlays compatible with the new Overlay changes in engine.

This commit is contained in:
Acruid
2020-07-31 14:01:34 -07:00
parent 7a983062a9
commit 86f74b35d1
7 changed files with 25 additions and 15 deletions

View File

@@ -26,11 +26,12 @@ namespace Content.Client.Parallax
private Texture _parallaxTexture;
public override OverlaySpace Space => OverlaySpace.ScreenSpaceBelowWorld;
private readonly ShaderInstance _shader;
public ParallaxOverlay() : base(nameof(ParallaxOverlay))
{
IoCManager.InjectDependencies(this);
Shader = _prototypeManager.Index<ShaderPrototype>("unshaded").Instance();
_shader = _prototypeManager.Index<ShaderPrototype>("unshaded").Instance();
if (_parallaxManager.ParallaxTexture == null)
{
@@ -42,13 +43,14 @@ namespace Content.Client.Parallax
}
}
protected override void Draw(DrawingHandleBase handle)
protected override void Draw(DrawingHandleBase handle, OverlaySpace currentSpace)
{
if (_parallaxTexture == null)
{
return;
}
handle.UseShader(_shader);
var screenHandle = (DrawingHandleScreen) handle;
var (sizeX, sizeY) = _parallaxTexture.Size;