using Content.Shared.Access.Components; using Content.Shared.Access.Systems; using Content.Shared.NPC.Components; using Content.Shared.Overlays; using System.Linq; using Content.Shared.StatusIcon; using Content.Shared.StatusIcon.Components; using Robust.Shared.Prototypes; namespace Content.Client.Overlays; public sealed class ShowFactionIconsSystem : EquipmentHudSystem { [Dependency] private readonly IPrototypeManager _prototype = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnGetStatusIconsEvent); } private void OnGetStatusIconsEvent(EntityUid uid, ShowFactionIconsComponent component, ref GetStatusIconsEvent ev) { if (!IsActive) return; if (_prototype.TryIndex(component.FactionIcon, out var iconPrototype)) ev.StatusIcons.Add(iconPrototype); } } public sealed class ShowFrenchFactionIconsSystem : EquipmentHudSystem { [Dependency] private readonly IPrototypeManager _prototype = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnGetStatusIconsEvent); } private void OnGetStatusIconsEvent(EntityUid uid, ShowFrenchFactionIconsComponent component, ref GetStatusIconsEvent ev) { if (!IsActive) return; if (_prototype.TryIndex(component.FactionIcon, out var iconPrototype)) ev.StatusIcons.Add(iconPrototype); } } public sealed class ShowEnglishFactionIconsSystem : EquipmentHudSystem { [Dependency] private readonly IPrototypeManager _prototype = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnGetStatusIconsEvent); } private void OnGetStatusIconsEvent(EntityUid uid, ShowEnglishFactionIconsComponent component, ref GetStatusIconsEvent ev) { if (!IsActive) return; if (_prototype.TryIndex(component.FactionIcon, out var iconPrototype)) ev.StatusIcons.Add(iconPrototype); } }