1
0

CargoBountyConsoleComponent.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  5. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  6. namespace Content.Shared.Cargo.Components;
  7. [RegisterComponent]
  8. public sealed partial class CargoBountyConsoleComponent : Component
  9. {
  10. /// <summary>
  11. /// The id of the label entity spawned by the print label button.
  12. /// </summary>
  13. [DataField("bountyLabelId", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
  14. public string BountyLabelId = "PaperCargoBountyManifest";
  15. /// <summary>
  16. /// The time at which the console will be able to print a label again.
  17. /// </summary>
  18. [DataField("nextPrintTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
  19. public TimeSpan NextPrintTime = TimeSpan.Zero;
  20. /// <summary>
  21. /// The time between prints.
  22. /// </summary>
  23. [DataField("printDelay")]
  24. public TimeSpan PrintDelay = TimeSpan.FromSeconds(5);
  25. /// <summary>
  26. /// The sound made when printing occurs
  27. /// </summary>
  28. [DataField("printSound")]
  29. public SoundSpecifier PrintSound = new SoundPathSpecifier("/Audio/Machines/printer.ogg");
  30. /// <summary>
  31. /// The sound made when the bounty is skipped.
  32. /// </summary>
  33. [DataField("skipSound")]
  34. public SoundSpecifier SkipSound = new SoundPathSpecifier("/Audio/Effects/Cargo/ping.ogg");
  35. /// <summary>
  36. /// The sound made when bounty skipping is denied due to lacking access.
  37. /// </summary>
  38. [DataField("denySound")]
  39. public SoundSpecifier DenySound = new SoundPathSpecifier("/Audio/Effects/Cargo/buzz_two.ogg");
  40. }
  41. [NetSerializable, Serializable]
  42. public sealed class CargoBountyConsoleState : BoundUserInterfaceState
  43. {
  44. public List<CargoBountyData> Bounties;
  45. public List<CargoBountyHistoryData> History;
  46. public TimeSpan UntilNextSkip;
  47. public CargoBountyConsoleState(List<CargoBountyData> bounties, List<CargoBountyHistoryData> history, TimeSpan untilNextSkip)
  48. {
  49. Bounties = bounties;
  50. History = history;
  51. UntilNextSkip = untilNextSkip;
  52. }
  53. }
  54. [Serializable, NetSerializable]
  55. public sealed class BountyPrintLabelMessage : BoundUserInterfaceMessage
  56. {
  57. public string BountyId;
  58. public BountyPrintLabelMessage(string bountyId)
  59. {
  60. BountyId = bountyId;
  61. }
  62. }
  63. [Serializable, NetSerializable]
  64. public sealed class BountySkipMessage : BoundUserInterfaceMessage
  65. {
  66. public string BountyId;
  67. public BountySkipMessage(string bountyId)
  68. {
  69. BountyId = bountyId;
  70. }
  71. }