make status icons unshaded (#18974)
This commit is contained in:
@@ -4,17 +4,21 @@ using Robust.Client.GameObjects;
|
|||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Shared.Enums;
|
using Robust.Shared.Enums;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Client.StatusIcon;
|
namespace Content.Client.StatusIcon;
|
||||||
|
|
||||||
public sealed class StatusIconOverlay : Overlay
|
public sealed class StatusIconOverlay : Overlay
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntityManager _entity = default!;
|
[Dependency] private readonly IEntityManager _entity = default!;
|
||||||
|
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||||||
|
|
||||||
private readonly SpriteSystem _sprite;
|
private readonly SpriteSystem _sprite;
|
||||||
private readonly TransformSystem _transform;
|
private readonly TransformSystem _transform;
|
||||||
private readonly StatusIconSystem _statusIcon;
|
private readonly StatusIconSystem _statusIcon;
|
||||||
|
|
||||||
|
private readonly ShaderInstance _shader;
|
||||||
|
|
||||||
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;
|
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;
|
||||||
|
|
||||||
internal StatusIconOverlay()
|
internal StatusIconOverlay()
|
||||||
@@ -24,6 +28,8 @@ public sealed class StatusIconOverlay : Overlay
|
|||||||
_sprite = _entity.System<SpriteSystem>();
|
_sprite = _entity.System<SpriteSystem>();
|
||||||
_transform = _entity.System<TransformSystem>();
|
_transform = _entity.System<TransformSystem>();
|
||||||
_statusIcon = _entity.System<StatusIconSystem>();
|
_statusIcon = _entity.System<StatusIconSystem>();
|
||||||
|
|
||||||
|
_shader = _prototype.Index<ShaderPrototype>("unshaded").Instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Draw(in OverlayDrawArgs args)
|
protected override void Draw(in OverlayDrawArgs args)
|
||||||
@@ -36,6 +42,8 @@ public sealed class StatusIconOverlay : Overlay
|
|||||||
var scaleMatrix = Matrix3.CreateScale(new Vector2(1, 1));
|
var scaleMatrix = Matrix3.CreateScale(new Vector2(1, 1));
|
||||||
var rotationMatrix = Matrix3.CreateRotation(-eyeRot);
|
var rotationMatrix = Matrix3.CreateRotation(-eyeRot);
|
||||||
|
|
||||||
|
handle.UseShader(_shader);
|
||||||
|
|
||||||
var query = _entity.AllEntityQueryEnumerator<StatusIconComponent, SpriteComponent, TransformComponent, MetaDataComponent>();
|
var query = _entity.AllEntityQueryEnumerator<StatusIconComponent, SpriteComponent, TransformComponent, MetaDataComponent>();
|
||||||
while (query.MoveNext(out var uid, out var comp, out var sprite, out var xform, out var meta))
|
while (query.MoveNext(out var uid, out var comp, out var sprite, out var xform, out var meta))
|
||||||
{
|
{
|
||||||
@@ -99,5 +107,7 @@ public sealed class StatusIconOverlay : Overlay
|
|||||||
handle.DrawTexture(texture, position);
|
handle.DrawTexture(texture, position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handle.UseShader(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user