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

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Post Reply
sfyb
Manual Inserter
Manual Inserter
Posts: 3
Joined: Tue Jan 17, 2023 12:04 pm
Contact:

[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
chat_messages.png (41.35 KiB) Viewed 745 times
list_box.png
list_box.png (14.65 KiB) Viewed 745 times
Factorio Scroll Bug.zip
(1008 Bytes) Downloaded 47 times

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

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.

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

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

Post by Rseding91 »

I'm going to move this to minor issues. If we ever find a nice way to make this work we will but I don't see one currently.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Minor issues”