Delayed image loading with SumRndmDde menu plugin.

I've been working with SumRndmDde's Alternate Menu: Busts and Icon's plugin. I changed the icons to a different image set, and the problem I'm having is the images don't load until the second time I open the menu screen. So I can open the menu (they won't show up, I only see the blinking cursor space), then close the menu and open it again and they'll be there just fine. I can also go into the item, skill, etc. screens and then back out to the main menu and the images will be there.

Oddly, it only happens on the custom image I'm trying to use. Using the basic IconSet works fine, as does just throwing in some other default image, such as States, Weapons1, or whatever. I haven't tried 'everything' of course, but the others have worked.

Could it be delayed because it's a custom image instead of stock? Or because its 1485 x 166? (But only 19kb in size).

The code chunk mainly in question is:

Code:
  Window_MenuCommand.prototype.drawItem = function(index) {
    //newDrawItem.call(this);
    var rect = this.itemRectForText(index);
    var align = this.itemTextAlign();
    var symbol = this.commandSymbol(index);
    var enabled = this.isCommandEnabled(index);
    this.resetTextColor();
    var bitmap = ImageManager.loadSumRndmDdeMB(iconSheet);
    var pw = iconW;
    var ph = iconH;
    var sx = index % 16 * pw;
    var sy = Math.floor(index / 16) * ph;
    if(!enabled) this.contents.paintOpacity = 100;
    this.contents.blt(bitmap, sx, sy, pw, ph, rect.x + _iconX, rect.y + _iconY);
    if(!enabled) this.contents.paintOpacity = 255;
  };

And iconSheet is a plugin parameter variable, as are iconW and iconH.

Would appreciate any advice!
hi, you need to preload all image before game start.
As i can see , you start loading only when you start menu.
So the first time you will open the menu, image will not exist.
It will exist only the second time.

the best way it the make your own loader
and replace the original
DataManager.isDatabaseLoaded() or SceneManager._scene.isReady()

i good way its use the pixi loader
you can also use
PHP:
let bitmap = new PIXI.Sprite.fromImage("dir/iconSheet.png");
No need to load, but you need to check if the texture are available in your Pixi utility cache or it will create new cache each time.
Well, not sure if I did it in the 'best' way, but it works, so whatever ^_^

Thanks for the help!

Original thread: https://forums.rpgmakerweb.com/threads/delayed-image-loading-with-sumrndmdde-menu-plugin.92868/