Fix & extend add reagent verb (#4954)
* AddReagentWindow * addReagent command * functional UI * fix networking * add comments & docstrings * Remove unecesary system * cleanup & close-eui * tweak default window size * fix EUI closing error * fix merge issues * fix merge
This commit is contained in:
@@ -249,7 +249,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
return solutionsMgr.Solutions[name];
|
||||
}
|
||||
|
||||
public string[] RemoveEachReagent(Solution solution, FixedPoint2 quantity)
|
||||
public string[] RemoveEachReagent(EntityUid uid, Solution solution, FixedPoint2 quantity)
|
||||
{
|
||||
var removedReagent = new string[solution.Contents.Count];
|
||||
if (quantity <= 0)
|
||||
@@ -274,15 +274,21 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
UpdateChemicals(uid, solution);
|
||||
return removedReagent;
|
||||
}
|
||||
|
||||
public void TryRemoveAllReagents(Solution solution, List<Solution.ReagentQuantity> removeReagents)
|
||||
public void TryRemoveAllReagents(EntityUid uid, Solution solution, List<Solution.ReagentQuantity> removeReagents)
|
||||
{
|
||||
if (removeReagents.Count == 0)
|
||||
return;
|
||||
|
||||
foreach (var reagent in removeReagents)
|
||||
{
|
||||
solution.RemoveReagent(reagent.ReagentId, reagent.Quantity);
|
||||
}
|
||||
|
||||
UpdateChemicals(uid, solution);
|
||||
}
|
||||
|
||||
public FixedPoint2 GetReagentQuantity(EntityUid ownerUid, string reagentId)
|
||||
|
||||
Reference in New Issue
Block a user