Add an event for hovering over buttons

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 232
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Add an event for hovering over buttons

Post by Therenas »

As a prelude, this is not a super necessary feature that needs to be implemented at all costs, but it could make for some nice UI experiences.
I would like to know, as a modder, when a user hovers over a gui element. Doing this for all elements might be a bit silly/performance heavy, but I feel like adding it for buttons is reasonable, especially since you can now set hovered sprites and such. I imagine it being done by adding two events, one for when the hover starts and one for when it ends.

Now one use case for this could be the following: You are presenting several options to the user, each of which will have different effects on different values. It would be really nice to have the values (which are also on screen) change on hover, so the effects can be visualised immediately, without having to actually change the value. See this as an example:

Image

This could enable other things as well, of course. Again, this is not really important, but if the goal is to make nicer GUI's, I feel like this would be a step in the right direction.

Post Reply

Return to “Modding interface requests”