RadiationCollectorComponent.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using Content.Shared.Singularity.Components;
  2. using Robust.Client.Animations;
  3. namespace Content.Client.Singularity.Visualizers;
  4. /// <summary>
  5. /// The component used to reflect the state of a radiation collector in its appearance.
  6. /// </summary>
  7. [RegisterComponent]
  8. [Access(typeof(RadiationCollectorSystem))]
  9. public sealed partial class RadiationCollectorComponent : Component
  10. {
  11. /// <summary>
  12. /// The key used to index the (de)activation animations played when turning a radiation collector on/off.
  13. /// </summary>
  14. [ViewVariables]
  15. public const string AnimationKey = "radiationcollector_animation";
  16. /// <summary>
  17. /// The current visual state of the radiation collector.
  18. /// </summary>
  19. [ViewVariables]
  20. public RadiationCollectorVisualState CurrentState = RadiationCollectorVisualState.Deactive;
  21. /// <summary>
  22. /// The RSI state used for the main sprite layer (<see cref="RadiationCollectorVisualLayers.Main"/>) when the radiation collector is active.
  23. /// </summary>
  24. [DataField("activeState")]
  25. [ViewVariables(VVAccess.ReadWrite)]
  26. public string ActiveState = "ca_on";
  27. /// <summary>
  28. /// The RSI state used for the main sprite layer (<see cref="RadiationCollectorVisualLayers.Main"/>) when the radiation collector is inactive.
  29. /// </summary>
  30. [DataField("inactiveState")]
  31. [ViewVariables(VVAccess.ReadWrite)]
  32. public string InactiveState = "ca_off";
  33. /// <summary>
  34. /// Used to build the <value cref="ActivateAnimation">activation animation</value> when the component is initialized.
  35. /// </summary>
  36. [DataField("activatingState")]
  37. public string ActivatingState = "ca_active";
  38. /// <summary>
  39. /// Used to build the <see cref="DeactiveAnimation">deactivation animation</see> when the component is initialized.
  40. /// </summary>
  41. [DataField("deactivatingState")]
  42. public string DeactivatingState = "ca_deactive";
  43. /// <summary>
  44. /// The animation used when turning on the radiation collector.
  45. /// </summary>
  46. [ViewVariables(VVAccess.ReadWrite)]
  47. public Animation ActivateAnimation = default!;
  48. /// <summary>
  49. /// The animation used when turning off the radiation collector.
  50. /// </summary>
  51. [ViewVariables(VVAccess.ReadWrite)]
  52. public Animation DeactiveAnimation = default!;
  53. }