violin-suzutsuki / LinoriaLib

MIT License
51 stars 315 forks source link

Slider:SetMax(Value) and Slider:SetMin(Value) #32

Closed notpoiu closed 1 year ago

notpoiu commented 1 year ago

should work but i did not test since i made this on a school computer :/

deividcomsono commented 1 year ago

fr fr

violin-suzutsuki commented 1 year ago

looks fine to me but could you add a bounds check? i.e. making sure you can't set Min above the current maximum and vice-versa

notpoiu commented 1 year ago

alright

notpoiu commented 1 year ago

i tested and it works if you want you can change how you handle the error.

violin-suzutsuki commented 1 year ago

merged into dev, i'm unsure of the use case here but i imagine that the save manager will need to be extended to support saving the slider min/max

notpoiu commented 1 year ago

merged into dev, i'm unsure of the use case here but i imagine that the save manager will need to be extended to support saving the slider min/max

im using this for my doors script and i use Slider:SetMax() to increase the speed boost slider after enabling the Speed Bypass Toggle, but im not sure why we would need extended support for saving the min/max unless they dont set back the max to default or something...

violin-suzutsuki commented 1 year ago

@notpoiu that's fine then, the toggle will get loaded by the save manager first (then :OnChanged() gets called and in turn :SetMax() gets called) and then the slider will get loaded after that

however, if the slider :SetMax() depends on another option (i.e. a dropdown or another slider) the save manager load order isn't guaranteed

https://github.com/violin-suzutsuki/LinoriaLib/issues/34