1
0

TextScreenVisualsComponent.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System.Numerics;
  2. using Robust.Client.Graphics;
  3. namespace Content.Client.TextScreen;
  4. [RegisterComponent]
  5. public sealed partial class TextScreenVisualsComponent : Component
  6. {
  7. /// <summary>
  8. /// 1/32 - the size of a pixel
  9. /// </summary>
  10. public const float PixelSize = 1f / EyeManager.PixelsPerMeter;
  11. /// <summary>
  12. /// The color of the text drawn.
  13. /// </summary>
  14. /// <remarks>
  15. /// 15,151,251 is the old ss13 color, from tg
  16. /// </remarks>
  17. [DataField("color"), ViewVariables(VVAccess.ReadWrite)]
  18. public Color Color = new Color(15, 151, 251);
  19. /// <summary>
  20. /// Offset for centering the text.
  21. /// </summary>
  22. [DataField("textOffset"), ViewVariables(VVAccess.ReadWrite)]
  23. public Vector2 TextOffset = Vector2.Zero;
  24. /// <summary>
  25. /// Offset for centering the timer.
  26. /// </summary>
  27. [DataField("timerOffset"), ViewVariables(VVAccess.ReadWrite)]
  28. public Vector2 TimerOffset = Vector2.Zero;
  29. /// <summary>
  30. /// Number of rows of text this screen can render.
  31. /// </summary>
  32. [DataField("rows")]
  33. public int Rows = 2;
  34. /// <summary>
  35. /// Spacing between each text row
  36. /// </summary>
  37. [DataField("rowOffset")]
  38. public int RowOffset = 7;
  39. /// <summary>
  40. /// The amount of characters this component can show per row.
  41. /// </summary>
  42. [DataField("rowLength")]
  43. public int RowLength = 5;
  44. /// <summary>
  45. /// Text the screen should show when it finishes a timer.
  46. /// </summary>
  47. [DataField("text"), ViewVariables(VVAccess.ReadWrite)]
  48. public string?[] Text = new string?[2];
  49. /// <summary>
  50. /// Text the screen will draw whenever appearance is updated.
  51. /// </summary>
  52. public string?[] TextToDraw = new string?[2];
  53. /// <summary>
  54. /// Per-character layers, for mapping into the sprite component.
  55. /// </summary>
  56. [DataField("layerStatesToDraw")]
  57. public Dictionary<string, string?> LayerStatesToDraw = new();
  58. [DataField("hourFormat")]
  59. public string HourFormat = "D2";
  60. [DataField("minuteFormat")]
  61. public string MinuteFormat = "D2";
  62. [DataField("secondFormat")]
  63. public string SecondFormat = "D2";
  64. }