PDA

View Full Version : Prevent extension from loading in Unity



bmos
November 8th, 2020, 12:42
Is there an xml tag or something to make Extensions unavailable in Unity?
I know I can prevent scripts from running but I'd ideally like to make it not show up at all or be greyed out.
Basically the minrelease/maxrelease options we have for ruleset version but for FG's version.

SilentRuin
November 8th, 2020, 15:21
Is there an xml tag or something to make Extensions unavailable in Unity?
I know I can prevent scripts from running but I'd ideally like to make it not show up at all or be greyed out.
Basically the minrelease/maxrelease options we have for ruleset version but for FG's version.

Not sure what you mean. If you don't have an extension .ext file in your "extensions" subdirectory (wherever you downloaded Fantasy Grounds Unity) you will not see the extension listed in the load campaign option. Otherwise, if you are talking about seeing or having it IN your campaign - you just uncheck the option for that particular extension when you are about to load the campaign.

bmos
November 8th, 2020, 15:55
Not sure what you mean. If you don't have an extension .ext file in your "extensions" subdirectory (wherever you downloaded Fantasy Grounds Unity) you will not see the extension listed in the load campaign option. Otherwise, if you are talking about seeing or having it IN your campaign - you just uncheck the option for that particular extension when you are about to load the campaign.I made an extension that only works in Unity (it uses mood lighting) and I want to make it not load in Classic [this was a typo before]. Right now it shows up as an option with no visual indication of the incompatibility.

SilentRuin
November 8th, 2020, 16:33
I made an extension that only works in Unity (it uses mood lighting) and I want to make it not load in Unity (since it won't work there). Right now it shows up as an option with no visual indication of the incompatibility.

Works only in Unity but does not work in Unity? Still not sure what you mean.

Unity and Classic are loaded in two different places so not having your .ext file in the extension folder solves your problem, if its just a typo above.

bmos
November 8th, 2020, 17:26
Works only in Unity but does not work in Unity? Still not sure what you mean.

Unity and Classic are loaded in two different places so not having your .ext file in the extension folder solves your problem, if its just a typo above.I had a typo; it's fixed now.
Obviously yes, not using it with the wrong version avoids this issue.

However, I have seen people running it on Unity (for no benefit) so I want to improve the UX by not allowing them to make this mistake.

Moon Wizard
November 8th, 2020, 18:00
You could add a message that gets added to the chat window on the onDesktopInit event that puts up an obnoxious message in the chat window (giant red X icon, or something similar) if it's not compatible using Interface.getVersion() function to check the client version.

There's no mechanism to limit an extension load based on client version.

Regards,
JPG

SilentRuin
November 8th, 2020, 18:01
I had a typo; it's fixed now.
Obviously yes, not using it with the wrong version avoids this issue.

However, I have seen people running it on Unity (for no benefit) so I want to improve the UX by not allowing them to make this mistake.

I'm not aware of any extension.xml entry you can use by default - but I imagine you could make a function call to determine which you are in and put out a chat messages and disable any of your own code in your extension. I'm sure there is a function call i've seen/used in 5e.pak or CoreRPG.pak that does that sort of determination.

Edit: Sneaky Moon Wizard undercut me - but yeah what we said.

bmos
November 8th, 2020, 19:41
Thank you both :)
I will take that approach.