Closed TerminalVibes closed 1 year ago
this is probably how rounding should have worked from the start, but i don't want to break any existing scripts using the UI library. will merge at some point but will lock functionality behind a RoundingMethod
variable or something that people can set inside their CreateWindow
call
Yeah, the change is pretty breaking and would probably break most sliders on previous scripts. I feel like Example.lua
should have a comment about fetching the library from a previous commit and etc to prevent breaking changes.
closing this PR for now - will add this functionality to the dev branch but put it behind 'AddSnapSlider' - which is just a slider where the slider bar 'snaps' at set intervals
Allows the user to round to the nearest
Slider.Rounding
, (ex: Rounds down to the nearest 0.2, 10, 200, 4000, etc)It also doesn't encounter the math.round issue where there's a trailing epsilon, which can make the number appear ugly. (Such as 12.00000003)
You might want another config to account for this however, I don't think people loadstring past commits, which means they'll get the breaking changes immediately. I think all you need to do is modify the Slider.Rounding value based on the config and it will be all set.