GUI Style inconsitencies

Place to report issues and suggest improvements to the API documentation.
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 268
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

GUI Style inconsitencies

Post by Osmo »

LuaStyle::clicked_vertical_offset is uint32, but documented as int32. Prototype docs are correct.
LuaStyle *_padding and *_margin properties are int16, but documented as int32. Prototype docs are correct, except for ScrollPaneStyleSpecification properties extra_..._when_activated.
ButtonStyleSpecification::draw_grayscale_picture defaults to false. Other optional properties are inherited from parents, and can be mandatory on root styles, but not this one.
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 342
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: GUI Style inconsitencies

Post by Therenas »

Thanks for the report, fixed for the next release. The extra ones are indeed 32 bit though, so prototype docs are all correct.

One thing I don't quite get though is your remark about draw_grayscale_picture. I can't see any special handling of that in the code, can you explain what you mean again?
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 268
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: GUI Style inconsitencies

Post by Osmo »

Therenas wrote: Wed Apr 22, 2026 7:53 am One thing I don't quite get though is your remark about draw_grayscale_picture. I can't see any special handling of that in the code, can you explain what you mean again?
Most properties of style specifications are marked as optional because properties that are not set are inherited from parent and root styles. And that is documented:
... for root styles, some style properties are mandatory ...
I think font of a LabelStyle is one example, where it is mandatory on the root style.
As they must be specified, they can't have a default value.

But some properties are truly optional, like all the padding and margin properties. They are documented to default to 0. draw_grayscale_picture is also truly optional, but it is not specified what it defaults to.
I think its far from the only such property, but its one i encountered because it can also be set at runtime.
Here's a list of other properties that seem truly optional and don't have default specified, though i haven't verified that is the case:

https://lua-api.factorio.com/latest/typ ... underlined defaults to false
https://lua-api.factorio.com/latest/typ ... aw_borders
https://lua-api.factorio.com/latest/typ ... go_outside
https://lua-api.factorio.com/latest/typ ... r_contents

https://lua-api.factorio.com/latest/typ ... _by_search and https://lua-api.factorio.com/latest/typ ... _by_search, but those aren't really relevant to modders.
Post Reply

Return to “Documentation Improvement Requests”