From 3a84f59fff63940fddccc8fb394686c2a2a6e37e Mon Sep 17 00:00:00 2001 From: Hannele Ruiz Date: Wed, 2 Oct 2024 00:36:49 -0300 Subject: [PATCH] Added support for custom colors Closes #189 --- LemonUI/Scaleform/Countdown.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/LemonUI/Scaleform/Countdown.cs b/LemonUI/Scaleform/Countdown.cs index 8d33eb9..d724c65 100644 --- a/LemonUI/Scaleform/Countdown.cs +++ b/LemonUI/Scaleform/Countdown.cs @@ -10,6 +10,7 @@ using GTA; #endif using System; +using System.Drawing; namespace LemonUI.Scaleform { @@ -71,6 +72,14 @@ public int Duration /// The current count. /// public int Current { get; private set; } + /// + /// The color used for the numbers. + /// + public Color ColorNumbers { get; set; } = Color.FromArgb(255, 255, 255); + /// + /// The color used for the GO at the end. + /// + public Color ColorGo { get; set; } = Color.FromArgb(255, 255, 255); #endregion @@ -103,9 +112,10 @@ public Countdown() : base("COUNTDOWN") private void ShowStep(int step) { string asString = step == 0 ? "GO" : step.ToString(); + Color color = step == 0 ? ColorGo : ColorNumbers; - CallFunction("SET_MESSAGE", asString, 255, 255, 255, true); - CallFunction("FADE_MP", asString, 255, 255, 255); + CallFunction("SET_MESSAGE", asString, (int)color.R, (int)color.G, (int)color.B, true); + CallFunction("FADE_MP", asString, (int)color.R, (int)color.G, (int)color.B); if (step == 0) {