Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits)

Right, so looking at the code for the apng plugin, I see that there's a slight compatibility issue with it. It's a tad complicated but to keep it simple: Cook Tool's patch for decrypting relies on a function in browsers that (in a way) aren't exactly compatible with MV's and MZ's setup (the decryption is async only, so I needed to get it to work with code that is synchronous). Most plugins work out of the box, as the patch ensures that everything that uses the standard loading mechanism should work. But the plugin in question does its own thing to load these. And because the decryption is async, the plugin loses the context and just fails to load. The fix for it is to change the line that uses Utils.decryptArrayBuffer to something like this:

        static decryptResource(key) {
            const resource = this._resource[key];
            Utils.decryptArrayBuffer(resource.data, (decrypted) => {
                resource.data = decrypted;
                const newKey = ApngLoader.convertDecryptExt(key);
                resource.name = newKey;
                resource.url = newKey;
                resource.extension = 'png';
                this._resource[newKey] = resource;
                delete this._resource[key];
                });
        };

This change adds a callback, so when the method above finishes, it will load it properly. I haven't tested this, but it should give a clue as to how to fix it. If you aren't able to, I'll work on a fixed version of the plugin.