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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -391,7 +391,6 @@
|
||||
- type: HideLayerClothing
|
||||
slots:
|
||||
- Hair
|
||||
- Snout
|
||||
- HeadTop
|
||||
- HeadSide
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
- HEAD
|
||||
unfoldedSlots:
|
||||
- MASK
|
||||
foldedHideLayers: []
|
||||
unfoldedHideLayers:
|
||||
- Snout
|
||||
- type: Mask
|
||||
- type: IngestionBlocker
|
||||
- type: IdentityBlocker
|
||||
|
||||
Reference in New Issue
Block a user