- Joined
- Jul 28, 2013
- Messages
- 637
- Reaction score
- 211
- First Language
- English
- Primarily Uses
- RMMV
Hey @mjshi
Would you be able to help me out with making a small edit to MP that I'm using compatible with your plugin?
Here's the code I currently have. What it does is changes how your current MP number is displayed (no longer shows max MP, and moved over current MP to better align with the HP number), as well as creates a second layer to the MP bar (so at max MP, it would have filled up twice).
Having this code either above or below yours seems to overwrite your plugin's MP bar.
Would you be able to help me out with making a small edit to MP that I'm using compatible with your plugin?
Here's the code I currently have. What it does is changes how your current MP number is displayed (no longer shows max MP, and moved over current MP to better align with the HP number), as well as creates a second layer to the MP bar (so at max MP, it would have filled up twice).
Having this code either above or below yours seems to overwrite your plugin's MP bar.
Code:
Window_Base.prototype.drawCurrentAndMax2 = function(current, max, x, y,
width, color1, color2) {
var labelWidth = this.textWidth('HP');
var valueWidth = this.textWidth('0000');
var slashWidth = this.textWidth('');
var x1 = x + width - valueWidth;
var x2 = x1 - slashWidth;
var x3 = x2 - valueWidth;
if (x3 >= x + labelWidth) {
this.changeTextColor(color1);
this.drawText(current, x1, y, valueWidth, 'right'); //Change to x3 to line up with CURRENT HP, x1 for MAX HP
this.changeTextColor(color2);
this.drawText('/', x2, y, slashWidth, 'right');
this.drawText(max, x1, y + 1000, valueWidth, 'right');
} else {
this.changeTextColor(color1);
this.drawText(current, x1, y, valueWidth, 'right');
}
};
Window_Base.prototype.drawActorMp = function(actor, x, y, width) {
width = width || 186;
var color1 = this.mpGaugeColor1();
var color2 = this.mpGaugeColor2();
var color3 = this.textColor(30);
var color4 = this.textColor(31);
this.drawDoubleGauge(x, y, width, actor.mpRate(), color1, color2, color3, color4);
this.changeTextColor(this.systemColor());
this.drawText(TextManager.mpA, x, y, 44);
this.drawCurrentAndMax2(actor.mp, actor.mmp, x, y, width,
this.mpColor(actor), this.normalColor());
};
Window_Base.prototype.drawDoubleGauge = function(x, y, width, rate, color1, color2, color3, color4) {
var fillRate1 = Math.min(rate * 2.0, 1.0);
var fillRate2 = Math.max((rate - 0.5) * 2.0, 0.0);
var fillW1 = Math.floor(width * fillRate1);
var fillW2 = Math.floor(width * fillRate2);
var gaugeY = y + this.lineHeight() - 8;
this.contents.fillRect(x, gaugeY, width, 6, this.gaugeBackColor());
this.contents.gradientFillRect(x, gaugeY, fillW1, 6, color1, color2);
this.contents.gradientFillRect(x, gaugeY, fillW2, 6, color3, color4);
};