Validate ShaderPrototype IDs (#38728)

* Convert all shader prototype string literals to protoids in overlays

* Convert more shader prototype literal strings to protoids

* Convert ValidatePrototypeId to ProtoId

* Later
This commit is contained in:
Tayrtahn
2025-07-03 21:11:31 -04:00
committed by GitHub
parent fba22e831d
commit 9186b65b14
36 changed files with 130 additions and 68 deletions

View File

@@ -17,6 +17,10 @@ namespace Content.Client.Overlays;
/// </summary>
public sealed partial class StencilOverlay : Overlay
{
private static readonly ProtoId<ShaderPrototype> CircleShader = "WorldGradientCircle";
private static readonly ProtoId<ShaderPrototype> StencilMask = "StencilMask";
private static readonly ProtoId<ShaderPrototype> StencilDraw = "StencilDraw";
[Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IGameTiming _timing = default!;
@@ -43,7 +47,7 @@ public sealed partial class StencilOverlay : Overlay
_sprite = sprite;
_weather = weather;
IoCManager.InjectDependencies(this);
_shader = _protoManager.Index<ShaderPrototype>("WorldGradientCircle").InstanceUnique();
_shader = _protoManager.Index(CircleShader).InstanceUnique();
}
protected override void Draw(in OverlayDrawArgs args)