galv大佬有个MV 的预加载插件,
想在MZ上使用,对着改了下,
但是没有效果,大佬们看下我这哪里出了问题
ImageManager.reserveSpecific = (folder, filename) => {
if(!folder) return;
folder = `img/${folder}/`;
return this.loadBitmap( folder, filename);
};
Galv.CACHE.loadOnBoot = () => {
const params = {
'Menu__layer' : 'Background_01,Background_02',
'Menu__ui' : 'JN,JNBJ,item,itembj',
'faces' : 'a1'
};
for (const [key, value] of Object.entries(params)) {
if (value) {
const arr = value.split(',');
arr.forEach(item => ImageManager.reserveSpecific(key, item));
}
}
};
Galv.CACHE.Scene_Boot_loadSystemImages = Scene_Boot.prototype.loadSystemImages
Scene_Boot.prototype.loadSystemImages = function() {
Galv.CACHE.Scene_Boot_loadSystemImages.call(this);
Galv.CACHE.loadOnBoot();
};
ImageManager.reserveSpecific = (folder, filename) => {
if(!folder) return;
folder = `img/${folder}/`;
return this.loadBitmap( folder, filename);
};
Galv.CACHE.loadOnBoot = () => {
const params = {
'Menu__layer' : 'Background_01,Background_02',
'Menu__ui' : 'JN,JNBJ,item,itembj',
'faces' : 'a1'
};
for (const [key, value] of Object.entries(params)) {
if (value) {
const arr = value.split(',');
arr.forEach(item => ImageManager.reserveSpecific(key, item));
}
}
};
Galv.CACHE.Scene_Boot_loadSystemImages = Scene_Boot.prototype.loadSystemImages
Scene_Boot.prototype.loadSystemImages = function() {
Galv.CACHE.Scene_Boot_loadSystemImages.call(this);
Galv.CACHE.loadOnBoot();
};
|