PDA

View Full Version : FGU initialization sequence



Tuleen Donai
October 3rd, 2020, 18:21
I'm having some initialization issues with FGU with a Theme extension, and I'm wondering if anyone has information on how FGU initializes. Especially with the order in which things are called.

Rulesets and extensions have much in common: .xml scripts, .lua scripts, and a very similar framework. Here's what I'm looking for:


Are .xml scripts all loaded first? Or, is everything loaded first? .XML, .LUA - from all Rulsets and then from extensions before anything is executed.
Order in which things are called? like onInit().


base.xml from CoreRPG shows that .xml's are included then .lua scripts are loaded, then more .xml, then more .lua scripts.

I'm trying to get a feeling of how things come up and are initialized - especially for the Desktop.

Moon Wizard
October 3rd, 2020, 19:20
XML is all loaded first.
* The primary ruleset is loaded first.
* Child rulesets are loaded in the order defined in the primary ruleset.
* Extensions are loaded in the order specified by the loadorder tag in each ruleset. (Defaults to zero).
* If no order specified, then no specific order is guaranteed in extension loading.

Global Lua scripts are initialized next (i.e. onInit); and no specific order is guaranteed.

Window and control onInit scripts are triggered when the window is created.

Regards,
JPG

Tuleen Donai
October 3rd, 2020, 21:40
So ... would it make sense that DesktopManager.OnInit() would execute before the onInit() of an extension? In pretty much ALL circumstances?

... but not until the rulesets are loaded and the extensions are loaded?

What are considered the Global Lua scripts?

Moon Wizard
October 3rd, 2020, 22:18
Yes, that's correct. Global scripts are not divided between rulesets and extensions once they are defined; plus ruleset layers and extensions can overwrite global scripts. This means that the onInit for global scripts can happen in any order, regardless of where they are defined. Also, as noted, the global scripts are not initialized until the XML is fully process for rulesets and scripts, exactly for this reason.

When I refer to "global" scripts, I refer to scripts that are defined at the top level using a "script" tag, and not embedded within windowclass or template assets.

Regards,
JPG