Rollerbed / foldable strap fixes. (#16106)

This commit is contained in:
Leon Friedrich
2023-05-05 19:27:15 +12:00
committed by GitHub
parent 1a4f522267
commit cc4edb9f87
8 changed files with 19 additions and 24 deletions

View File

@@ -1,3 +1,4 @@
using Content.Shared.Buckle;
using Content.Shared.Storage.Components;
using JetBrains.Annotations;
using Robust.Shared.Containers;
@@ -10,6 +11,7 @@ namespace Content.Shared.Foldable;
public abstract class SharedFoldableSystem : EntitySystem
{
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
[Dependency] private readonly SharedBuckleSystem _buckle = default!;
public override void Initialize()
{
@@ -65,6 +67,7 @@ public abstract class SharedFoldableSystem : EntitySystem
component.IsFolded = folded;
Dirty(component);
Appearance.SetData(uid, FoldedVisuals.State, folded);
_buckle.StrapSetEnabled(uid, !component.IsFolded);
}
private void OnInsertEvent(EntityUid uid, FoldableComponent component, ContainerGettingInsertedAttemptEvent args)