Page 1 of 1

[18.22] LuaGUIElement::ListBox doesnt use style in the right way

Posted: Tue May 05, 2020 2:59 am
by LuziferSenpai
Hey,

after testing around I found out that currently the List-Box Element doesnt use the style, that it gets provided.

Code: Select all

verticalflow.add{ type = "list-box", items = self.dropdowntable[1], style = "richlistbox" }

Code: Select all

s["richlistbox"] =
{
    type = "list_box_style",
    parent = "list_box",
    item_style =
    {
        type = "button_style",
        parent = "list_box_item",
        horizontal_align = "right"
    }
}
factorio_9032QICXHh.png
factorio_9032QICXHh.png (5.09 KiB) Viewed 3044 times
factorio_ARidlB0vNU.png
factorio_ARidlB0vNU.png (1.27 MiB) Viewed 3044 times
Greetz,

Luzifer

Re: [18.22] LuaGUIElement::ListBox doesnt use style in the right way

Posted: Wed May 06, 2020 9:29 pm
by Rseding91
This is actually a generic problem for any GUI element type that has sub-widgets. When updating the parent style the child elements don't reset their styles. And I think a lot of stuff relies on it working that way. If it just forced all child elements to update their styles to the new parent values it would probably break a lot of stuff.

With that in mind, I don't think this is going to be getting fixed soon, since the risk is so high all kinds of random things will break. Maybe if it could be done just when setting style through script ...

Re: [18.22] LuaGUIElement::ListBox doesnt use style in the right way

Posted: Fri May 29, 2020 11:27 am
by LuziferSenpai
Rseding91 wrote:
Wed May 06, 2020 9:29 pm
This is actually a generic problem for any GUI element type that has sub-widgets. When updating the parent style the child elements don't reset their styles. And I think a lot of stuff relies on it working that way. If it just forced all child elements to update their styles to the new parent values it would probably break a lot of stuff.

With that in mind, I don't think this is going to be getting fixed soon, since the risk is so high all kinds of random things will break. Maybe if it could be done just when setting style through script ...
Yea, well after updating the LuaGuiElement::items it accepted the right alignment.

So how to reproduce it?

Have a MP with atleast 2 Players, go into the Multiplayer Tab and then press onto reload player list(middle button at the bottom of the scroll-pane)
You need my mod for it.

Rich Text Helper

I just found that out a minute ago.
factorio_f7xOXKgB8t.png
factorio_f7xOXKgB8t.png (1.91 MiB) Viewed 2894 times

Re: [18.22] LuaGUIElement::ListBox doesnt use style in the right way

Posted: Sat Sep 19, 2020 2:30 am
by Rseding91
Thanks for the report. It's now fixed for the next release.