LuaGuiElement.bring_to_front()

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Honktown
Filter Inserter
Filter Inserter
Posts: 737
Joined: Thu Oct 03, 2019 7:10 am
Contact:

LuaGuiElement.bring_to_front()

Post by Honktown »

As it is now, it looks like gui elements view-order / layering is dependent on add() order. It'd be nice if when a guielement (stored in screen) is clicked on or dragged, the topmost parent was "brought to front", without changing anything about the children. This could be done manually if a function was exposed, or done automatically. I don't think many people would argue with the logic "you clicked on that gui or something in it, you probably would like to see that gui". If only the click or select events were explicitly watched, then a player could still hit hotkeys for visibility and guielements could update without the view-order changing.

Edit: Hadn't updated to 0.18.23! Need to check it out:

"Clicking a GUI now brings it to the front. Most noticeable when using the map editor or debug GUIs where they overlap."
I have mods! I guess!
Link

User avatar
Therenas
Fast Inserter
Fast Inserter
Posts: 183
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: LuaGuiElement.bring_to_front()

Post by Therenas »

I think we need this more than ever now. Meaning the ability to programmatically simulate a user's click on a window. Before, we could rely on the inherent, unchangable ordering of the window to make pop-up windows and such work. Now, we can't be sure which window is in front for the user, so we can't really do that. Would this be possible in a deterministic way?

Might also make sense to have .focus() do this, since it doesn't do anything on frames right now. Doesn't really matter I guess.

Edit: To expand on this after thinking about it some more, I see it this way: There are two things related to this: Knowing the state, and being able to influence it. (State being the layering of the windows) Before the ability to bring windows to the front, we couldn't directly influence the state, but we could infer, ie know, it because we know the order we created them in. Now, we now neither the state, because the user can change it without us knowing, and we can't influence it either.

So, to be able to get it working the way it did before, we either need to be able to read the state of the layering, meaning which window is at the bottom, which is at the top etc, or we need to be able to change it, meaning bringing a window to the front or similar. I would vastly prefer the ability to bring them to the front, but either works, technically.

User avatar
ownlyme
Filter Inserter
Filter Inserter
Posts: 392
Joined: Thu Dec 21, 2017 8:02 am
Contact:

Re: LuaGuiElement.bring_to_front()

Post by ownlyme »

readable and changeable layering order is probably *allegedly* not deterministic, but any method of bringing our frames to the front would be welcome.
mods.factorio.com/user/ownlyme
My requests: uiAbove||Grenade arc||Blueprint allies||Creeps forget command/ don't get removed||Player Modifiers||textbox::selection||Better Heat IF||Singleplayer RCON||tank bug w/ min_range >= projectile_creation_distance

『 』
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Aug 29, 2020 4:17 pm
Contact:

Re: LuaGuiElement.bring_to_front()

Post by 『 』 »

Please make the mod great again! This is a very nice mod so please revive it!

Post Reply

Return to “Modding interface requests”

Who is online

Users browsing this forum: No registered users