-
August 12th, 2020, 15:59 #1
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
Can An Extension Be Stopped From Loading?
Greetings All,
I am trying to stop an Extension from loading if another Extension has not been previously loaded.Thanks In Advance,
D
-
August 12th, 2020, 16:29 #2
See the <dependency> tag: https://fantasygroundsunity.atlassia...nsions+-+Files
Unfortunately, it looks like this has been removed from FGU: https://www.fantasygrounds.com/forum...l=1#post467197Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
August 12th, 2020, 22:42 #3
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
Dammit.
As a developer in the real world, I use libraries for everything.
Either I centralise everything in a Common Extension or I copy files between all my Extensions.
So with your response I will have to just ensure the Common Extension is loaded and hope that anyone using my Extension does the same thing.
Stopping an Extension from loading with a simple return false from an onInit() would be sufficient and it would be up to the developer to check if the required Extension is loaded or not.Thanks In Advance,
D
-
August 13th, 2020, 00:16 #4
I wonder if it has been removed until we can determine the best way to implement this going forward like token locking?
-
August 13th, 2020, 00:37 #5
You can 'kind of' do this with if statements.
Just check for the name of the script that you depend on before triggering the code that depends on it.
Not perfect, but avoids errors.
See the onInit function here which only sets the handler if the ClockAdjuster extension is loaded.Last edited by bmos; August 13th, 2020 at 01:00.
bmos' extensions
he/them
-
August 13th, 2020, 01:17 #6
- Join Date
- Mar 2020
- Location
- Sydney, Australia
- Posts
- 247
@bmos
Your code does not illustrate my situation.
You are adding a handler based on a condition, however what I want to do is to completely block an Extension from loading.
So for example an Extension that adds a new Attribute to the character sheet but requires FancyExtension to be loaded still loads even if I do the check for FancyExtension being loaded or not.
What I want is to completely halt/unload the extension if it cannot find the required FancyExtension.Thanks In Advance,
D
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks