Thread: Bug in code
-
September 25th, 2020, 16:59 #1
Bug in code
Found a case when 'power_page.lua', 'onPowerWindowAdded' is been called before its 'onInit' for this class..
I was under the impression 'onInit' would always be called first ?
Not sure if this is a special case due to this been in a list of items, or if its possible to in-general manage to call functions on classes before they are initialised...
I've attached a zip with a campaign and the 5e rule set file with debug chat in the onInit and onPowerWindowAdded functions.
You just need to open the campaign 'camp', open character 'bob' and swap to the 'actions' tab.
( just unzip and place into FGC or FGU with an unpacked 5e ruleset... etc.. )
-pete
Moderator: Moved to a more appropriate place.Last edited by Zacchaeus; September 25th, 2020 at 17:50.
-
September 25th, 2020, 18:14 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
When a window is initialized, then all the child control onInit functions are called in order of definition; then the windowinstance onInit is called. It is possible that due to events or script calls that other functions within a window/control script can be called before the onInit function.
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks