From be762f48f0df23bacfd6d9a831dfe1e02e9dd8ed Mon Sep 17 00:00:00 2001 From: Oleg <69988794+DezLife@users.noreply.github.com> Date: Mon, 22 Jul 2024 23:52:47 +0300 Subject: [PATCH] Improved Countdown support --- src/RustCui.cs | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/RustCui.cs b/src/RustCui.cs index 6f583a31e..ff4426994 100644 --- a/src/RustCui.cs +++ b/src/RustCui.cs @@ -403,19 +403,42 @@ public class CuiCountdownComponent : ICuiComponent public string Type => "Countdown"; [JsonProperty("endTime")] - public int EndTime { get; set; } + public float EndTime { get; set; } [JsonProperty("startTime")] - public int StartTime { get; set; } + public float StartTime { get; set; } [JsonProperty("step")] - public int Step { get; set; } + public float Step { get; set; } + + [JsonProperty("interval")] + public float Interval { get; set; } + + [JsonConverter(typeof(StringEnumConverter))] + [JsonProperty("timerFormat")] + public TimerFormatEnum TimerFormat { get; set; } + + [JsonProperty("numberFormat")] + public string NumberFormat { get; set; } + + [JsonProperty("destroyIfDone")] + public bool DestroyIfDone { get; set; } [JsonProperty("command")] public string Command { get; set; } [JsonProperty("fadeIn")] public float FadeIn { get; set; } + + public enum TimerFormatEnum + { + None, + SecondsHundreth, + MinutesSeconds, + MinutesSecondsHundreth, + HoursMinutes, + HoursMinutesSeconds + } } public class CuiNeedsCursorComponent : ICuiComponent