Improved solution container visuals (#13791)

This commit is contained in:
adamsong
2023-03-22 23:49:42 -04:00
committed by GitHub
parent ec71302b4f
commit 980c3ef799
5 changed files with 11 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Rounding;
using Robust.Client.GameObjects;
using Robust.Shared.Prototypes;
@@ -41,7 +42,6 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem<SolutionCo
Logger.Error("Attempted to set solution container visuals volume ratio on " + ToPrettyString(uid) + " to a value greater than 1. Volume should never be greater than max volume!");
fraction = 1f;
}
if (component.Metamorphic)
{
if (args.Sprite.LayerMapTryGet(component.BaseLayer, out var baseLayer))
@@ -79,7 +79,7 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem<SolutionCo
}
}
var closestFillSprite = (int) Math.Round(fraction * component.MaxFillLevels);
int closestFillSprite = ContentHelpers.RoundToLevels(fraction, 1, component.MaxFillLevels + 1);
if (closestFillSprite > 0)
{