using Robust.Shared.GameStates; namespace Content.Shared.Alert.Components; /// /// This is used for an alert which simply displays a generic number over a texture. /// [RegisterComponent, NetworkedComponent] public sealed partial class GenericCounterAlertComponent : Component { /// /// The width, in pixels, of an individual glyph, accounting for the space between glyphs. /// A 3 pixel wide glyph with one pixel of space between it and the next would be a width of 4. /// [DataField] public int GlyphWidth = 6; /// /// Whether the numbers should be centered on the glyph or just follow a static position. /// [DataField] public bool CenterGlyph = true; /// /// Whether leading zeros should be hidden. /// If true, "005" would display as "5". /// [DataField] public bool HideLeadingZeroes = true; /// /// The size of the alert sprite. /// Used to calculate offsets. /// [DataField] public Vector2i AlertSize = new(32, 32); /// /// Digits that can be displayed by the alert, represented by their sprite layer. /// Order defined corresponds to the digit it affects. 1st defined will affect 1st digit, 2nd affect 2nd digit and so on. /// In this case ones would be on layer "1", tens on layer "10" etc. /// [DataField] public List DigitKeys = new() { "1", "10", "100", "1000", "10000" }; } /// /// Event raised to gather the amount the alert will display. /// /// The alert which is currently requesting an update. /// The number to display on the alert. [ByRefEvent] public record struct GetGenericAlertCounterAmountEvent(AlertPrototype Alert, int? Amount = null) { public bool Handled => Amount.HasValue; }