Allow drag-and-drop insertion of reagents into the ChemMaster (#19796)
* Add DumpableSolutionComponent Separates out the component from "DrainComponent" that allows one to drag a bucket/any reagent container onto a drain/sink/toilet to empty it and allows other reagent containers to reuse the code effortlessly. * Give the ChemMaster 4000 the DumpableSolution Component Allows drag and dropping solutions into the ChemMaster much like you used to be able to do exclusively with drains. This also allows dumping jugs into them.
This commit is contained in:
@@ -91,6 +91,21 @@ public sealed partial class SolutionContainerSystem
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryGetDumpableSolution(EntityUid uid,
|
||||
[NotNullWhen(true)] out Solution? solution,
|
||||
DumpableSolutionComponent? dumpable = null,
|
||||
SolutionContainerManagerComponent? manager = null)
|
||||
{
|
||||
if (!Resolve(uid, ref dumpable, ref manager, false)
|
||||
|| !manager.Solutions.TryGetValue(dumpable.Solution, out solution))
|
||||
{
|
||||
solution = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryGetDrawableSolution(EntityUid uid,
|
||||
[NotNullWhen(true)] out Solution? solution,
|
||||
DrawableSolutionComponent? drawable = null,
|
||||
|
||||
Reference in New Issue
Block a user