Style booleans - "on" vs "true"

Place to get help with not working mods / modding interface.
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 183
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Style booleans - "on" vs "true"

Post by moon69 »

hi,

I'm confused about the following style properties...
LuaStyle.horizontally_stretchable
LuaStyle.stretch_image_to_widget_size

Both are defined boolean, but horizontally_stretchable expects "on" and stretch_image_to_widget_size expects true.

Code: Select all

local style = data.raw["gui-style"].default

style.style_Beast_button_stretch =
{
    type = "button_style",
    horizontally_stretchable = "on",
}

style.style_test_image =
{
    type = "image_style",
    stretch_image_to_widget_size = true,
}
The above code works, but if I change horizontally_stretchable to true, I get load error:
Unknown stretch rule value

Why is this!?

Bilka
Factorio Staff
Factorio Staff
Posts: 3308
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Style booleans - "on" vs "true"

Post by Bilka »

moon69 wrote:
Tue Oct 01, 2019 6:58 pm
hi,

I'm confused about the following style properties...
LuaStyle.horizontally_stretchable
LuaStyle.stretch_image_to_widget_size

Both are defined boolean, but horizontally_stretchable expects "on" and stretch_image_to_widget_size expects true.

Why is this!?
Because you're looking at the doc for runtime scripting but applying it to the data stage. Here is the data stage doc: https://wiki.factorio.com/Types/StyleSp ... tretchable - the property has 3 options, so it is a string.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 183
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Re: Style booleans - "on" vs "true"

Post by moon69 »

Thanks Bilka.

Post Reply

Return to “Modding help”