dragonflagon-fvtt icon indicating copy to clipboard operation
dragonflagon-fvtt copied to clipboard

lib-df-buttons: let buttons launch when canvas has no active scene

Open ggagnon76 opened this issue 1 year ago • 4 comments

I am creating a module that converts images in a folder to webp format. The module works fine, as long as there is an active scene. When there is no active scene, your module returns out of the _onClick function.

Is this necessary?

image

It would be nice if your module still works even if there is no active scene.

ggagnon76 avatar Sep 07 '22 14:09 ggagnon76

I removed line 181 locally and tried to see if anything blew up. It worked fine.

ggagnon76 avatar Sep 07 '22 14:09 ggagnon76

This is probably not necessary. Likely some test code that didn't get removed. I'll have to take a look.

flamewave000 avatar Oct 23 '22 21:10 flamewave000

Yeah so this was following the same design as the scene buttons which also don't show when the canvas is turned off. I think the better solution would maybe be to add a flag to a module button registration that indicates your buttons work without a canvas.

flamewave000 avatar Oct 27 '22 13:10 flamewave000

The fix to get the buttons working without an active scene is not a priority for me. I just hope to avoid issues in my module where people claim the buttons don't work. I am fine with any solution.

The fix for the getModuleButtons hook is more pressing for me.

ggagnon76 avatar Oct 27 '22 14:10 ggagnon76