-
Notifications
You must be signed in to change notification settings - Fork 4
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
Foundry v9 incompatibility #27
Comments
I may have a conflict with another module, but the HUD is visible and working only when I'm GM. The button to access token selection is not present when I log in as the player/owner. |
same here |
I tried to make a pull request as the fix is quite trival but was unable.
Line 68 needs to changed to |
@GrumpyVader it looks like some other module is also fiddling with the token config dialog. Try disabling all modules apart from Token HUD Wildcard to see if it works. |
It seems that the players need the "Use File Browser" permission in order for the extra button to appear on the token HUD. This is due to a change in core Foundry. I raised a bug report for it here... |
Updating the code manually to enable the default image options still gives me an issue to where it doesn't respect the selection. It will still be random even with a default set. |
@shirkie I noticed that too, it's actually a problem in v0.8 too. I actually have a fix for it, but I'm not at my PC right now to post it. |
@cs96and That's great news! I would LOVE to get that from you whenever you have time! Glad i wasn't the only one experiencing it. Thank you in advance. |
Here's the fix for the default token. On line 52 of main.js, replace this... _hookPreTokenCreate () {
Hooks.on('createToken', (parent, options, userId) => {
const defaultValue = parent?.actor?.data?.token?.flags['token-hud-wildcard'] ? parent.actor.data.token.flags['token-hud-wildcard'].default : ''
if (defaultValue !== '' && parent?.actor?.data?.token?.randomImg) {
const dimensions = getTokenDimensions(parent, defaultValue)
let updateInfo = { img: defaultValue, ...dimensions }
parent.object.document.update(updateInfo)
}
})
}, With this... _hookPreTokenCreate () {
Hooks.on('preCreateToken', (parent, data, options, userId) => {
const defaultValue = parent?.actor?.data?.token?.flags['token-hud-wildcard'] ? parent.actor.data.token.flags['token-hud-wildcard'].default : ''
if (defaultValue !== '' && parent?.actor?.data?.token?.randomImg) {
const dimensions = getTokenDimensions(parent, defaultValue);
let updateInfo = { img: defaultValue , ...dimensions };
mergeObject(data, updateInfo);
parent.data.update(updateInfo);
}
})
}, |
That works wonderfully! Thank you for posting it! |
I'm so sorry, i missed all these notifications. oh damn that's awesome. Gonna try to include it in a new version soon, I haven't updated to foundry v9 Gonna update foundry today and check the fix during the week to make a new version. |
Note there are two separate fixes above. @SirTman's fix is the fix to make it work with v9. Also, you can improve on @SirTman's fix, to make it compatible with both v0.8 and v9... const imageDataTab = html.find('.tab[data-tab="appearance"],.tab[data-tab="image"]') |
Also, if there's a way to fix the current v9 requirement of having to give players File Browser permissions for them to be able to change their own tokens that would be ideal. |
@GambetTV that relies on fixing core foundry... |
Gonna try to add the fixes during this week, probably before friday. Regarding the issue with file picker, that definitely gonna have to wait unti there is a solution on the core side |
This fix works perfectly but I can't make the other one actually work. Need to check it a bit more |
Oh ok,yeah I get the second fix, I was mixing it up |
Hey guys, bit of an update, thanks to @cs96and for reporting the issue on getTokenImages it was added to the dev pipeline and apparently fixed for version 10 prototype 1. So I have high hopes we will recover full functionality of the module |
The module works for the most part in v9, but one critical aspect of it is no longer supported, which is you can no longer define a default token image. I suspect this is because of the updates done to the Token Configuration menu, as the layout now is significantly different.
The text was updated successfully, but these errors were encountered: