-
Notifications
You must be signed in to change notification settings - Fork 11
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
Cannot return to previous scene control #3
Comments
It doesn't seem specific to the Tile Controls as I can also make this
happen with others, but it is not consistent at all. No idea what's
happening there. I can always get it to close by clicking other tools,
though, so not a high priority for me to fix considering I can't reproduce
it properly.
…On Mon, Jan 4, 2021 at 10:14 AM Kamil Szczepański ***@***.***> wrote:
Foundry VTT: 0.7.9
SDR: 1.1.2
When you open the SDR popup you cannot open tool that was selected
previously.
Example steps to reproduce:
1. Select Tile Controls
2. Select SDR
3. Try to open Tile Controls again, every other control works; closing
the SDR by clicking again doesn't fix anything.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJBV6VGNFWGLJRKR3Z2KVDSYIASBANCNFSM4VTLXHZQ>
.
--
Jan Ole Peek
http://www.janolepeek.com/
|
Yeah, I used Tile Controls as an example. For me it seems to be 100% consistent with select control X -> select SDR -> can't open tool x, but other buttons work. |
Yeah you're right, ok, will check some more.
…On Mon, Jan 4, 2021 at 10:56 AM Kamil Szczepański ***@***.***> wrote:
Yeah, I used Tile Controls as an example. For me it seems to be 100%
consistent with select control X -> select SDR -> can't open tool x, but
other buttons work.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJBV6UQKSQYZQB7ZBAROXLSYIFOLANCNFSM4VTLXHZQ>
.
--
Jan Ole Peek
http://www.janolepeek.com/
|
I've fiddled with it a bit and seems that calling deactivate on the layer helps, but I'm not sure if there are no side effects.
|
I think the problem really is that if you're on the Tiles icon, for
example, and then you open SDR, and then click Tiles again, FVTT isn't
aware that Tiles is NOT currently active, thinks that it still is, and thus
does nothing. That's why when you click any other tool icon, it works fine,
because FVTT thinks Tiles is active, you click Lighting, for example, and
it works as intended.
…On Mon, Jan 4, 2021 at 11:20 AM Kamil Szczepański ***@***.***> wrote:
I've fiddled with it a bit and seems that calling deactivate on the layer
helps, but I'm not sure if there are no side effects.
canvas.stage.children.filter(layer => layer._active).forEach(layer =>
layer.deactivate());
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJBV6RX3FK7PRIJT5DLNK3SYIII7ANCNFSM4VTLXHZQ>
.
--
Jan Ole Peek
http://www.janolepeek.com/
|
I'm going to have to rewrite how SDR is added. It's not currently properly added as a new control but rather hacked into the DOM. That comes with limitations that cause that issue. I'm going to see if I can quickly do this, but if not, this may not be done by me anytime soon. |
Yeah, but I think that without hacking the DOM and using proper control items you can't get such nice list with buttons :) If you want fast solution call this deactivate when opening SDR. |
Good call. Fixed in 1.1.3. |
I'm seeing some variant of this issue still on 1.1.3:
Happens 100% reliably on Firefox 84.0.2 and Chrome 87.0.4280.141 with Foundry 0.7.9 and D&D 5e 1.2.1 with no other modules enabled. (All those versions are the most current ones as of right now) Attached video has other modules enabled but I confirmed it happens with all modules except SDR disabled by creating a brand new world and repeating the test. 2021-01-06.23-10-10-1.mp4 |
I rolled back this "fix" because it made things demonstrably worse. I'd rather deal with not having the window close quite as easily than making all scene clicks wonky |
So in my module I've finally ended up with injecting code to the layers activated by the default buttons, which seems to be working far better for me. You can try and test it for yourself (and please test it before updating the module on live 😂 ): function injectActivationResetForLayers() {
canvas.stage.children.forEach(layer => {
defaultActivate = layer.activate;
layer.activate = function() {
this.deactivate();
return defaultActivate.apply(this, arguments);
};
});
} The change to previous solution is that instead always deactivating current layer, we inject code that will deactivate the layer before trying to activate it (layers check if they are active before activating). Other solution could be to just overwrite property _active on the layer so it thinks it's not active, either way it seems to work better and only deselects the tokens when you return to the layer. |
Foundry VTT: 0.7.9
SDR: 1.1.2
When you open the SDR popup you cannot open tool that was selected previously.
Example steps to reproduce:
The text was updated successfully, but these errors were encountered: