Show remaining liquid in a drink when you examine it (#8721)
* Show drink volume on examine * Approximate measurement unless a beaker * Changed percentage threshold and added subjectivity * Update default switch case since it can never be 0 here * Remove int cast from PercentFull method
This commit is contained in:
@@ -113,6 +113,14 @@ public sealed partial class SolutionContainerSystem
|
||||
: solution.CurrentVolume;
|
||||
}
|
||||
|
||||
public float PercentFull(EntityUid uid)
|
||||
{
|
||||
if (!TryGetDrainableSolution(uid, out var solution) || solution.MaxVolume.Equals(FixedPoint2.Zero))
|
||||
return 0;
|
||||
|
||||
return ((solution.CurrentVolume.Float() / solution.MaxVolume.Float()) * 100);
|
||||
}
|
||||
|
||||
public bool TryGetFitsInDispenser(EntityUid owner,
|
||||
[NotNullWhen(true)] out Solution? solution,
|
||||
FitsInDispenserComponent? dispenserFits = null,
|
||||
|
||||
Reference in New Issue
Block a user