(Please move to JS Requests) Yanfly Status Menu: Add bust on status screen

Hey folks, I've been able to make some adjustments on my own to a wonderful plugin and there's one more thing.


You know how there's a large shot of the character on the biography page? I want to apply that to the status menu to fill in the empty space on the left side of the screen.


Window_StatusInfo.prototype.drawItemImage = function(index) {
// load stand_picture
var bitmapName = this.actor.meta.stand_picture;
var bitmap = bitmapName ? ImageManager.loadPicture(bitmapName) : null;
var w = Math.min(rect.width);
var h = Math.min(rect.height);
var lineHeight = this.lineHeight();
if(bitmap){
var sx = 0;
var sy = 0;
var dx = 0;
var dy = 0;
} else { // when bitmap is not set, do the original process.
this.drawActorFace(actor, rect.x, rect.y + lineHeight * 2.5, w, h);
}
this.changePaintOpacity(true);
};


So far, I've gathered all of this code together from AltMenuScreen2 plugin since it shouldn't have that many compatability issues and nothing happens. It should look like this: All of the selections should have the profile picture.


Tcm8jkT.png
You didn't say what DOES happen when you run that script - I'm assuming it just draws the face instead?


If that's the case, it's probably not working because the bitmap is NOT loaded immediately after you tell it to load.


The kdkw enemy book plugin just adds the sprite and executes the load.  As soon as the load is done, the sprite appears.  Get rid of the if bitmap test and the else clause altogether.  I'm not sure what the sx, sy, dx, dy is in aid of - they don't seem to be properties of the bitmap or used anywhere else in the method, so I'd suggest even they aren't needed.  And use a sprite instead of a bitmap on the current sprite.  Follow the enemy book plugin for an example.
It won't draw anything. It's the AltMenuScreen2's bust I'm trying to load instead of the enemy books. That means the optional picture provided.


Here is the current code:


Window_StatusInfo.prototype.drawItemImage = function(index) {
// load stand_picture
var spriteName = $dataActors[actor.actorId()].meta.stand_picture;
var sprite = spriteName ? ImageManager.loadPicture(spriteName) : null;
var w = Math.min(rect.width + 400);
var h = Math.min(rect.height + 400);
};


It's between Window_StatusInfo.prototype.resetTextColor = function() { and Window_StatusInfo.prototype.refresh = function() {

Something I kept to mind is that the picture is defined in the notes tag. I kept the sx, sy and so on since in my other edits, I was able to modify them to suit my needs.

Original thread: https://forums.rpgmakerweb.com/threads/please-move-to-js-requests-yanfly-status-menu-add-bust-on-status-screen.55813/