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:
Leon Friedrich
2021-11-08 17:22:42 +13:00
committed by GitHub
parent 54f7b68503
commit 3612d25539
22 changed files with 609 additions and 339 deletions

View File

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