Page 1 of 1
order of mods in gui
Posted: Mon Mar 07, 2016 11:20 pm
by binbinhfr
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.
Re: order of mods in gui
Posted: Tue Mar 08, 2016 12:57 am
by DaveMcW
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.
Re: order of mods in gui
Posted: Tue Mar 08, 2016 1:17 am
by Supercheese
DaveMcW wrote:I think eventually the modders will agree to cooperate and make a gui manager mod, but we are not there yet.
I'm intrigued by this statement; how would such a mod work?
Re: order of mods in gui
Posted: Tue Mar 08, 2016 1:28 am
by DaveMcW
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.
Re: order of mods in gui
Posted: Tue Mar 08, 2016 9:16 am
by binbinhfr
In
https://wiki.factorio.com/index.php?tit ... g_overview you can read :
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.
So, the order in this file has a meaning. But more for charging prototypes.
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.