LiveSplit / livesplit-core

livesplit-core is a library that provides a lot of functionality for creating a speedrun timer.
https://livesplit.org/
Apache License 2.0
210 stars 57 forks source link

[ASR] Add duration variable type (+ maybe more) #694

Open apple1417 opened 1 year ago

apple1417 commented 1 year ago

Currently, variables can only be set to strings. This means all scripts each need to pull in some string formatting library if they want to use another type. While this isn't really a massive problem, it would be nice if some more types were exposed, so livesplit could handle it all in one place.

The one type in particular which could benefit greatly is durations. There's currently no way for a script to know the main timer format (nor do I think there should be), so if a script does it's own formatting it might look very different. Livesplit also already has a lot of timer formatting settings which could be reused.

If we're going to add a new variable type for durations, it might be worth also adding ones for [u]ints, doubles, and bools too, to flesh out all the primitives.

CryZe commented 1 year ago

Yeah this was always the plan. When I added variables I wanted to have an MVP implementation first and then later extend it.