using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Actions;
///
/// An action that must be confirmed before using it.
/// Using it for the first time primes it, after a delay you can then confirm it.
/// Used for dangerous actions that cannot be undone (unlike screaming).
///
[RegisterComponent, NetworkedComponent, Access(typeof(ConfirmableActionSystem))]
[AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class ConfirmableActionComponent : Component
{
///
/// Warning popup shown when priming the action.
///
[DataField(required: true)]
public LocId Popup = string.Empty;
///
/// If not null, this is when the action can be confirmed at.
/// This is the time of priming plus the delay.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoNetworkedField, AutoPausedField]
public TimeSpan? NextConfirm;
///
/// If not null, this is when the action will unprime at.
/// This is NextConfirm> plus PrimeTime
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoNetworkedField, AutoPausedField]
public TimeSpan? NextUnprime;
///
/// Forced delay between priming and confirming to prevent accidents.
///
[DataField]
public TimeSpan ConfirmDelay = TimeSpan.FromSeconds(1);
///
/// Once you prime the action it will unprime after this length of time.
///
[DataField]
public TimeSpan PrimeTime = TimeSpan.FromSeconds(5);
}