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

Place to get help with not working mods / modding interface.
Post Reply
Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

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

Post 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.
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

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

Post 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.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

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

Post 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 :)
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

User avatar
eradicator
Smart Inserter
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?

Post 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 ;).
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.


Post Reply

Return to “Modding help”