Closed TheGreatRedDuke closed 12 months ago
It seems like we might've missed something in the last update. I didn't notice this last time when I tried it out. Can you try 2.6.1? https://github.com/League-of-Foundry-Developers/fvtt-module-theatre/releases/tag/v2.6.1
Can confirm, still not working in 2.6.1.
Customs macros that previously worked by calling theatre.SOMETHING
and the macros provided by the module that call Theater.SOMETHING
both are still not functioning.
theatre.SOMETHING
:
Uncaught (in promise) ReferenceError: theatre is not defined
at toggleTheatreActor (eval at #executeScript (foundry.js:22859:16), <anonymous>:16:5)
at Macro.eval (eval at #executeScript (foundry.js:22859:16), <anonymous>:29:1)
at #executeScript (foundry.js:22863:17)
at Macro.execute (foundry.js:22811:35)
at HotbarSFRPG._onClickMacro (foundry.js:78610:20)
at HotbarSFRPG.clickMacro (monks-active-tiles.js:1901:24)
at Hotbar._onClickMacro (monks-active-tiles.js:1909:35)
at HTMLLIElement.dispatch (jquery.min.js:2:43184)
at y.handle (jquery.min.js:2:41168)
Theatre.SOMETHING
:
6737:7 Uncaught (in promise) TypeError: Theatre.addToNavBar is not a function
at eval (eval at #executeScript (foundry.js:22859:16), <anonymous>:7:37)
at Array.forEach (<anonymous>)
at Macro.eval (eval at #executeScript (foundry.js:22859:16), <anonymous>:7:16)
at #executeScript (foundry.js:22863:17)
at Macro.execute (foundry.js:22811:35)
at HotbarSFRPG._onClickMacro (foundry.js:78610:20)
at HotbarSFRPG.clickMacro (monks-active-tiles.js:1901:24)
at Hotbar._onClickMacro (monks-active-tiles.js:1909:35)
at HTMLLIElement.dispatch (jquery.min.js:2:43184)
at y.handle (jquery.min.js:2:41168)
If there's any other info I can provide to help, please let me know.
It looks like some functions are now available via Theatre.instance
, like Theatre.instance.handleNavItemMouseUp()
. But a number of important functions for use by macros like clearStage()
and addToNavBar()
are missing from Theatre.instance
, so this isn't a full workaround.
This is using 2.6.1.
@megahead11 try this on theatre_main.js
if (!window.Theatre) {
- window.Theatre = {};
+ window.Theatre = window.theatre = theatre;
}
- window.Theatre.instance = theatre;
I'm not sure what the instance
is meant to be here, I changed it and nothing seems to break.
@megahead11 try this on theatre_main.js
if (!window.Theatre) { - window.Theatre = {}; + window.Theatre = window.theatre = theatre; } - window.Theatre.instance = theatre;
I'm not sure what the
instance
is meant to be here, I changed it and nothing seems to break.
Gave it a shot on my local copy but it doesn't seem to fix the issue either.
This is what it was supposed to be?
if (data.cssId === "chat-popout") return;
theatre.initialize();
window.Theatre = {};
window.Theatre.instance = theatre;
Ah, I just tried to fix theatre
not being a thing, not the macro not running.
I have yet to understand what was the point of declaring Theatre.instance = theatre
there when it probably meant to target theatre.constructor.instance
instead.
Try the following inside the if condition
window.Theatre = Theatre;
window.theatre = theatre;
This should fix it, but I'm not sure if anything will break since there's a bunch of Theatre calls in the code, but they're most likely calling the class instead.
Alternatively, just use my earlier suggestion and change the macros to Theatre.constructor.addToNavBar
.
That appears to have worked. However, I will keep the issue open JUST in case I might've missed something.
This is fixed now for me. Thanks a lot!
My apologies for being very slow. I'm trying to also test this on my local also, but exactly what code is required where in theatre_main.js
?
And will this fix make it into a upcoming release?
Hello,
I believe that since the latest, update any macros that reference
theater
no longer function.This is true of both any custom code as well as the macros provided by this module.
Error in console:
To reproduce this exact error:
Add a token to a scene. Attempt to execute the macro "Add Selected Tokens to Stage" that is provided by this module.
I am testing on a fresh world, with no other modules active, and the latest version of Foundry and this module.