diff --git a/Content.Client/Chemistry/Visualizers/SolutionContainerVisualsSystem.cs b/Content.Client/Chemistry/Visualizers/SolutionContainerVisualsSystem.cs index 0e1bd57be1..f3c5cdf85b 100644 --- a/Content.Client/Chemistry/Visualizers/SolutionContainerVisualsSystem.cs +++ b/Content.Client/Chemistry/Visualizers/SolutionContainerVisualsSystem.cs @@ -5,9 +5,11 @@ namespace Content.Client.Chemistry.Visualizers; public sealed class SolutionContainerVisualsSystem : VisualizerSystem { + [Dependency] private readonly AppearanceSystem _appearance = default!; + protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisualsComponent component, ref AppearanceChangeEvent args) { - if (!args.Component.TryGetData(SolutionContainerVisuals.VisualState, out SolutionContainerVisualState state)) + if (!_appearance.TryGetData(uid, SolutionContainerVisuals.FillFraction, out float fraction, args.Component)) return; if (args.Sprite == null) @@ -16,8 +18,7 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem 0) { @@ -29,8 +30,8 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem diff --git a/Content.Shared/Chemistry/SolutionVisuals.cs b/Content.Shared/Chemistry/SolutionVisuals.cs index d7729f54da..62a75a63cc 100644 --- a/Content.Shared/Chemistry/SolutionVisuals.cs +++ b/Content.Shared/Chemistry/SolutionVisuals.cs @@ -5,39 +5,8 @@ namespace Content.Shared.Chemistry [Serializable, NetSerializable] public enum SolutionContainerVisuals : byte { - VisualState - } - - [Serializable, NetSerializable] - public sealed class SolutionContainerVisualState : ICloneable - { - public readonly Color Color; - - public readonly byte FilledVolumeFraction; - - // do we really need this just to save three bytes? - // This does seem silly - public float FilledVolumePercent => (float) FilledVolumeFraction / byte.MaxValue; - - /// - /// Sets the solution state of a container. - /// - public SolutionContainerVisualState(Color color, float filledVolumePercent) - { - Color = color; - FilledVolumeFraction = (byte) (byte.MaxValue * filledVolumePercent); - } - - public SolutionContainerVisualState(Color color, byte filledVolumeFraction) - { - Color = color; - FilledVolumeFraction = filledVolumeFraction; - } - - public object Clone() - { - return new SolutionContainerVisualState(Color, FilledVolumeFraction); - } + Color, + FillFraction, } public enum SolutionContainerLayers : byte