namespace Content.Shared.Foldable;
+// TODO: This system could arguably be refactored into a general state system, as it is being utilized for a lot of different objects with various needs.
public sealed class FoldableSystem : EntitySystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
SubscribeLocalEvent<FoldableComponent, ComponentInit>(OnFoldableInit);
SubscribeLocalEvent<FoldableComponent, ContainerGettingInsertedAttemptEvent>(OnInsertEvent);
- SubscribeLocalEvent<FoldableComponent, InsertIntoEntityStorageAttemptEvent>(OnStoreThisAttempt);
SubscribeLocalEvent<FoldableComponent, StorageOpenAttemptEvent>(OnFoldableOpenAttempt);
SubscribeLocalEvent<FoldableComponent, StrapAttemptEvent>(OnStrapAttempt);
args.Cancelled = true;
}
- public void OnStoreThisAttempt(EntityUid uid, FoldableComponent comp, ref InsertIntoEntityStorageAttemptEvent args)
- {
- if (comp.IsFolded)
- args.Cancelled = true;
- }
-
public void OnStrapAttempt(EntityUid uid, FoldableComponent comp, ref StrapAttemptEvent args)
{
if (comp.IsFolded)