Mods that add gui's can be a nightmare, they are created on a first come first serve basis, So I propose this slight change to way Gui's are added:
A main flow needs to be defined in the data stage something like this
{
type = "mod-gui-flow"
name = "flow_name"
-- direction is inherited from location when used
}
When a mod wants to add a new gui to the root gui it needs to be added with the additional mod-gui-flow
player.gui.top.flow_name.add{}
Now you are probably thinking, what it the world is the point of this!
Well let say MOD-B wants its buttons to next to MOD-A if MOD-A is installed
Both mods would define the same mod-gui-flow.flow_name and anytime the buttons are added they will be attached to the mod-flow. Since it is defined in the data stage it would be just like the top level flows and always available.
Anyways just some rambling, let me know what you think!
GUI's should be attached to a main flow prototype
Moderator: ickputzdirwech
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: GUI's should be attached to a main flow prototype
Hmmm. Surely the two mods could just do that manually anyway? Then whichever loads first (which can be controlled by dependencies in info.json) ends up creating the relevant flow - the other mod then checks to see if the flow exists (if not it creates it) and puts its stuff in the flow.
Personally I'd rather the devs work on a way to allow re-ordering of child elements for a given parent.
Personally I'd rather the devs work on a way to allow re-ordering of child elements for a given parent.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: GUI's should be attached to a main flow prototype
If both mods are made by the same person or have some agreed upon gui standard that would work.
But in the current instance mod-a could .destroy and unless mod-b has a lot of error checking code mod-b is now broken or throwing errors. Since the container it is attached to doesn't exist
But in the current instance mod-a could .destroy and unless mod-b has a lot of error checking code mod-b is now broken or throwing errors. Since the container it is attached to doesn't exist