-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Defer initialization of addons until after campaign load #5231
base: develop
Are you sure you want to change the base?
Conversation
A better approach is to create a list of "pending" AddOns; if the campaign hasn't been loaded yet, add the registered library to the pending list; otherwise, register it. Once the campaign has been loaded, process the pending add-ons from the list and register them. This means that we wouldn't end up with partially processed add-ons (like this change would introduce), and any new things added to add-ons would automatically be fixed if they needed to wait for the campaign to be loaded. Also, people modifying the code later would not need to figure out whether they must pass true or false to the register library function. Of course, some locking would need to occur for the variable campaign loaded/list (well, I guess you can use a |
Having dug a bit further, I don't think inside There's currently code to handle campaign macro init in This is hard. |
What I would suggest is to do this work
This should mean that it only gets called once per campaign load, it doesn't matter if its a temporary campaign or not it will just "process" the empty queue in that case. Technically it doesn't matter if it gets called more than once per campaign as the queue will be empty on all but the first call (but best to try avoid doing it :) ) |
Identify the Bug or Feature request
Fixes #5178
Description of the Change
This changes the register/reregister functions to conditionally initialize and adds a method to the Library Manager to initialize all addons, so that when an addon is added to a running campaign it is initialized immediately, but when initializing from connecting to a server or loading from a file addon initialization is deferred until after the campaign is loaded.
Possible Drawbacks
There may be a cleaner way to handle this than changes all over the place.
Release Notes
This change is