move lockcomponent to shared (#13722)

* move lockcomponent to shared

* ajcm review
This commit is contained in:
Nemanja
2023-02-11 20:12:29 -05:00
committed by GitHub
parent 301956ef15
commit c6c319f7e4
23 changed files with 381 additions and 332 deletions

View File

@@ -3,6 +3,7 @@ using Content.Server.Buckle.Systems;
using Content.Server.Storage.Components;
using Content.Shared.Buckle.Components;
using Content.Shared.Foldable;
using Content.Shared.Storage.Components;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Shared.Containers;
@@ -12,8 +13,8 @@ namespace Content.Server.Foldable
[UsedImplicitly]
public sealed class FoldableSystem : SharedFoldableSystem
{
[Dependency] private BuckleSystem _buckle = default!;
[Dependency] private SharedContainerSystem _container = default!;
[Dependency] private readonly BuckleSystem _buckle = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
public override void Initialize()
{
@@ -25,10 +26,10 @@ namespace Content.Server.Foldable
}
private void OnFoldableOpenAttempt(EntityUid uid, FoldableComponent component, StorageOpenAttemptEvent args)
private void OnFoldableOpenAttempt(EntityUid uid, FoldableComponent component, ref StorageOpenAttemptEvent args)
{
if (component.IsFolded)
args.Cancel();
args.Cancelled = true;
}
public bool TryToggleFold(FoldableComponent comp)
@@ -89,12 +90,12 @@ namespace Content.Server.Foldable
_buckle.StrapSetEnabled(component.Owner, !component.IsFolded);
}
public void OnStoreThisAttempt(EntityUid uid, FoldableComponent comp, StoreMobInItemContainerAttemptEvent args)
public void OnStoreThisAttempt(EntityUid uid, FoldableComponent comp, ref StoreMobInItemContainerAttemptEvent args)
{
args.Handled = true;
if (comp.IsFolded)
args.Cancel();
args.Cancelled = true;
}
#region Verb