Skip to content

Commit

Permalink
Added support for custom colors
Browse files Browse the repository at this point in the history
Closes #189
  • Loading branch information
justalemon committed Nov 23, 2024
1 parent 30ec2c1 commit 3a84f59
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions LemonUI/Scaleform/Countdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using GTA;
#endif
using System;
using System.Drawing;

namespace LemonUI.Scaleform
{
Expand Down Expand Up @@ -71,6 +72,14 @@ public int Duration
/// The current count.
/// </summary>
public int Current { get; private set; }
/// <summary>
/// The color used for the numbers.
/// </summary>
public Color ColorNumbers { get; set; } = Color.FromArgb(255, 255, 255);
/// <summary>
/// The color used for the GO at the end.
/// </summary>
public Color ColorGo { get; set; } = Color.FromArgb(255, 255, 255);

#endregion

Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 3a84f59

Please sign in to comment.