diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index 0fc72fe65b..7da3f24cfe 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -68,6 +68,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems SubscribeLocalEvent(HandleDestruction); // Verbs + SubscribeLocalEvent(AddInsertVerb); SubscribeLocalEvent(AddFlushEjectVerbs); SubscribeLocalEvent(AddClimbInsideVerb); @@ -122,6 +123,31 @@ namespace Content.Server.Disposal.Unit.EntitySystems args.Verbs.Add(verb); } + private void AddInsertVerb(EntityUid uid, DisposalUnitComponent component, GetInteractionVerbsEvent args) + { + if (!args.CanAccess || !args.CanInteract || args.Hands == null || args.Using == null) + return; + + if (!_actionBlockerSystem.CanDrop(args.User)) + return; + + if (!CanInsert(component, args.Using.Value)) + return; + + Verb insertVerb = new() + { + Text = Name(args.Using.Value), + Category = VerbCategory.Insert, + Act = () => + { + args.Hands.Drop(args.Using.Value, component.Container); + AfterInsert(component, args.Using.Value); + } + }; + + args.Verbs.Add(insertVerb); + } + private void DoInsertDisposalUnit(DoInsertDisposalUnitEvent ev) { var toInsert = ev.ToInsert;