]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add support for HeldPrefix to SolutionContainerVisualsSystem (#28532)
authorTayrtahn <tayrtahn@gmail.com>
Mon, 3 Jun 2024 05:12:13 +0000 (01:12 -0400)
committerGitHub <noreply@github.com>
Mon, 3 Jun 2024 05:12:13 +0000 (01:12 -0400)
Content.Client/Chemistry/Visualizers/SolutionContainerVisualsSystem.cs

index f1e8e8d7aa445bd1c19d51e7ecbf22fabbaacd47..17b88fb5a8f54dbdc8a469a3688889ee191b19ee 100644 (file)
@@ -3,6 +3,7 @@ using Content.Shared.Chemistry;
 using Content.Shared.Chemistry.Components;
 using Content.Shared.Chemistry.Reagent;
 using Content.Shared.Hands;
+using Content.Shared.Item;
 using Content.Shared.Rounding;
 using Robust.Client.GameObjects;
 using Robust.Shared.Prototypes;
@@ -150,6 +151,9 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem<SolutionCo
         if (!TryComp(uid, out AppearanceComponent? appearance))
             return;
 
+        if (!TryComp<ItemComponent>(uid, out var item))
+            return;
+
         if (!AppearanceSystem.TryGetData<float>(uid, SolutionContainerVisuals.FillFraction, out var fraction, appearance))
             return;
 
@@ -159,7 +163,8 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem<SolutionCo
         {
             var layer = new PrototypeLayerData();
 
-            var key = "inhand-" + args.Location.ToString().ToLowerInvariant() + component.InHandsFillBaseName + closestFillSprite;
+            var heldPrefix = item.HeldPrefix == null ? "inhand-" : $"{item.HeldPrefix}-inhand-";
+            var key = heldPrefix + args.Location.ToString().ToLowerInvariant() + component.InHandsFillBaseName + closestFillSprite;
 
             layer.State = key;