Page 1 of 1

[2.1.12] LuaGuiElement clicked_sprite and hovered_sprite overwrite each other

Posted: Tue Aug 04, 2026 11:54 am
by Osmo
Steps to reproduce:

Code: Select all

/c button = game.player.gui.screen.add{type = "sprite-button"}
/c button.sprite = "utility/close"
/c button.hovered_sprite = "utility/add"
At this point both hovering and clicking use the "utility/add" icon. This is fine as clicked_sprite is not set.

Code: Select all

/c button.clicked_sprite = "utility/search"
Now, both clicking and hovering shows "utility/search" icon, which is incorrect because hovered_sprite is still set to "utility/add".
Setting clicked and hovered in a different order also results in this issue.
the button is hovered, not clicked, but shows the clicked_sprite
the button is hovered, not clicked, but shows the clicked_sprite
изображение.png (1.08 MiB) Viewed 158 times

Re: [2.1.12] LuaGuiElement clicked_sprite and hovered_sprite overwrite each other

Posted: Tue Aug 04, 2026 12:37 pm
by Shemp
I'll add that in the above example, button.hovered_sprite would be readable from Lua as "utility/add" despite not being displayed on the button.

In Factorio 1.1.110, clicked_sprite and hovered_sprite are completely distinct from each other, but there is no default assignment behaviour between them. Leaving either of these values blank will cause them to show the sprite-button's standard "sprite".

Re: [2.1.12] LuaGuiElement clicked_sprite and hovered_sprite overwrite each other

Posted: Tue Aug 04, 2026 1:22 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.