Adding the ability to force open a different entity's GUI
-
- Burner Inserter
- Posts: 6
- Joined: Fri Aug 11, 2017 2:02 am
- Contact:
Re: Adding the ability to force open a different entity's GUI
Did something happen to player.opened?
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Adding the ability to force open a different entity's GUI
Either be helpful and civil or don't post. No-one wants your vinegar.
-
- Burner Inserter
- Posts: 6
- Joined: Fri Aug 11, 2017 2:02 am
- Contact:
Re: Adding the ability to force open a different entity's GUI
I see that player.opened is there. Do I just set it equal to the entity from some event?
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Adding the ability to force open a different entity's GUI
It doesn't have to be the entity from an event but it can be. If you set it to a LuaEntity and that entity actually has a GUI, any currently open entity GUI will be closed and the given entity's GUI opened (raising on_gui_opened, so avoid getting stuck in a loop there).orangedude27 wrote: Tue Dec 12, 2023 2:38 pm I see that player.opened is there. Do I just set it equal to the entity from some event?
Be aware that in previous versions of Factorio there was some latency for non-hosting players if you change player.opened in on_gui_opened in order to cancel one gui and open another. I haven't tested it recently but I assume it hasn't changed. It's nothing breaking, just an irritation, and doesn't affect single player games.
-
- Burner Inserter
- Posts: 6
- Joined: Fri Aug 11, 2017 2:02 am
- Contact:
Re: Adding the ability to force open a different entity's GUI
Ok cool,
So based on that then, and what I've read in the docs, you can't multiple gui menus open originating from two different entities? What would be cool is either the ability to make a composite GUI element, or to just have multiple active GUIs. Maybe it is possible and I just lack the knowledge to do so. Any help is welcomed.
So based on that then, and what I've read in the docs, you can't multiple gui menus open originating from two different entities? What would be cool is either the ability to make a composite GUI element, or to just have multiple active GUIs. Maybe it is possible and I just lack the knowledge to do so. Any help is welcomed.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Adding the ability to force open a different entity's GUI
You can't have multiple entity GUIs open at once. You can have multiple custom GUIs however. When you say "composite GUI" I don't know exactly what you mean but the first things that springs to mind is relative GUIs. These are GUI elements that you can attach to any of the four sides of a vanilla GUI, including specific entity GUIs:
https://github.com/ClaudeMetz/UntitledG ... nilla-GUIs
https://github.com/ClaudeMetz/UntitledG ... nilla-GUIs
-
- Burner Inserter
- Posts: 6
- Joined: Fri Aug 11, 2017 2:02 am
- Contact:
Re: Adding the ability to force open a different entity's GUI
So let's say I already have one inserter GUI open, would this allow me to open the "unselectable" entity's GUI as a relative GUI or is this specific to only mod-based GUIs? or would i need to recreate that as a relative gui element?
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Adding the ability to force open a different entity's GUI
Relative GUIs can only be custom GUIs, yes. You can't open an entity GUI and give it another entity GUI as the anchor.
If you want one GUI to open which can control aspects of both inserters then yes, either you will need to create a completely new custom GUI with controls that affect both of them, or create a custom relative GUI that attaches to the first inserter's native GUI with controls that change whatever properties of the second inserter you're interested in.
If you want one GUI to open which can control aspects of both inserters then yes, either you will need to create a completely new custom GUI with controls that affect both of them, or create a custom relative GUI that attaches to the first inserter's native GUI with controls that change whatever properties of the second inserter you're interested in.
-
- Burner Inserter
- Posts: 6
- Joined: Fri Aug 11, 2017 2:02 am
- Contact:
Re: Adding the ability to force open a different entity's GUI
Ok so the options are, to start from scratch, or do a half and half (half native and half relative).Deadlock989 wrote: Tue Dec 12, 2023 3:43 pm or create a custom relative GUI that attaches to the first inserter's native GUI with controls that change whatever properties of the second inserter you're interested in.
So then I guess my requested feature is more along the lines of: Allowing multiple GUIs to be opened at once, which is beyond the scope of this thread, probably?