StampComponent.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using Robust.Shared.Serialization;
  2. using Robust.Shared.Audio;
  3. namespace Content.Shared.Paper;
  4. /// <summary>
  5. /// Set of required information to draw a stamp in UIs, where
  6. /// representing the state of the stamp at the point in time
  7. /// when it was applied to a paper. These fields mirror the
  8. /// equivalent in the component.
  9. /// </summary>
  10. [DataDefinition, Serializable, NetSerializable]
  11. public partial struct StampDisplayInfo
  12. {
  13. StampDisplayInfo(string s)
  14. {
  15. StampedName = s;
  16. }
  17. [DataField("stampedName")]
  18. public string StampedName;
  19. [DataField("stampedColor")]
  20. public Color StampedColor;
  21. };
  22. [RegisterComponent]
  23. public sealed partial class StampComponent : Component
  24. {
  25. /// <summary>
  26. /// The loc string name that will be stamped to the piece of paper on examine.
  27. /// </summary>
  28. [DataField("stampedName")]
  29. public string StampedName { get; set; } = "stamp-component-stamped-name-default";
  30. /// <summary>
  31. /// The sprite state of the stamp to display on the paper from paper Sprite path.
  32. /// </summary>
  33. [DataField("stampState")]
  34. public string StampState { get; set; } = "paper_stamp-generic";
  35. /// <summary>
  36. /// The color of the ink used by the stamp in UIs
  37. /// </summary>
  38. [DataField("stampedColor")]
  39. public Color StampedColor = Color.FromHex("#BB3232"); // StyleNano.DangerousRedFore
  40. /// <summary>
  41. /// The sound when stamp stamped
  42. /// </summary>
  43. [DataField("sound")]
  44. public SoundSpecifier? Sound = null;
  45. }