[2.1.14] CustomInputEvent has `element` but `in_gui` is false when clicking on a flow

Bugs that are actually features.
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 361
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

[2.1.14] CustomInputEvent has `element` but `in_gui` is false when clicking on a flow

Post by Osmo »

Reproduction steps:
- Install mod
osmo-test-mod2_2.1.0.zip
(853 Bytes) Downloaded 22 times
- Create debug world
- Run the following commands, in order

Code: Select all

/c flow = game.player.gui.screen.add{type = "flow"}
/c flow.style.width = 200
/c flow.style.height = 200
- Enable GUI style view tool (Ctrl + F6)
- Click on the added flow
- The event data of the custom input event is printed.

Expected result: when element is set, in_gui must also be true.
Actual result: element is set, but in_gui is false.
изображение.png
изображение.png (1.22 MiB) Viewed 245 times
Attachments
factorio-current.log
(10.25 KiB) Downloaded 15 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4921
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.1.14] CustomInputEvent has `element` but `in_gui` is false when clicking on a flow

Post by boskid »

Thanks for the report however there are no bugs here. Both values are correct: it correctly shows `element` because that element is under cursor, and it correctly states cursor is not in gui because cursor is over transparent part of the element.
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 361
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: [2.1.14] CustomInputEvent has `element` but `in_gui` is false when clicking on a flow

Post by Osmo »

I guess it makes sense since it can be clicked through, just was unexpected. Thanks for the reply.
Post Reply

Return to “Not a bug”