Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public sealed partial class FoldableClothingComponent : Component
/// Which layers does this hide when Unfolded? See <see cref="HumanoidVisualLayers"/> and <see cref="HideLayerClothingComponent"/>
/// </summary>
[DataField]
public HashSet<HumanoidVisualLayers>? UnfoldedHideLayers = new();
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();
public HashSet<HumanoidVisualLayers> FoldedHideLayers = new();
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private void OnFoldAttempt(Entity<FoldableClothingComponent> ent, ref FoldAttemp
}

// Setting hidden layers while equipped is not currently supported.
if (ent.Comp.FoldedHideLayers != null || ent.Comp.UnfoldedHideLayers != null)
if (ent.Comp.FoldedHideLayers.Count != 0|| ent.Comp.UnfoldedHideLayers.Count != 0)
args.Cancelled = true;
}

Expand Down Expand Up @@ -65,7 +65,7 @@ private void OnFolded(Entity<FoldableClothingComponent> ent, ref FoldedEvent arg
// This should instead work via an event or something that gets raised to optionally modify the currently hidden layers.
// Or at the very least it should stash the old layers and restore them when unfolded.
// TODO CLOTHING fix this.
if (ent.Comp.FoldedHideLayers != null && TryComp<HideLayerClothingComponent>(ent.Owner, out var hideLayerComp))
if (ent.Comp.FoldedHideLayers.Count != 0 && TryComp<HideLayerClothingComponent>(ent.Owner, out var hideLayerComp))
hideLayerComp.Slots = ent.Comp.FoldedHideLayers;

}
Expand All @@ -81,7 +81,7 @@ private void OnFolded(Entity<FoldableClothingComponent> ent, ref FoldedEvent arg
_itemSystem.SetHeldPrefix(ent.Owner, null, false, itemComp);

// TODO CLOTHING fix this.
if (ent.Comp.UnfoldedHideLayers != null && TryComp<HideLayerClothingComponent>(ent.Owner, out var hideLayerComp))
if (ent.Comp.UnfoldedHideLayers.Count != 0 && TryComp<HideLayerClothingComponent>(ent.Owner, out var hideLayerComp))
hideLayerComp.Slots = ent.Comp.UnfoldedHideLayers;

}
Expand Down
Loading