League-of-Foundry-Developers / fvtt-module-theatre

GNU General Public License v3.0
30 stars 39 forks source link

V11: Replacement for PIXI.Loader.shared.resources #128

Closed farling42 closed 1 year ago

farling42 commented 1 year ago

It isn't pretty, but it seems to fix the problem:

ThreatreActorConfig.js tries to access PIXI.Loader.shared.resources at line 383.

                Theatre.instance._clearPortraitContainer(theatreId);
                Theatre.instance._setupPortraitContainer(theatreId, newAlign, resName, PIXI.Loader.shared.resources);

It can be replaced with the following code which converts the PIXI.Assets.cache so that it can be accessed as an array (which is what _setupPortraitContainer does).

                const proxy = new Proxy({}, {
                    get: function(target, name) {
                        return PIXI.Assets.cache.get(name);
                    }
                });
                Theatre.instance._clearPortraitContainer(theatreId);
                Theatre.instance._setupPortraitContainer(theatreId, newAlign, resName, proxy);
megahead11 commented 1 year ago

Looks good. Added to v2.5.0