Page 1 of 1

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

Posted: Thu Jan 26, 2023 10:32 am
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 756 times
list_box.png
list_box.png (14.65 KiB) Viewed 756 times
Factorio Scroll Bug.zip
(1008 Bytes) Downloaded 48 times

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

Posted: Thu Jan 26, 2023 6:01 pm
by Rseding91
Note to other developers: this is due to the actual GUI widget not existing at the time this event runs.

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

Posted: Tue Dec 19, 2023 4:31 pm
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.