Move MaskComponent to shared and add toggle events (#22395)
* Move MaskComponent to shared and add toggle events * Datafield and network IsToggled * Add missing dirty
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using Content.Shared.Clothing;
|
||||
|
||||
namespace Content.Server.Nutrition.EntitySystems;
|
||||
|
||||
public sealed class IngestionBlockerSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<Components.IngestionBlockerComponent, ItemMaskToggledEvent>(OnBlockerMaskToggled);
|
||||
}
|
||||
|
||||
private void OnBlockerMaskToggled(Entity<Components.IngestionBlockerComponent> ent, ref ItemMaskToggledEvent args)
|
||||
{
|
||||
ent.Comp.Enabled = !args.IsToggled;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user