PaperVisualsComponent.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. using System.Numerics;
  2. namespace Content.Client.Paper.UI;
  3. [RegisterComponent]
  4. public sealed partial class PaperVisualsComponent : Component
  5. {
  6. /// <summary>
  7. /// The path to the image which will be used as a background for the paper itself
  8. /// </summary>
  9. [DataField("backgroundImagePath")]
  10. public string? BackgroundImagePath;
  11. /// <summary>
  12. /// An optional patch to configure tiling stretching of the background. Used to set
  13. /// the PatchMargin in a <code>StyleBoxTexture</code>
  14. /// </summary>
  15. [DataField("backgroundPatchMargin")]
  16. public Box2 BackgroundPatchMargin = default;
  17. /// <summary>
  18. /// Modulate the background image by this color. Can be used to add colorful
  19. /// variants of images, without having to create new textures.
  20. /// </summary>
  21. [DataField("backgroundModulate")]
  22. public Color BackgroundModulate = Color.White;
  23. /// <summary>
  24. /// Should the background image tile, or be streched? Sets <code>StyleBoxTexture.StrechMode</code>
  25. /// </summary>
  26. [DataField("backgroundImageTile")]
  27. public bool BackgroundImageTile = false;
  28. /// <summary>
  29. /// An additional scale to apply to the background image
  30. /// </summary>
  31. [DataField("backgroundScale")]
  32. public Vector2 BackgroundScale = Vector2.One;
  33. /// <summary>
  34. /// A path to an image which will be used as a header on the paper
  35. /// </summary>
  36. [DataField("headerImagePath")]
  37. public string? HeaderImagePath;
  38. /// <summary>
  39. /// Modulate the header image by this color
  40. /// </summary>
  41. [DataField("headerImageModulate")]
  42. public Color HeaderImageModulate = Color.White;
  43. /// <summary>
  44. /// Any additional margin to add around the header
  45. /// </summary>
  46. [DataField("headerMargin")]
  47. public Box2 HeaderMargin = default;
  48. /// <summary>
  49. /// Path to an image to use as the background to the "content" of the paper
  50. /// The header and actual written text will use this as a background. The
  51. /// image will be tiled vertically with the property that the bottom of the
  52. /// written text will line up with the bottom of this image.
  53. /// </summary>
  54. [DataField("contentImagePath")]
  55. public string? ContentImagePath;
  56. /// <summary>
  57. /// Modulate the content image by this color
  58. /// </summary>
  59. [DataField("contentImageModulate")]
  60. public Color ContentImageModulate = Color.White;
  61. /// <summary>
  62. /// An additional margin around the content (including header)
  63. /// </summary>
  64. [DataField("contentMargin")]
  65. public Box2 ContentMargin = default;
  66. /// <summary>
  67. /// The number of lines that the content image represents. The
  68. /// content image will be vertically tiled after this many lines
  69. /// of text.
  70. /// </summary>
  71. [DataField("contentImageNumLines")]
  72. public int ContentImageNumLines = 1;
  73. /// <summary>
  74. /// Modulate the style's font by this color
  75. /// </summary>
  76. [DataField("fontAccentColor")]
  77. public Color FontAccentColor = new Color(223, 223, 213);
  78. /// <summary>
  79. /// This can enforce that your paper has a limited area to write in.
  80. /// If you wish to constrain only one direction, the other direction
  81. /// can be unlimited by specifying a value of zero.
  82. /// This will be scaled according to UI scale.
  83. /// </summary>
  84. [DataField("maxWritableArea")]
  85. public Vector2? MaxWritableArea = null;
  86. }