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:
pathetic meowmeow
2025-07-20 23:21:28 -04:00
committed by GitHub
parent 99b431cafd
commit d2ddbcbcda
17 changed files with 719 additions and 71 deletions

View File

@@ -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);
}
}
}