Trying to understand ImageManager.isReady()

On this thread, SilverDash has exactly the same problem I have at this moment. I tried to get rid of Window_MenuStatus and when I open Scene_Skill, actor's face isn't there until I reload it on the second time.
This silly overwrite did dirty trick in my case.
 

(function($) { $.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 that = this; // I hate using "that", to be honest, but I tried not to use bind in this case. bitmap.addLoadListener(function() { 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; that.contents.blt(bitmap, sx, sy, sw, sh, dx, dy); }); };})(Window_Base);My questions is:

1. By any chance, will this overwritten method cause any problem?
2. I know that Scene_Base won't be started until ImageManager is ready and graphics are loaded. But why Scene_Skill doesn't have same behaviour like Scene_Base?

Thanks!
1) Not really a problem, but I'd rather trigger a refresh when the bitmap is loaded instead of doing that.


2) ImageManager.isReady will return true when there's nothing being loaded. If no part of the script asked the face to be loaded, the ImageManager won't know it isn't loaded because it doesn't know it exists.
Look at what the message window does with faces, and what the main menu does with faces.


The message window loads it, then calls another command (which I can't remember). The main menu loads all the actor faces before displaying anything.
Thanks!

Btw I found this:

rpg_windows.js line 1727

Window_MenuStatus.prototype.loadImages = function() { $gameParty.members().forEach(function(actor) { ImageManager.loadFace(actor.faceName()); }, this);};Window_MenuStatus tried to load face image directly on it's initialization. Is this the way Scene_Menu tell ImageManager that there are graphics need to be loaded?

If so, then I tried to replicate it on Window_SkillStatus;

(function($) { var _initialize = $.prototype.initialize; $.prototype.initialize = function(x, y, width, height) { _initialize.call(this, x, y, width, height); $gameParty.members().forEach(function(actor) { ImageManager.loadFace(actor.faceName()); }, this); };})(Window_SkillStatus);But seems like it's not working 🤣

So, is there any explanation on this?
Because Scene_MenuStatus does other things before actually displaying an image. You're trying to load it and display it straight away.
@shaz: I don't mean to display picture immediately. I just want to make sure that my picture is already precached before scene begin. I believe, when the engine is caching things, it display Now Loading graphics. After loading ends, every graphics related to that scene should be immediately displayed (especially, in my case is Scene_Skill). That's what I thought.

Anyway,

I managed to successfully preload picture on initialization. But somehow I found this method "unnatural".

This morning, I learned that Scene_MenuBase children request picture from ImageManager using method create(), which create all windows, and those windows request a picture on their initialization.

But somehow I can't replicate this step. So instead of requesting picture on create() method, I did it on initialize() method.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-understand-imagemanager-isready.53052/