Implement SmartFridge functionality (#38648)
* Add SmartFridge * my nit so pick * my access so expanded and my whitelist so both * list -> hashset
This commit is contained in:
committed by
GitHub
parent
99b431cafd
commit
d2ddbcbcda
@@ -19,6 +19,7 @@ using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Power;
|
||||
using Content.Shared.Power.EntitySystems;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Content.Shared.Throwing;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.Whitelist;
|
||||
@@ -90,6 +91,9 @@ public abstract class SharedDisposalUnitSystem : EntitySystem
|
||||
SubscribeLocalEvent<DisposalUnitComponent, AfterInteractUsingEvent>(OnAfterInteractUsing);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, DragDropTargetEvent>(OnDragDropOn);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, ContainerRelayMovementEntityEvent>(OnMovement);
|
||||
|
||||
SubscribeLocalEvent<DisposalUnitComponent, GetDumpableVerbEvent>(OnGetDumpableVerb);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, DumpEvent>(OnDump);
|
||||
}
|
||||
|
||||
private void AddDisposalAltVerbs(Entity<DisposalUnitComponent> ent, ref GetVerbsEvent<AlternativeVerb> args)
|
||||
@@ -785,4 +789,23 @@ public abstract class SharedDisposalUnitSystem : EntitySystem
|
||||
// See also, medical scanner. Also maybe add verbs for entering lockers/body bags?
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
private void OnGetDumpableVerb(Entity<DisposalUnitComponent> ent, ref GetDumpableVerbEvent args)
|
||||
{
|
||||
args.Verb = Loc.GetString("dump-disposal-verb-name", ("unit", ent));
|
||||
}
|
||||
|
||||
private void OnDump(Entity<DisposalUnitComponent> ent, ref DumpEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
|
||||
args.Handled = true;
|
||||
args.PlaySound = true;
|
||||
|
||||
foreach (var entity in args.DumpQueue)
|
||||
{
|
||||
DoInsertDisposalUnit(ent, entity, args.User);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user