Page 1 of 1

What is the difference between discrete_slider and discrete_values in a LuaGuiElement slider?

Posted: Sat Sep 05, 2020 2:36 pm
by Xorimuth
See https://lua-api.factorio.com/latest/Lua ... lement.add under "slider"
Neither discrete_slider nor discrete_values have an explanation and from my testing, they both set the slider to have discrete values (as dictated by 'value_step').

Is there a difference between the two?

Edit: https://lua-api.factorio.com/latest/Lua ... ete_slider has some more info, but it is still not that clear.

Re: What is the difference between discrete_slider and discrete_values in a LuaGuiElement slider?

Posted: Fri May 21, 2021 11:46 am
by Therenas
From my testing, discrete_slider does not do anything at all, only the value of discrete_values matters. The solution is to remove it from the API, but as that's a breaking change, it's a bit more of a delicate affair. I'll see about that though. I noticed this a while ago, but documenting it as 'this does nothing' does not feel like the way to go.

Re: What is the difference between discrete_slider and discrete_values in a LuaGuiElement slider?

Posted: Fri May 21, 2021 12:07 pm
by Xorimuth
Documenting it as 'this does nothing' or removing all references to it are both better than just listing it with no explanation imo :)

Re: What is the difference between discrete_slider and discrete_values in a LuaGuiElement slider?

Posted: Fri May 21, 2021 12:07 pm
by eradicator
Therenas wrote:
Fri May 21, 2021 11:46 am
but documenting it as 'this does nothing' does not feel like the way to go.
Sounds like a good intermediate "fix" to me until it gets removed. At least then nobody has to waste time or headaches on it anymore ;).

Re: What is the difference between discrete_slider and discrete_values in a LuaGuiElement slider?

Posted: Fri May 21, 2021 12:29 pm
by Therenas
I'll look into it.