| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 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<ShowFactionIconsComponent>
- {
- [Dependency] private readonly IPrototypeManager _prototype = default!;
- public override void Initialize()
- {
- base.Initialize();
- SubscribeLocalEvent<ShowFactionIconsComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
- }
- private void OnGetStatusIconsEvent(EntityUid uid, ShowFactionIconsComponent component, ref GetStatusIconsEvent ev)
- {
- if (!IsActive)
- return;
- if (_prototype.TryIndex<FactionIconPrototype>(component.FactionIcon, out var iconPrototype))
- ev.StatusIcons.Add(iconPrototype);
- }
- }
- public sealed class ShowFrenchFactionIconsSystem : EquipmentHudSystem<ShowFrenchFactionIconsComponent>
- {
- [Dependency] private readonly IPrototypeManager _prototype = default!;
- public override void Initialize()
- {
- base.Initialize();
- SubscribeLocalEvent<ShowFrenchFactionIconsComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
- }
- private void OnGetStatusIconsEvent(EntityUid uid, ShowFrenchFactionIconsComponent component, ref GetStatusIconsEvent ev)
- {
- if (!IsActive)
- return;
- if (_prototype.TryIndex<FactionIconPrototype>(component.FactionIcon, out var iconPrototype))
- ev.StatusIcons.Add(iconPrototype);
- }
- }
- public sealed class ShowEnglishFactionIconsSystem : EquipmentHudSystem<ShowEnglishFactionIconsComponent>
- {
- [Dependency] private readonly IPrototypeManager _prototype = default!;
- public override void Initialize()
- {
- base.Initialize();
- SubscribeLocalEvent<ShowEnglishFactionIconsComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
- }
- private void OnGetStatusIconsEvent(EntityUid uid, ShowEnglishFactionIconsComponent component, ref GetStatusIconsEvent ev)
- {
- if (!IsActive)
- return;
- if (_prototype.TryIndex<FactionIconPrototype>(component.FactionIcon, out var iconPrototype))
- ev.StatusIcons.Add(iconPrototype);
- }
- }
|