MV YEP_X_InBattleStatus face sprite loading delay

to keep it short basically when i open the status menu for the first time in battle i see this
1769895467816.png

the second time i open it in the same battle i see this
1769895552796.png

which is obviously what i want it to look like the first time
i use aetherflow preload everything for preloading but it doesnt seem to help when it comes to this menu specifically
it requires me to open it twice every battle for the face sprite to display
i havent seen anyone else have this issue but i dont really think its a plugin issue and i have so many that narrowing it down isnt very reasonable for something kind of minor albeit annoying like this

i should mention ive tried other preloading plugins in the past and this issues been around since like i first started using this plugin so i dont think its an issue with the specific plugin i use
But isn't the face already loaded in "normal" battle screen before you ever open that status menu? Anyway, you can try to edit a loadlistener at the end of the face draw method and see if that helps. Think you just add the last line:

Window_InBattleStatus.prototype.drawFace = function(faceName, faceIndex, x, y, width, height) {
width = width || Window_Base._faceWidth;
height = height || Window_Base._faceHeight;
var bitmap = ImageManager.loadFace(faceName);
var pw = Window_Base._faceWidth;
var ph = Window_Base._faceHeight;
var sw = Math.min(width, pw);
var sh = Math.min(height, ph);
var dx = Math.floor(x + Math.max(width - pw, 0) / 2);
var dy = Math.floor(y + Math.max(height - ph, 0) / 2);
var sx = faceIndex % 4 * pw + (pw - sw) / 2;
var sy = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy);
bitmap.addLoadListener(() => this.refresh());
};
1769944344265.png
1769944309307.png

added what you posted below what i assume you were referring to because i couldnt find any of that in the file itself (unless im misinterpreting what you mean) and got this error
its 6am so i might be doing this stupid sorry if i misinterpreted
Yeah, it's not in the plugin file because it inherits the normal face draw from Window_Base. But you can just add that as a new plugin (or add it to the plugin file).

But anyway, yeah, I realized that you need to make a conditional check to add that load listener, so try this instead:

Window_InBattleStatus.prototype.drawFace = function(faceName, faceIndex, x, y, width, height) {
width = width || Window_Base._faceWidth;
height = height || Window_Base._faceHeight;
var bitmap = ImageManager.loadFace(faceName);
var pw = Window_Base._faceWidth;
var ph = Window_Base._faceHeight;
var sw = Math.min(width, pw);
var sh = Math.min(height, ph);
var dx = Math.floor(x + Math.max(width - pw, 0) / 2);
var dy = Math.floor(y + Math.max(height - ph, 0) / 2);
var sx = faceIndex % 4 * pw + (pw - sw) / 2;
var sy = Math.floor(faceIndex / 4) * ph + (ph - sh) / 2;
if (bitmap.isReady()) {
this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy);
} else {
bitmap.addLoadListener(() => this.refresh())
}
};
that worked !! tysm

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/yep_x_inbattlestatus-face-sprite-loading-delay.182229/