ApcVisualizerComponent.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using Content.Shared.APC;
  2. namespace Content.Client.Power.APC;
  3. [RegisterComponent]
  4. [Access(typeof(ApcVisualizerSystem))]
  5. public sealed partial class ApcVisualsComponent : Component
  6. {
  7. #region Indicators
  8. #region Locks
  9. /// <summary>
  10. /// The number of lock indicators on the APC.
  11. /// </summary>
  12. [DataField("numLockIndicators")]
  13. [ViewVariables(VVAccess.ReadWrite)]
  14. public byte LockIndicators = 2;
  15. /// <summary>
  16. /// The prefix used for the sprite state suffix of the lock indicator lights.
  17. /// Valid states are of the form \<BASE\>\<PREFIX\>\<IDX>\-\<STATE\>
  18. /// </summary>
  19. [DataField("lockIndicatorPrefix")]
  20. [ViewVariables(VVAccess.ReadWrite)]
  21. public string LockPrefix = "lock";
  22. /// <summary>
  23. /// The suffixes used for the sprite state suffix of the lock indicator lights.
  24. /// Valid states are of the form \<PREFIX\>\<IDX\>-\<STATE\>
  25. /// </summary>
  26. [DataField("lockIndicatorSuffixes")]
  27. [ViewVariables(VVAccess.ReadWrite)]
  28. public string[] LockSuffixes = new string[(byte)(2 << (sbyte)ApcLockState.LogWidth)]{"unlocked", "locked"};
  29. #endregion Locks
  30. #region Channels
  31. /// <summary>
  32. /// The number of output channel indicator lights on the APC.
  33. /// </summary>
  34. [DataField("numChannelIndicators")]
  35. [ViewVariables(VVAccess.ReadWrite)]
  36. public byte ChannelIndicators = 3;
  37. /// <summary>
  38. /// The prefix used for the sprite state suffix of the channel indicator lights.
  39. /// Valid states are of the form \<BASE\>\<PREFIX\>\<IDX\>-\<STATE\>
  40. /// </summary>
  41. [DataField("channelIndicatorPrefix")]
  42. [ViewVariables(VVAccess.ReadWrite)]
  43. public string ChannelPrefix = "channel";
  44. /// <summary>
  45. /// The suffixes used for the sprite state suffix of the channel indicator lights.
  46. /// Valid states are of the form \<PREFIX\>\<IDX\>-\<STATE\>
  47. /// </summary>
  48. [DataField("channelIndicatorSuffixes")]
  49. [ViewVariables(VVAccess.ReadWrite)]
  50. public string[] ChannelSuffixes = new string[(byte)(2 << (sbyte)ApcChannelState.LogWidth)]{"auto_off", "manual_off", "auto_on", "manual_on"};
  51. #endregion Channels
  52. #endregion Indicators
  53. #region Screen
  54. /// <summary>
  55. /// The prefix used to construct the sprite state suffix used for the screen overlay.
  56. /// Valid sprite states are of the form \<PREFIX\>-\<SUFFIX\>.
  57. /// </summary>
  58. [DataField("screenStatePrefix")]
  59. [ViewVariables(VVAccess.ReadWrite)]
  60. public string ScreenPrefix = "display";
  61. /// <summary>
  62. /// The suffix used to construct the sprite state suffix used for the screen overlay.
  63. /// Valid sprite states are of the form \<PREFIX\>-\<STATE\>.
  64. /// </summary>
  65. [DataField("screenStateSuffixes")]
  66. [ViewVariables(VVAccess.ReadWrite)]
  67. public string[] ScreenSuffixes = new string[(byte)ApcChargeState.NumStates]{"lack", "charging", "full", "remote"};
  68. /// <summary>
  69. /// The colors of the light emitted by the APC given a particular display state.
  70. /// </summary>
  71. [DataField("screenColors")]
  72. [ViewVariables(VVAccess.ReadWrite)]
  73. public Color[] ScreenColors = new Color[(byte)ApcChargeState.NumStates]{Color.FromHex("#d1332e"), Color.FromHex("#dcdc28"), Color.FromHex("#82ff4c"), Color.FromHex("#ffac1c")};
  74. /// <summary>
  75. /// The sprite state of the unlit overlay used for the APC screen when the APC has been emagged.
  76. /// </summary>
  77. [DataField("emaggedScreenState")]
  78. [ViewVariables(VVAccess.ReadWrite)]
  79. public string EmaggedScreenState = "emag-unlit";
  80. /// <summary>
  81. /// The color of the light emitted when the APC has been emagged.
  82. /// </summary>
  83. [DataField("emaggedScreenColor")]
  84. [ViewVariables(VVAccess.ReadWrite)]
  85. public Color EmaggedScreenColor = Color.FromHex("#1f48d6");
  86. #endregion Screen
  87. }