2022-01-30 13:49:56 +13:00
|
|
|
using Content.Shared.Doors.Components;
|
2021-08-02 04:57:06 -07:00
|
|
|
|
2021-11-04 02:43:10 +13:00
|
|
|
namespace Content.Shared.Doors
|
2021-08-02 04:57:06 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Raised when the door's State variable is changed to a new variable that it was not equal to before.
|
|
|
|
|
/// </summary>
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class DoorStateChangedEvent : EntityEventArgs
|
2021-08-02 04:57:06 -07:00
|
|
|
{
|
2022-01-30 13:49:56 +13:00
|
|
|
public readonly DoorState State;
|
2021-08-02 04:57:06 -07:00
|
|
|
|
2022-01-30 13:49:56 +13:00
|
|
|
public DoorStateChangedEvent(DoorState state)
|
2021-08-02 04:57:06 -07:00
|
|
|
{
|
|
|
|
|
State = state;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Raised when the door is determining whether it is able to open.
|
|
|
|
|
/// Cancel to stop the door from being opened.
|
|
|
|
|
/// </summary>
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class BeforeDoorOpenedEvent : CancellableEntityEventArgs
|
2021-08-02 04:57:06 -07:00
|
|
|
{
|
2023-08-11 21:29:33 +12:00
|
|
|
public EntityUid? User = null;
|
2021-08-02 04:57:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2022-02-25 19:32:35 +13:00
|
|
|
/// Raised when the door is determining whether it is able to close. If the event is canceled, the door will not
|
|
|
|
|
/// close. Additionally this event also has a bool that determines whether or not the door should perform a
|
|
|
|
|
/// safety/collision check before closing. This check has to be proactively disabled by things like hacked airlocks.
|
2021-08-02 04:57:06 -07:00
|
|
|
/// </summary>
|
2022-01-30 13:49:56 +13:00
|
|
|
/// <remarks>
|
|
|
|
|
/// This event is raised both when the door is initially closed, and when it is just about to become "partially"
|
2022-02-25 19:32:35 +13:00
|
|
|
/// closed (opaque & collidable). If canceled while partially closing, it will start opening again. Useful in case
|
|
|
|
|
/// an entity entered the door just as it was about to become "solid".
|
2022-01-30 13:49:56 +13:00
|
|
|
/// </remarks>
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class BeforeDoorClosedEvent : CancellableEntityEventArgs
|
2021-08-02 04:57:06 -07:00
|
|
|
{
|
2022-02-25 19:32:35 +13:00
|
|
|
public bool PerformCollisionCheck;
|
2024-01-27 15:19:52 +03:00
|
|
|
public EntityUid? User; // WD ADDED
|
2022-02-25 19:32:35 +13:00
|
|
|
|
2024-01-27 15:19:52 +03:00
|
|
|
public BeforeDoorClosedEvent(bool performCollisionCheck, EntityUid? user)
|
2022-02-25 19:32:35 +13:00
|
|
|
{
|
|
|
|
|
PerformCollisionCheck = performCollisionCheck;
|
2024-01-27 15:19:52 +03:00
|
|
|
User = user; // WD ADDED
|
2022-02-25 19:32:35 +13:00
|
|
|
}
|
2021-08-02 04:57:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Called when the door is determining whether it is able to deny.
|
|
|
|
|
/// Cancel to stop the door from being able to deny.
|
|
|
|
|
/// </summary>
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class BeforeDoorDeniedEvent : CancellableEntityEventArgs
|
2021-08-02 04:57:06 -07:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Raised to determine whether the door should automatically close.
|
|
|
|
|
/// Cancel to stop it from automatically closing.
|
|
|
|
|
/// </summary>
|
2022-01-30 13:49:56 +13:00
|
|
|
/// <remarks>
|
|
|
|
|
/// This is called when a door decides whether it SHOULD auto close, not when it actually closes.
|
|
|
|
|
/// </remarks>
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class BeforeDoorAutoCloseEvent : CancellableEntityEventArgs
|
2021-08-02 04:57:06 -07:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|