ox_lib
ox_lib copied to clipboard
[Suggestion] ProgressBar as an input
Is your feature request related to a problem? Please describe. Progress Bar is cool. But progress bar can't be used as an 'input' (really bad way of saying that please bear with me)
Describe the solution you'd like A progress bar, where you can specify a 'tickrate' (update status every x ms), modify the label on each tick, return the current progress on cancel and set a start, end and step.
So you could basically say
- start at 0,
- end at 69,
- step/tick = 6.9
- tick = 250
- every 250ms
- currentStep goes up by 6.9
- the progressBar fills up by end / step/tick, so 10% in this case.
- update the label
- the labels could contain patterns, with currentStep, end i.e
'Your progress is 27.6/69' - or label could be a function, so you can use values (start, end, step, currentStep) and do whatever you want* with them)
- the labels could contain patterns, with currentStep, end i.e
- If you cancel
- return the currentStep (shouldn't be a breaking change i guess? if your code wasn't made for that it won't return a number anyway)
Either (somehow, i don't really see how you'd do that) allow it for the normal lib.progressBar or add a new lib.[insert name]
Additional context Would be nice for ox_fuel, allow the player to choosee, instead of the very binary "i'm too poor for the full tank" or "I pay for tank, i fill tank"
Something like this would probably warrant a new component as the behavior would differ too much to the current progress bar, but I do like the idea.