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