[1.1.74] List-box not scrolling to index while in "on_configuration_changed"

Post your bugs and problems so we can fix them.
Post Reply
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Jan 17, 2023 12:04 pm

[1.1.74] List-box not scrolling to index while in "on_configuration_changed"

Post by sfyb »

When creating a "list-box" gui element in the "script.on_configuration_changed" event this list-box cannot be scrolled (scroll_to_item) in the same event.

Obligatory expected result: The "list-box" gui element should scroll to the requested index

I did not test if this applies to more circumstances than that. (Meaning stuff like: "Can the list-box be created earlier?" or "Can the list-box scroll if there is enough time in between list-box creation and scroll_to_item" )

Here is a small mod that shows this bug in action (Note: You need to load a save that did not contain this mod before in order to trigger the "script.on_configuration_changed" event)
If this mod created the gui you should see two chat messages and a "list-box" gui element in the top left like this:
chat_messages.png (41.35 KiB) Viewed 230 times
list_box.png (14.65 KiB) Viewed 230 times
Factorio Scroll Bug.zip
(1008 Bytes) Downloaded 14 times

Factorio Staff
Factorio Staff
Posts: 12578
Joined: Wed Jun 11, 2014 5:23 am

Re: [1.1.74] List-box not scrolling to index while in "on_configuration_changed"

Post by Rseding91 »

Note to other developers: this is due to the actual GUI widget not existing at the time this event runs.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Bug Reports”