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

This subforum contains all the issues which we already resolved.
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 380
Joined: Tue Jul 08, 2014 10:06 am
Contact:

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

Post 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 3405 times
factorio_ARidlB0vNU.png
factorio_ARidlB0vNU.png (1.27 MiB) Viewed 3405 times
Greetz,

Luzifer
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai
Rseding91
Factorio Staff
Factorio Staff
Posts: 14594
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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 ...
If you want to get ahold of me I'm almost always on Discord.
User avatar
LuziferSenpai
Filter Inserter
Filter Inserter
Posts: 380
Joined: Tue Jul 08, 2014 10:06 am
Contact:

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

Post 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 3255 times
Coding is awesome!
Animes are love!
Factorio is life!

My MODs:
Click

Greetz,

Senpai
Rseding91
Factorio Staff
Factorio Staff
Posts: 14594
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

Thanks for the report. It's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”