Skip to content

Countdown improvements#56

Merged
ElChupos merged 13 commits intoFacepunch:masterfrom
Kulltero:CountdownImprovements
Jul 22, 2024
Merged

Countdown improvements#56
ElChupos merged 13 commits intoFacepunch:masterfrom
Kulltero:CountdownImprovements

Conversation

@Kulltero
Copy link
Contributor

Improving the Countdown Component

Changed the countdown component to be useful for any counting/timer operation by supporting float parameters
fully ensuring backwards compatibility (as JSON auto converts ints to float)
added optional interval component to seperately control update rate from step amount
added optional destroyIfDone parameter (defaults to true to maintain old behaviour), allows keeping the timer text arround after its finished counting
added timerFormat enum that formats the number into a variety of timer presets
added numberFormat option to be passed into the ToString() function

TimerExample.mp4
public enum TimerFormat {
   None, // Default => applies numberFormat to the number directly
   SecondsHundreth, // 30.653 => "30.65"
   MinutesSeconds, // 97.324 => "01:37"
   MinutesSecondsHundreth, // 97.324 => "01:37.32"
   HoursMinutes, // 3845.45 => "01:04"
   HoursMinutesSeconds // 3845.45 => "01:04:05"
}

Kulltero added 5 commits May 17, 2023 04:10
adds the ability to format the number as a timer with various presets
if panels are expected to be found by name then the name should be unique by default, the Countdown component requires this because it now re-uses the DestroyPanel function from the main class, but other branches like the animation branch benefit from this aswell
Kulltero added 4 commits July 8, 2024 00:34
switch to using InvokeHandler based Invokes to avoid FP's client hashing from breaking text invokes, its possible nameof could have worked but i dont know enough about their build step to confirm that
undo invoke changes as there is a fix for string based invokes
@DezLife
Copy link
Contributor

DezLife commented Jul 16, 2024

@ElChupos

Removed the new GUID for every unnamed component - this broke our internal community UI test and would have likely posed issues for general back compatibility
Some minor formatting changes

Thanks for the PR!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants