using System.Numerics;
using Content.Shared.TextScreen;
using Robust.Client.Graphics;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Client.TextScreen;
[RegisterComponent]
public sealed class TextScreenVisualsComponent : Component
{
///
/// 1/32 - the size of a pixel
///
public const float PixelSize = 1f / EyeManager.PixelsPerMeter;
///
/// The color of the text drawn.
///
[DataField("color")]
public Color Color { get; set; } = Color.FloralWhite;
///
/// Whether the screen is on.
///
[DataField("activated")]
public bool Activated;
///
/// The current mode of the screen - is it showing text, or currently counting?
///
[DataField("currentMode")]
public TextScreenMode CurrentMode = TextScreenMode.Text;
///
/// The time it is counting to or from.
///
[DataField("targetTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan TargetTime = TimeSpan.Zero;
///
/// Offset for drawing the text.
/// (0, 8) pixels is the default for the Structures\Wallmounts\textscreen.rsi
///
[DataField("textOffset"), ViewVariables(VVAccess.ReadWrite)]
public Vector2 TextOffset = new(0f, 8f * PixelSize);
///
/// The amount of characters this component can show.
///
[DataField("textLength")]
public int TextLength = 5;
///
/// Text the screen should show when it's not counting.
///
[DataField("text"), ViewVariables(VVAccess.ReadWrite)]
public string Text = "";
public string TextToDraw = "";
///
/// The different layers for each character - this is the currently drawn states.
///
[DataField("layerStatesToDraw")]
public Dictionary LayerStatesToDraw = new();
}