29 lines
917 B
C#
29 lines
917 B
C#
|
|
using Content.Shared.Mindshield.Components;
|
||
|
|
using Content.Shared.Overlays;
|
||
|
|
using Content.Shared.StatusIcon;
|
||
|
|
using Content.Shared.StatusIcon.Components;
|
||
|
|
using Robust.Shared.Prototypes;
|
||
|
|
|
||
|
|
namespace Content.Client.Overlays;
|
||
|
|
|
||
|
|
public sealed class ShowMindShieldIconsSystem : EquipmentHudSystem<ShowMindShieldIconsComponent>
|
||
|
|
{
|
||
|
|
[Dependency] private readonly IPrototypeManager _prototype = default!;
|
||
|
|
|
||
|
|
public override void Initialize()
|
||
|
|
{
|
||
|
|
base.Initialize();
|
||
|
|
|
||
|
|
SubscribeLocalEvent<MindShieldComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void OnGetStatusIconsEvent(EntityUid uid, MindShieldComponent component, ref GetStatusIconsEvent ev)
|
||
|
|
{
|
||
|
|
if (!IsActive || ev.InContainer)
|
||
|
|
return;
|
||
|
|
|
||
|
|
if (_prototype.TryIndex<StatusIconPrototype>(component.MindShieldStatusIcon.Id, out var iconPrototype))
|
||
|
|
ev.StatusIcons.Add(iconPrototype);
|
||
|
|
}
|
||
|
|
}
|