1
0

GatewayComponent.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using Content.Server.Gateway.Systems;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  4. using Robust.Shared.Utility;
  5. namespace Content.Server.Gateway.Components;
  6. /// <summary>
  7. /// Controlling gateway that links to other gateway destinations on the server.
  8. /// </summary>
  9. [RegisterComponent, Access(typeof(GatewaySystem)), AutoGenerateComponentPause]
  10. public sealed partial class GatewayComponent : Component
  11. {
  12. /// <summary>
  13. /// Whether this destination is shown in the gateway ui.
  14. /// If you are making a gateway for an admeme set this once you are ready for players to select it.
  15. /// </summary>
  16. [DataField, ViewVariables(VVAccess.ReadWrite)]
  17. public bool Enabled;
  18. /// <summary>
  19. /// Can the gateway be interacted with? If false then only settable via admins / mappers.
  20. /// </summary>
  21. [DataField, ViewVariables(VVAccess.ReadWrite)]
  22. public bool Interactable = true;
  23. /// <summary>
  24. /// Name as it shows up on the ui of station gateways.
  25. /// </summary>
  26. [DataField, ViewVariables(VVAccess.ReadWrite)]
  27. public FormattedMessage Name = new();
  28. /// <summary>
  29. /// Sound to play when opening the portal.
  30. /// </summary>
  31. /// <remarks>
  32. /// Originally named PortalSound as it was used for opening and closing.
  33. /// </remarks>
  34. [DataField("portalSound")]
  35. public SoundSpecifier OpenSound = new SoundPathSpecifier("/Audio/Effects/Lightning/lightningbolt.ogg");
  36. /// <summary>
  37. /// Sound to play when closing the portal.
  38. /// </summary>
  39. [DataField]
  40. public SoundSpecifier CloseSound = new SoundPathSpecifier("/Audio/Effects/Lightning/lightningbolt.ogg");
  41. /// <summary>
  42. /// Sound to play when trying to open or close the portal and missing access.
  43. /// </summary>
  44. [DataField]
  45. public SoundSpecifier AccessDeniedSound = new SoundPathSpecifier("/Audio/Machines/custom_deny.ogg");
  46. /// <summary>
  47. /// Cooldown between opening portal / closing.
  48. /// </summary>
  49. [DataField]
  50. public TimeSpan Cooldown = TimeSpan.FromSeconds(30);
  51. /// <summary>
  52. /// The time at which the portal can next be opened.
  53. /// </summary>
  54. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  55. [AutoPausedField]
  56. public TimeSpan NextReady;
  57. }