HolopadComponent.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. using Content.Shared.Telephone;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Prototypes;
  4. using Robust.Shared.Serialization;
  5. namespace Content.Shared.Holopad;
  6. /// <summary>
  7. /// Holds data pertaining to holopads
  8. /// </summary>
  9. /// <remarks>
  10. /// Holopads also require a <see cref="TelephoneComponent"/> to function
  11. /// </remarks>
  12. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  13. [Access(typeof(SharedHolopadSystem))]
  14. public sealed partial class HolopadComponent : Component
  15. {
  16. /// <summary>
  17. /// The entity being projected by the holopad
  18. /// </summary>
  19. [ViewVariables]
  20. public Entity<HolopadHologramComponent>? Hologram;
  21. /// <summary>
  22. /// The entity using the holopad
  23. /// </summary>
  24. [ViewVariables]
  25. public Entity<HolopadUserComponent>? User;
  26. /// <summary>
  27. /// Proto ID for the user's hologram
  28. /// </summary>
  29. [DataField]
  30. public EntProtoId? HologramProtoId;
  31. /// <summary>
  32. /// The entity that has locked out the controls of this device
  33. /// </summary>
  34. [ViewVariables, AutoNetworkedField]
  35. public EntityUid? ControlLockoutOwner = null;
  36. /// <summary>
  37. /// The game tick the control lockout was initiated
  38. /// </summary>
  39. [ViewVariables, AutoNetworkedField]
  40. public TimeSpan ControlLockoutStartTime;
  41. /// <summary>
  42. /// The duration that the control lockout will last in seconds
  43. /// </summary>
  44. [DataField]
  45. public float ControlLockoutDuration { get; private set; } = 90f;
  46. /// <summary>
  47. /// The duration before the controls can be lockout again in seconds
  48. /// </summary>
  49. [DataField]
  50. public float ControlLockoutCoolDown { get; private set; } = 180f;
  51. }
  52. #region: Event messages
  53. /// <summary>
  54. /// Data from by the server to the client for the holopad UI
  55. /// </summary>
  56. [Serializable, NetSerializable]
  57. public sealed class HolopadBoundInterfaceState : BoundUserInterfaceState
  58. {
  59. public readonly Dictionary<NetEntity, string> Holopads;
  60. public HolopadBoundInterfaceState(Dictionary<NetEntity, string> holopads)
  61. {
  62. Holopads = holopads;
  63. }
  64. }
  65. /// <summary>
  66. /// Triggers the server to send updated power monitoring console data to the client for the single player session
  67. /// </summary>
  68. [Serializable, NetSerializable]
  69. public sealed class HolopadStartNewCallMessage : BoundUserInterfaceMessage
  70. {
  71. public readonly NetEntity Receiver;
  72. public HolopadStartNewCallMessage(NetEntity receiver)
  73. {
  74. Receiver = receiver;
  75. }
  76. }
  77. /// <summary>
  78. /// Triggers the server to send updated power monitoring console data to the client for the single player session
  79. /// </summary>
  80. [Serializable, NetSerializable]
  81. public sealed class HolopadAnswerCallMessage : BoundUserInterfaceMessage { }
  82. /// <summary>
  83. /// Triggers the server to send updated power monitoring console data to the client for the single player session
  84. /// </summary>
  85. [Serializable, NetSerializable]
  86. public sealed class HolopadEndCallMessage : BoundUserInterfaceMessage { }
  87. /// <summary>
  88. /// Triggers the server to send updated power monitoring console data to the client for the single player session
  89. /// </summary>
  90. [Serializable, NetSerializable]
  91. public sealed class HolopadStartBroadcastMessage : BoundUserInterfaceMessage { }
  92. /// <summary>
  93. /// Triggers the server to send updated power monitoring console data to the client for the single player session
  94. /// </summary>
  95. [Serializable, NetSerializable]
  96. public sealed class HolopadActivateProjectorMessage : BoundUserInterfaceMessage { }
  97. /// <summary>
  98. /// Triggers the server to send updated power monitoring console data to the client for the single player session
  99. /// </summary>
  100. [Serializable, NetSerializable]
  101. public sealed class HolopadStationAiRequestMessage : BoundUserInterfaceMessage { }
  102. #endregion
  103. /// <summary>
  104. /// Key to the Holopad UI
  105. /// </summary>
  106. [Serializable, NetSerializable]
  107. public enum HolopadUiKey : byte
  108. {
  109. InteractionWindow,
  110. InteractionWindowForAi,
  111. AiActionWindow,
  112. AiRequestWindow
  113. }