Код:
(() => {
const isDrawHpMpTpForClass = (actor, drawType) => {
const DRAW_ALL = 'ALL';
const DRAW_HP = 'HP';
const DRAW_MP = 'MP';
const DRAW_TP = 'TP';
let isDraw = false;
let actorClassData = $dataClasses[actor._classId];
let actorDrawParams = actorClassData.meta.DKR_DHMT.split(',');
for(let n = 0; n < actorDrawParams.length; n++){
let currentParam = actorDrawParams[n].trim();
if(DRAW_ALL === currentParam){
isDraw = true;
break;
}else if(DRAW_HP === drawType && DRAW_HP === currentParam){
isDraw = true;
break;
}else if(DRAW_MP === drawType && DRAW_MP === currentParam){
isDraw = true;
break;
}else if(DRAW_TP === drawType && DRAW_TP === currentParam){
isDraw = true;
break;
}
}
return isDraw;
}
Window_StatusBase.prototype.placeBasicGauges = function(actor, x, y) {
if(true === isDrawHpMpTpForClass(actor, 'HP')){
this.placeGauge(actor, "hp", x, y);
}
if(true === isDrawHpMpTpForClass(actor, 'MP')){
this.placeGauge(actor, "mp", x, y + this.gaugeLineHeight());
}
if ($dataSystem.optDisplayTp && true === isDrawHpMpTpForClass(actor, 'TP')) {
this.placeGauge(actor, "tp", x, y + this.gaugeLineHeight() * 2);
}
};
})();
Социальные закладки