- Joined
- Jan 8, 2013
- Messages
- 461
- Reaction score
- 76
- First Language
- Italian
- Primarily Uses
Hi guys, i'm trying to create a compatibility between two script.
Yanfly Job Points and an alternative menu of SumRn.
Basically, yanfly job points draw the job points in the main menu, in a precise position and i think that the part of the code that add it, it's this:
If i use the alternative menu, this function disappear and the part that add the job points in the main menu is not visible.
If i see the code of the alternative menu, i see this:
If i try to comment the line "this.drawActorMp", the mp under the character disappear.
Now, if the Yanfly script create a new entry, how can i call it and put it under the mp? I really don't understand how to do it
Maybe the part of the code of the alternative menu it's not this... But i'm pretty sure, in ignorance, that the part of code of script jp points that draw the info in the main menu, near every character, it's right. :/
Yanfly Job Points and an alternative menu of SumRn.
Basically, yanfly job points draw the job points in the main menu, in a precise position and i think that the part of the code that add it, it's this:
JavaScript:
//=============================================================================
// Window_Base
//=============================================================================
Yanfly.JP.Window_Base_dASS = Window_Base.prototype.drawActorSimpleStatus;
Window_Base.prototype.drawActorSimpleStatus = function(actor, wx, wy, ww) {
this._drawMenuJP = Yanfly.Param.JpShowMenu;
Yanfly.JP.Window_Base_dASS.call(this, actor, wx, wy, ww);
this._drawMenuJP = undefined;
};
Yanfly.JP.Window_Base_drawActorClass = Window_Base.prototype.drawActorClass;
Window_Base.prototype.drawActorClass = function(actor, wx, wy, ww) {
ww = ww || 168;
Yanfly.JP.Window_Base_drawActorClass.call(this, actor, wx, wy, ww);
if (!this._drawMenuJP) return;
var classId = actor.currentClass().id;
this.drawActorJp(actor, classId, wx, wy, ww, 'right');
};
Window_Base.prototype.drawActorJp = function(actor, id, wx, wy, ww, align) {
var jp = actor.jp(id);
var icon = '\\i[' + Yanfly.Icon.Jp + ']';
var fmt = Yanfly.Param.JpMenuFormat;
var text = fmt.format(Yanfly.Util.toGroup(jp), Yanfly.Param.Jp, icon);
if (align === 'left') {
wx = 0;
} else if (align === 'center') {
wx += (ww - this.textWidthEx(text)) / 2;
} else {
wx += ww - this.textWidthEx(text);
}
this.drawTextEx(text, wx, wy);
};
Window_Base.prototype.textWidthEx = function(text) {
return this.drawTextEx(text, 0, this.contents.height);
};
If i use the alternative menu, this function disappear and the part that add the job points in the main menu is not visible.
If i see the code of the alternative menu, i see this:
JavaScript:
Window_MenuStatus.prototype.drawItemStatus = function(index) {
var actor = $gameParty.members()[index];
var rect = this.itemRect(index);
var x = rect.x + 4;
var y = rect.y;
if(!useCharacters) y += (rect.height / 2);
else y += (characterSizeY/2);
if(drawTp && !useCharacters) {
y -= this.lineHeight() / 2;
}
var width = rect.width - 8;
var lineHeight = this.lineHeight();
this.drawActorName(actor, x, y, width);
this.drawActorLevel(actor, x, y + lineHeight, width);
this.drawActorHp(actor, x, y + lineHeight * 2, width);
this.drawActorMp(actor, x, y + lineHeight * 3, width);
if(drawTp) this.drawActorTp(actor, x, y + lineHeight * 4, width);
this.resetFontSettings();
};
If i try to comment the line "this.drawActorMp", the mp under the character disappear.
Now, if the Yanfly script create a new entry, how can i call it and put it under the mp? I really don't understand how to do it
Maybe the part of the code of the alternative menu it's not this... But i'm pretty sure, in ignorance, that the part of code of script jp points that draw the info in the main menu, near every character, it's right. :/