Set ignored_by_interaction without setting it on children

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 682
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Set ignored_by_interaction without setting it on children

Post by raiguard »

I am (ab)using a flow to position a GUI in the bottom-right of the screen. I need this GUI to have a dynamic height, so what I ended up doing was putting it in a flow with a pusher above it, then setting the height of that flow to the height of the screen:
Screenshot from 2021-06-12 19-15-11.png
Screenshot from 2021-06-12 19-15-11.png (18.56 KiB) Viewed 1981 times
It works remarkably well! ...Except for one problem: the flow blocks everything behind it from being clicked. It makes it impossible to use the top menu and click any entities in this portion of the screen.

So I would love a way to define ignored_by_interaction on the flow specifically, without setting it on the children as well - I need the GUI within the flow to be intractable.

Thank you!
Don't forget, you're here forever.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Set ignored_by_interaction without setting it on children

Post by eradicator »

Why can't you just use LuaGuiElement.location?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 682
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: Set ignored_by_interaction without setting it on children

Post by raiguard »

I am using it for the X position. I can't use it for the Y position unless I hardcode the height of the GUI, which won't play well with how this GUI is going to work. It needs to dynamically stretch up and down based on its content.
Don't forget, you're here forever.
PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Set ignored_by_interaction without setting it on children

Post by PFQNiet »

What happens if you set the flow's width to zero and then apply negative left margin to the frame itself?
curiosity
Filter Inserter
Filter Inserter
Posts: 587
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Set ignored_by_interaction without setting it on children

Post by curiosity »

I would also like to see this. Right now nesting interactive elements with any control over their alignment is practically impossible.
curiosity
Filter Inserter
Filter Inserter
Posts: 587
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Set ignored_by_interaction without setting it on children

Post by curiosity »

There is a blatant example of this already existing in the game engine: the entity windows that have the little circuit/logistics windows attached to them. All these windows are collectively in a single frame that's ignored by interactions, though obviously the windows themselves aren't.

Please expose this capability to mods.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15013
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Set ignored_by_interaction without setting it on children

Post by Rseding91 »

curiosity wrote: Thu Jun 13, 2024 1:36 pm There is a blatant example of this already existing in the game engine: the entity windows that have the little circuit/logistics windows attached to them. All these windows are collectively in a single frame that's ignored by interactions, though obviously the windows themselves aren't.

Please expose this capability to mods.
This is done with frames having a special bit of logic that says "I am transparent, don't interact with me" if the style type is "none". It has nothing to do with the "ignored_by_interaction" part and can also be used by mods. Simply make a frame with the base graphics set type of "none" (aka don't define it) and it will be transparent/not interactable but content in the frame is interactable.
If you want to get ahold of me I'm almost always on Discord.
curiosity
Filter Inserter
Filter Inserter
Posts: 587
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Set ignored_by_interaction without setting it on children

Post by curiosity »

Rseding91 wrote: Thu Jun 13, 2024 6:10 pm This is done with frames having a special bit of logic that says "I am transparent, don't interact with me" if the style type is "none". It has nothing to do with the "ignored_by_interaction" part and can also be used by mods. Simply make a frame with the base graphics set type of "none" (aka don't define it) and it will be transparent/not interactable but content in the frame is interactable.
Also seems to be the case with flows. Any other elements with this behavior?

But then does this request predate this behavior? Or why else would the OP have a problem when his flows don't have graphics?
Post Reply

Return to “Modding interface requests”