Cargo Bounties (#17344)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Nemanja
2023-06-22 07:49:33 -04:00
committed by GitHub
parent ad89184d70
commit 7ab5127286
35 changed files with 1269 additions and 6 deletions

View File

@@ -0,0 +1,57 @@
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Cargo.Components;
[RegisterComponent]
public sealed class CargoBountyConsoleComponent : Component
{
/// <summary>
/// The id of the label entity spawned by the print label button.
/// </summary>
[DataField("bountyLabelId", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string BountyLabelId = "PaperCargoBountyManifest";
/// <summary>
/// The time at which the console will be able to print a label again.
/// </summary>
[DataField("nextPrintTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan NextPrintTime = TimeSpan.Zero;
/// <summary>
/// The time between prints.
/// </summary>
[DataField("printDelay")]
public TimeSpan PrintDelay = TimeSpan.FromSeconds(5);
/// <summary>
/// The sound made when printing occurs
/// </summary>
[DataField("printSound")]
public SoundSpecifier PrintSound = new SoundPathSpecifier("/Audio/Machines/printer.ogg");
}
[NetSerializable, Serializable]
public sealed class CargoBountyConsoleState : BoundUserInterfaceState
{
public List<CargoBountyData> Bounties;
public CargoBountyConsoleState(List<CargoBountyData> bounties)
{
Bounties = bounties;
}
}
[Serializable, NetSerializable]
public sealed class BountyPrintLabelMessage : BoundUserInterfaceMessage
{
public int BountyId;
public BountyPrintLabelMessage(int bountyId)
{
BountyId = bountyId;
}
}