using Content.Shared.Containers.ItemSlots;
using Content.Shared.Paper;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Fax.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class FaxMachineComponent : Component
{
///
/// Name with which the fax will be visible to others on the network
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("name")]
public string FaxName { get; set; } = "Unknown";
///
/// Sprite to use when inserting an object.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField, AutoNetworkedField]
public string InsertingState = "inserting";
///
/// Device address of fax in network to which data will be send
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("destinationAddress")]
public string? DestinationFaxAddress { get; set; }
///
/// Contains the item to be sent, assumes it's paper...
///
[DataField(required: true)]
public ItemSlot PaperSlot = new();
///
/// Is fax machine should respond to pings in network
/// This will make it visible to others on the network
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool ResponsePings { get; set; } = true;
///
/// Should admins be notified on message receive
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool NotifyAdmins { get; set; } = false;
///
/// Should that fax receive nuke codes send by admins. Probably should be captain fax only
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public bool ReceiveNukeCodes { get; set; } = false;
///
/// Sound to play when fax has been emagged
///
[DataField]
public SoundSpecifier EmagSound = new SoundCollectionSpecifier("sparks");
///
/// Sound to play when fax printing new message
///
[DataField]
public SoundSpecifier PrintSound = new SoundPathSpecifier("/Audio/Machines/printer.ogg");
///
/// Sound to play when fax successfully send message
///
[DataField]
public SoundSpecifier SendSound = new SoundPathSpecifier("/Audio/Machines/high_tech_confirm.ogg");
///
/// Known faxes in network by address with fax names
///
[ViewVariables]
public Dictionary KnownFaxes { get; } = new();
///
/// Print queue of the incoming message
///
[ViewVariables]
[DataField]
public Queue PrintingQueue { get; private set; } = new();
///
/// Message sending timeout
///
[ViewVariables]
[DataField]
public float SendTimeoutRemaining;
///
/// Message sending timeout
///
[ViewVariables]
[DataField]
public float SendTimeout = 5f;
///
/// Remaining time of inserting animation
///
[DataField]
public float InsertingTimeRemaining;
///
/// How long the inserting animation will play
///
[ViewVariables]
public float InsertionTime = 1.88f; // 0.02 off for correct animation
///
/// Remaining time of printing animation
///
[DataField]
public float PrintingTimeRemaining;
///
/// How long the printing animation will play
///
[ViewVariables]
public float PrintingTime = 2.3f;
}
[DataDefinition]
public sealed partial class FaxPrintout
{
[DataField(required: true)]
public string Name { get; private set; } = default!;
[DataField]
public string? Label { get; private set; }
[DataField(required: true)]
public string Content { get; private set; } = default!;
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer), required: true)]
public string PrototypeId { get; private set; } = default!;
[DataField("stampState")]
public string? StampState { get; private set; }
[DataField("stampedBy")]
public List StampedBy { get; private set; } = new();
private FaxPrintout()
{
}
public FaxPrintout(string content, string name, string? label = null, string? prototypeId = null, string? stampState = null, List? stampedBy = null)
{
Content = content;
Name = name;
Label = label;
PrototypeId = prototypeId ?? "";
StampState = stampState;
StampedBy = stampedBy ?? new List();
}
}