1
0

PaperComponent.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Paper;
  5. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  6. public sealed partial class PaperComponent : Component
  7. {
  8. public PaperAction Mode;
  9. [DataField("content"), AutoNetworkedField]
  10. public string Content { get; set; } = "";
  11. [DataField("contentSize")]
  12. public int ContentSize { get; set; } = 6000;
  13. [DataField("stampedBy"), AutoNetworkedField]
  14. public List<StampDisplayInfo> StampedBy { get; set; } = new();
  15. /// <summary>
  16. /// Stamp to be displayed on the paper, state from bureaucracy.rsi
  17. /// </summary>
  18. [DataField("stampState"), AutoNetworkedField]
  19. public string? StampState { get; set; }
  20. [DataField, AutoNetworkedField]
  21. public bool EditingDisabled;
  22. /// <summary>
  23. /// Sound played after writing to the paper.
  24. /// </summary>
  25. [DataField("sound")]
  26. public SoundSpecifier? Sound { get; private set; } = new SoundCollectionSpecifier("PaperScribbles", AudioParams.Default.WithVariation(0.1f));
  27. [Serializable, NetSerializable]
  28. public sealed class PaperBoundUserInterfaceState : BoundUserInterfaceState
  29. {
  30. public readonly string Text;
  31. public readonly List<StampDisplayInfo> StampedBy;
  32. public readonly PaperAction Mode;
  33. public PaperBoundUserInterfaceState(string text, List<StampDisplayInfo> stampedBy, PaperAction mode = PaperAction.Read)
  34. {
  35. Text = text;
  36. StampedBy = stampedBy;
  37. Mode = mode;
  38. }
  39. }
  40. [Serializable, NetSerializable]
  41. public sealed class PaperInputTextMessage : BoundUserInterfaceMessage
  42. {
  43. public readonly string Text;
  44. public PaperInputTextMessage(string text)
  45. {
  46. Text = text;
  47. }
  48. }
  49. [Serializable, NetSerializable]
  50. public enum PaperUiKey
  51. {
  52. Key
  53. }
  54. [Serializable, NetSerializable]
  55. public enum PaperAction
  56. {
  57. Read,
  58. Write,
  59. }
  60. [Serializable, NetSerializable]
  61. public enum PaperVisuals : byte
  62. {
  63. Status,
  64. Stamp
  65. }
  66. [Serializable, NetSerializable]
  67. public enum PaperStatus : byte
  68. {
  69. Blank,
  70. Written
  71. }
  72. }