Add doafter to filling the hypopen (#40538)
* Initial commit * Small QOL buff * Review changes * Ch-ch-ch-ch-chaaaanges * Review changes * oops * Oh ya fix the fill thing * cleanup warnings make a few more private methods --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
@@ -44,7 +44,6 @@ public sealed class SolutionDumpingSystem : EntitySystem
|
||||
//SubscribeLocalEvent<RefillableSolutionComponent, DragDropDraggedEvent>(OnRefillableDragged); For if you want to refill a container by dragging it into another one. Can't find a use for that currently.
|
||||
SubscribeLocalEvent<DrainableSolutionComponent, DragDropDraggedEvent>(OnDrainableDragged);
|
||||
|
||||
SubscribeLocalEvent<RefillableSolutionComponent, DrainedTargetEvent>(OnDrainedToRefillableDragged);
|
||||
SubscribeLocalEvent<DumpableSolutionComponent, DrainedTargetEvent>(OnDrainedToDumpableDragged);
|
||||
|
||||
// We use queries for these since CanDropDraggedEvent gets called pretty rapidly
|
||||
@@ -62,7 +61,7 @@ public sealed class SolutionDumpingSystem : EntitySystem
|
||||
private void OnDrainableCanDragDropped(Entity<DrainableSolutionComponent> ent, ref CanDropDraggedEvent args)
|
||||
{
|
||||
// Easily drawn-from thing can be dragged onto easily refillable thing.
|
||||
if (!_refillableQuery.HasComp(args.Target) && !_dumpQuery.HasComp(args.Target))
|
||||
if (!_dumpQuery.HasComp(args.Target))
|
||||
return;
|
||||
|
||||
args.CanDrop = true;
|
||||
@@ -121,28 +120,6 @@ public sealed class SolutionDumpingSystem : EntitySystem
|
||||
_audio.PlayPredicted(AbsorbentComponent.DefaultTransferSound, ent, args.User);
|
||||
}
|
||||
|
||||
private void OnDrainedToRefillableDragged(Entity<RefillableSolutionComponent> ent, ref DrainedTargetEvent args)
|
||||
{
|
||||
if (!_solContainer.TryGetRefillableSolution((ent, ent.Comp),
|
||||
out var targetSolEnt,
|
||||
out var targetSol))
|
||||
return;
|
||||
|
||||
// Check openness, hands, source being empty, and target being full.
|
||||
if (!DragInteractionChecks(args.User,
|
||||
args.Source,
|
||||
ent.Owner,
|
||||
args.SourceSolution,
|
||||
targetSol,
|
||||
out var sourceEnt))
|
||||
return;
|
||||
|
||||
_solContainer.TryAddSolution(targetSolEnt.Value,
|
||||
_solContainer.SplitSolution(sourceEnt.Value, targetSol.AvailableVolume));
|
||||
|
||||
_audio.PlayPredicted(AbsorbentComponent.DefaultTransferSound, ent, args.User);
|
||||
}
|
||||
|
||||
// Common checks between dragging handlers.
|
||||
private bool DragInteractionChecks(EntityUid user,
|
||||
EntityUid sourceContainer,
|
||||
|
||||
Reference in New Issue
Block a user