work really good. tank you a lot friend
Little sugestion;
Play sound eatch case or eatch stamina decrease
🙂
Window_DashStamina.prototype.drawStaminaWindow = function(x, y, width)
{
this.contents.clear();
// Draw text before the gauge
if (this.windowText !== null)
{
this.contents.drawText(this.windowText, , Silv.DashStamina.WindowTextOffsetY, this.windowTextWidth, );
}
// Draw gauge
this.drawStaminaGauge(Silv.DashStamina.StaminaGaugeRectangle.x + this.windowTextWidth + this.windowTextGaugeSpacingX, Silv.DashStamina.StaminaGaugeRectangle.y, Silv.DashStamina.StaminaGaugeRectangle.width, Silv.DashStamina.StaminaGaugeRectangle.height, $gamePlayer.dashStaminaPerc);
// Draw text on top of the gauge
var text;
switch(Silv.DashStamina.DrawStaminaValue) // allowed values: absolute/percentage/both/none
{
case 'absolute':
text = parseInt($gamePlayer.dashStamina) + '/' + parseInt($gamePlayer.dashStaminaMax);
break;
case 'percentage':
text = Math.round($gamePlayer.dashStaminaPerc * 100) + '%';
break;
case 'both':
text = parseInt($gamePlayer.dashStamina) + '/' + parseInt($gamePlayer.dashStaminaMax) + ' (' + Math.round($gamePlayer.dashStaminaPerc * 100) + '%)';
break;
case 'none':
return;
default:
throw 'ERROR: drawStaminaWindow missing case-statement or incorrect Silv.DashStamina.DrawStaminaValue value. Value: ' + Silv.DashStamina.DrawStaminaValue;
}
this.resetTextColor();
this.drawText(text, x + this.windowTextWidth + this.windowTextGaugeSpacingX, y + 1, width, 'center');
};
Original thread: https://forums.rpgmakerweb.com/threads/silvers-dash-stamina.51566/