mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +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
27 lines
823 B
C#
27 lines
823 B
C#
using Content.Shared.Nutrition.EntitySystems;
|
|
using Content.Shared.Nutrition.Components;
|
|
using Content.Shared.Overlays;
|
|
using Content.Shared.StatusIcon.Components;
|
|
|
|
namespace Content.Client.Overlays;
|
|
|
|
public sealed partial class ShowHungerIconsSystem : EquipmentHudSystem<ShowHungerIconsComponent>
|
|
{
|
|
[Dependency] private HungerSystem _hunger = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<HungerComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
|
|
}
|
|
|
|
private void OnGetStatusIconsEvent(EntityUid uid, HungerComponent component, ref GetStatusIconsEvent ev)
|
|
{
|
|
if (!IsActive)
|
|
return;
|
|
|
|
if (_hunger.TryGetStatusIconPrototype(component, out var iconPrototype))
|
|
ev.StatusIcons.Add(iconPrototype);
|
|
}
|
|
}
|