Fix lizards losing snouts when equipping a head bandana (#29979)

* say goodbye to no-snout lizards

* remove snout from plague doctor hat HideLayerClothing component
This commit is contained in:
Luiz Costa
2024-07-13 23:59:45 -03:00
committed by GitHub
parent a06309b964
commit 87467a358b
5 changed files with 25 additions and 1 deletions

View 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();
}

View 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;
}
}
}

View 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

View File

@@ -391,7 +391,6 @@
- type: HideLayerClothing
slots:
- Hair
- Snout
- HeadTop
- HeadSide

View File

@@ -11,6 +11,9 @@
- HEAD
unfoldedSlots:
- MASK
foldedHideLayers: []
unfoldedHideLayers:
- Snout
- type: Mask
- type: IngestionBlocker
- type: IdentityBlocker