using Content.Shared.Revolutionary.Components;
using Content.Shared.Revolutionary;
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Prototypes;
namespace Content.Client.Revolutionary;
///
/// Used for the client to get status icons from other revs.
///
public sealed class RevolutionarySystem : SharedRevolutionarySystem
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent(GetRevIcon);
SubscribeLocalEvent(GetHeadRevIcon);
}
private void GetRevIcon(Entity ent, ref GetStatusIconsEvent args)
{
if (HasComp(ent))
return;
if (_prototype.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
args.StatusIcons.Add(iconPrototype);
}
private void GetHeadRevIcon(Entity ent, ref GetStatusIconsEvent args)
{
if (_prototype.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
args.StatusIcons.Add(iconPrototype);
}
}