Hi,
is there a way to force a mod (let's say a "clock") to be the first one at the left in the gui.top row ?
Or to manage mod display order in general ?
thanks for your help.
order of mods in gui
order of mods in gui
My mods on the Factorio Mod Portal 

Re: order of mods in gui
You can force a mod to the right, by making it depend on all the mods before it.
I think eventually the modders will agree to cooperate and make a gui manager mod, but we are not there yet.
I think eventually the modders will agree to cooperate and make a gui manager mod, but we are not there yet.
-
- Filter Inserter
- Posts: 841
- Joined: Mon Sep 14, 2015 7:40 am
- Contact:
Re: order of mods in gui
I'm intrigued by this statement; how would such a mod work?DaveMcW wrote:I think eventually the modders will agree to cooperate and make a gui manager mod, but we are not there yet.
Re: order of mods in gui
Every mod does the following:
1. Implement the show_gui() and hide_gui() remote calls.
2. Register itself with the gui manager mod.
The gui manager then calls show_gui() and hide_gui() to sort the mods.
The hardest part of the project is writing sample code and tech support to convince modders to join.
1. Implement the show_gui() and hide_gui() remote calls.
2. Register itself with the gui manager mod.
The gui manager then calls show_gui() and hide_gui() to sort the mods.
The hardest part of the project is writing sample code and tech support to convince modders to join.
Re: order of mods in gui
In https://wiki.factorio.com/index.php?tit ... g_overview you can read :
And I am not sure that this order is conserved when you toggle mods on/off because this file is then rewrittent by factorio.
But maybe in LuaGuiElement.add{type=…, name=…, style=…} we could have a variable {insert=..} with a value "first" or "end", that would insert the guielement at the beginning or at the end of the parent's list ? By default, this value should be "end" to keep the original behaviour.
So, the order in this file has a meaning. But more for charging prototypes.The mods overview is given in the mods/mod-list.json file. The ordering of the mods matters. Mods later in the list have access to prototypes defined by earlier mods. Also when running mod scripts the scripts of earlier mods are run before the latter ones. The mods settings are loaded on the game startup. Only the mods with "enable" value will be used for the run of the game. The game discovers new mods (directories) that are not in the list and automatically adds them to the list to the end ordered by name. There is a setting value to automatically enable auto discovered mods in Other settings. The mod settings can be changed via the Mods Menu (Main Menu > Mods). You can enable / disable the mods and change their ordering. The settings will apply after the game restart.
And I am not sure that this order is conserved when you toggle mods on/off because this file is then rewrittent by factorio.
But maybe in LuaGuiElement.add{type=…, name=…, style=…} we could have a variable {insert=..} with a value "first" or "end", that would insert the guielement at the beginning or at the end of the parent's list ? By default, this value should be "end" to keep the original behaviour.
My mods on the Factorio Mod Portal 
