]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix lizards losing snouts when equipping a head bandana (#29979)
authorLuiz Costa <33888056+luizwritescode@users.noreply.github.com>
Sun, 14 Jul 2024 02:59:45 +0000 (23:59 -0300)
committerGitHub <noreply@github.com>
Sun, 14 Jul 2024 02:59:45 +0000 (12:59 +1000)
* say goodbye to no-snout lizards

* remove snout from plague doctor hat HideLayerClothing component

Content.Shared/Clothing/Components/FoldableClothingComponent.cs
Content.Shared/Clothing/EntitySystems/FoldableClothingSystem.cs
Resources/Prototypes/Entities/Clothing/Head/bandanas.yml
Resources/Prototypes/Entities/Clothing/Head/hats.yml
Resources/Prototypes/Entities/Clothing/Masks/bandanas.yml

index 1a40d1dca12a7bca4deee48441d3521b63ece92b..ffcb52b457666e70ce326b5d3b741041d76cfc46 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Humanoid;
 using Content.Shared.Inventory;
 using Robust.Shared.GameStates;
 
@@ -30,4 +31,16 @@ public sealed partial class FoldableClothingComponent : Component
     /// </summary>
     [DataField]
     public string? FoldedHeldPrefix;
+
+    /// <summary>
+    /// Which layers does this hide when Unfolded? See <see cref="HumanoidVisualLayers"/> and <see cref="HideLayerClothingComponent"/>
+    /// </summary>
+    [DataField]
+    public HashSet<HumanoidVisualLayers> UnfoldedHideLayers = new();
+
+    /// <summary>
+    /// Which layers does this hide when folded? See <see cref="HumanoidVisualLayers"/> and <see cref="HideLayerClothingComponent"/>
+    /// </summary>
+    [DataField]
+    public HashSet<HumanoidVisualLayers> FoldedHideLayers = new();
 }
index be55588ddd57e88d215b40389ef7cfd170db7cbb..603af4099c8fcbeadf69567fa30bb075f1a1c8c8 100644 (file)
@@ -47,6 +47,10 @@ public sealed class FoldableClothingSystem : EntitySystem
 
             if (ent.Comp.FoldedHeldPrefix != null)
                 _itemSystem.SetHeldPrefix(ent.Owner, ent.Comp.FoldedHeldPrefix, false, itemComp);
+
+            if (TryComp<HideLayerClothingComponent>(ent.Owner, out var hideLayerComp))
+                hideLayerComp.Slots = ent.Comp.FoldedHideLayers;
+
         }
         else
         {
@@ -59,6 +63,9 @@ public sealed class FoldableClothingSystem : EntitySystem
             if (ent.Comp.FoldedHeldPrefix != null)
                 _itemSystem.SetHeldPrefix(ent.Owner, null, false, itemComp);
 
+            if (TryComp<HideLayerClothingComponent>(ent.Owner, out var hideLayerComp))
+                hideLayerComp.Slots = ent.Comp.UnfoldedHideLayers;
+
         }
     }
 }
index 51a56f1f1d698f7592d91bfac3f0493d203496e0..da56194f71562e590286b9c5d20ae59de24d4bfe 100644 (file)
@@ -20,6 +20,8 @@
     - state: icon_mask
       map: [ "unfoldedLayer" ]
       visible: false
+  - type: HideLayerClothing # needed since head bandana inherits from mask bandana
+    slots: []
   - type: Tag
     tags:
     - Bandana
index d220d55f1f52382c7c396f80865d143fb2296d57..8eeb82cbf4f944faaff6ace40ab9fec5aa39c7d7 100644 (file)
   - type: HideLayerClothing
     slots:
     - Hair
-    - Snout
     - HeadTop
     - HeadSide
 
index f5ad2fb6c83939bcae4290ca56d78b225f80cf58..8021030095335c53880c6ab71aa4ff5e58578a74 100644 (file)
@@ -11,6 +11,9 @@
     - HEAD
     unfoldedSlots:
     - MASK
+    foldedHideLayers: []
+    unfoldedHideLayers:
+    - Snout
   - type: Mask
   - type: IngestionBlocker
   - type: IdentityBlocker