Rollerbeds (#5681)

This commit is contained in:
metalgearsloth
2021-12-29 15:57:20 +11:00
committed by GitHub
parent 0bab6ecb71
commit e5e144d99c
40 changed files with 627 additions and 53 deletions

View File

@@ -193,12 +193,18 @@ namespace Content.Server.Storage.Components
return false;
}
return true;
var @event = new StorageOpenAttemptEvent();
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, @event);
return !@event.Cancelled;
}
public virtual bool CanClose(EntityUid user, bool silent = false)
{
return true;
var @event = new StorageCloseAttemptEvent();
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, @event);
return !@event.Cancelled;
}
public void ToggleOpen(EntityUid user)
@@ -479,4 +485,14 @@ namespace Content.Server.Storage.Components
}
}
}
public sealed class StorageOpenAttemptEvent : CancellableEntityEventArgs
{
}
public sealed class StorageCloseAttemptEvent : CancellableEntityEventArgs
{
}
}