Files
crystall-punk-14/Content.Shared/Nutrition/EntitySystems/IngestionBlockerSystem.cs

20 lines
544 B
C#
Raw Normal View History

using Content.Shared.Clothing;
using Content.Shared.Nutrition.Components;
namespace Content.Shared.Nutrition.EntitySystems;
public sealed class IngestionBlockerSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<IngestionBlockerComponent, ItemMaskToggledEvent>(OnBlockerMaskToggled);
}
private void OnBlockerMaskToggled(Entity<IngestionBlockerComponent> ent, ref ItemMaskToggledEvent args)
{
ent.Comp.Enabled = !args.Mask.Comp.IsToggled;
}
}