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.
What is the difference between discrete_slider and discrete_values in a LuaGuiElement slider?
What is the difference between discrete_slider and discrete_values in a LuaGuiElement slider?
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: What is the difference between discrete_slider and discrete_values in a LuaGuiElement slider?
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?
Documenting it as 'this does nothing' or removing all references to it are both better than just listing it with no explanation imo
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: What is the difference between discrete_slider and discrete_values in a LuaGuiElement slider?
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 ;).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.