Move solution examine subscription from DrinkComponent to ExaminableSolutionComponent (#39362)

* initial it works

* clean it up

* yml

* datafield the LocIds

* move from the other branch

* no max vol on puddles and anoms

* closed

* Changes inspired by #39008

* small bug and more color range

* puddle changes and more examinable solutions

* lint

* small change

* requested changes

* un-delete

* tiny comment

* 1 less loc id in this world

* request and last second change

---------

Co-authored-by: iaada <iaada@users.noreply.github.com>
This commit is contained in:
āda
2025-08-06 11:11:19 -05:00
committed by GitHub
parent 8ef212a338
commit 49c4aab489
25 changed files with 249 additions and 146 deletions

View File

@@ -1,9 +1,7 @@
using Content.Shared.Chemistry.Components;
using Content.Shared.Kitchen.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.FixedPoint;
using Robust.Shared.Utility;
using System.Diagnostics.CodeAnalysis;
using System.Text;
@@ -139,12 +137,13 @@ public abstract partial class SharedSolutionContainerSystem
#endregion Solution Modifiers
/// <returns>A value between 0 and 100 inclusive.</returns>
public float PercentFull(EntityUid uid)
{
if (!TryGetDrainableSolution(uid, out _, out var solution) || solution.MaxVolume.Equals(FixedPoint2.Zero))
if (!TryGetDrainableSolution(uid, out _, out var solution))
return 0;
return solution.FillFraction * 100;
return PercentFull(solution);
}
#region Static Methods
@@ -175,5 +174,14 @@ public abstract partial class SharedSolutionContainerSystem
return sb.ToString();
}
/// <returns>A value between 0 and 100 inclusive.</returns>
public static float PercentFull(Solution sol)
{
if (sol.MaxVolume.Equals(FixedPoint2.Zero))
return 0;
return sol.FillFraction * 100;
}
#endregion Static Methods
}