Facepunch / Rust.Community

Community Entity to fill Server Side modder requests
MIT License
46 stars 21 forks source link

Countdown improvements #46

Closed Kulltero closed 1 year ago

Kulltero commented 2 years ago

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 formatting option to be passed into the ToString() function

these small changes allow the countdown component to be used for new things while maintaining complete backwards compatibility. here are some examples: Legacy Countdown Style CropLegacyCountdown Adding faster Update interval & decimals! CropFasterCountdown Practical Use case, see your points going up CropPointCountdown Hehe.gif CropTimerCountdown