mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using Content.Shared.Revolutionary.Components;
|
|
using Content.Shared.Revolutionary;
|
|
using Content.Shared.StatusIcon.Components;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Client.Revolutionary;
|
|
|
|
/// <summary>
|
|
/// Used for the client to get status icons from other revs.
|
|
/// </summary>
|
|
public sealed partial class RevolutionarySystem : SharedRevolutionarySystem
|
|
{
|
|
[Dependency] private IPrototypeManager _prototype = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<RevolutionaryComponent, GetStatusIconsEvent>(GetRevIcon);
|
|
SubscribeLocalEvent<HeadRevolutionaryComponent, GetStatusIconsEvent>(GetHeadRevIcon);
|
|
}
|
|
|
|
private void GetRevIcon(Entity<RevolutionaryComponent> ent, ref GetStatusIconsEvent args)
|
|
{
|
|
if (HasComp<HeadRevolutionaryComponent>(ent))
|
|
return;
|
|
|
|
if (_prototype.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
|
|
args.StatusIcons.Add(iconPrototype);
|
|
}
|
|
|
|
private void GetHeadRevIcon(Entity<HeadRevolutionaryComponent> ent, ref GetStatusIconsEvent args)
|
|
{
|
|
if (_prototype.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
|
|
args.StatusIcons.Add(iconPrototype);
|
|
}
|
|
}
|