GUI events

Things that we aren't going to implement
Post Reply
User avatar
kumpu
Fast Inserter
Fast Inserter
Posts: 111
Joined: Wed Jun 07, 2017 10:10 am
Contact:

GUI events

Post by kumpu »

Just a few suggestions to make the gui more powerful:

Extend on_gui_click by a position parameter, x and y relative to the clicked element. Not very useful for buttons etc, but for cameras there certainly are use cases.

Add on_gui_mouse_down, on_gui_mouse_up. Contains the same as on_gui_click + position.
Add on_gui_mouse_move. Contains element, player, position.

Add on_mouse_wheel. Contains the same as the above minus button. Obviously also contains wheel delta.

Please let me know what you think ;)

doc
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Mon Mar 28, 2016 3:52 pm
Contact:

Re: GUI events

Post by doc »

I would also really like a way to check what GUI element a player's cursor is currently over. I don't think this would be an event due to the network load that could cause, but some property like player.hovered_element (similar to player.selected) would be incredibly useful. I'd like to use this to show a custom details pane when mousing over certain items in lists.

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

Re: GUI events

Post by Rseding91 »

A "hovered GUI element" would still need to send a network action every time the hovered element changed even when it wasn't being used since the GUI elements don't exist on anyones instance except the guy who sees them.
If you want to get ahold of me I'm almost always on Discord.

User avatar
kumpu
Fast Inserter
Fast Inserter
Posts: 111
Joined: Wed Jun 07, 2017 10:10 am
Contact:

Re: GUI events

Post by kumpu »

I see, so no event then. That's alright but the reason I brought this up is because I want to be able to control the camera gui elem by using the mouse. Just like the vanilla map view... So could you perhaps build that into the camera?
And what about the rest of the stuff I proposed?

doc
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Mon Mar 28, 2016 3:52 pm
Contact:

Re: GUI events

Post by doc »

Rseding91 wrote:A "hovered GUI element" would still need to send a network action every time the hovered element changed even when it wasn't being used since the GUI elements don't exist on anyones instance except the guy who sees them.
Is this particularly any more network load than updating the player.selected variable every time the player moves the cursor over a different game entity? Remember when hovering over the GUI there are no entities being selected.

Post Reply

Return to “Won't implement”