var showHpSwitch = false;
var fun_map_update = Scene_Map.prototype.update;
Scene_Map.prototype.update = function() {
    fun_map_update.call(this);
    if ( showHpSwitch){
    if( !this.showHp ){
      this.showHp = new Sprite( new Bitmap( 400,200 ) )
      this.showHp.x = 30;
      this.showHp.y = -25;
      this.addChild( this.showHp )
    }else{
      this.showHp.bitmap.fontSize = 18;
      this.showHp.bitmap.clear();
      this.showHp.bitmap.drawText( '攻击力:'+$gameParty.members()[0].atk, 0, 0, 400, 200, 'left' );
      this.showHp.bitmap.drawText( '防御力:'+$gameParty.members()[0].def, 0, 24, 400, 200, 'left' );
      this.showHp.bitmap.drawText( '当前层数:'+$gameVariables.value(21), 0, 48, 400, 200, 'left' );


      //this.showHp.bitmap.drawText( '敏捷度:'+$gameParty.members()[0].agi, 0, 24, 400, 200, 'left' );
      //this.showHp.bitmap.drawText( '暴击率:'+$gameParty.members()[0].cri, 0, 48, 400, 200, 'left' ); 
      //this.showHp.bitmap.drawText( '命中率:'+$gameParty.members()[0].hit, 0, 72, 400, 200, 'left' );
    }
  }
};

Window_Status.prototype.drawBasicInfo = function(x, y) {
    const lineHeight = this.lineHeight();
    //this.drawActorLevel(this._actor, x, y + lineHeight * 0);注释掉等级
    this.drawActorIcons(this._actor, x, y + lineHeight * 1);
    this.placeBasicGauges(this._actor, x, y + lineHeight * 2);
};

const Scene_Equip_createStatusWindow = Scene_Equip.prototype.createStatusWindow;
Scene_Equip.prototype.createStatusWindow = function() {
    Scene_Equip_createStatusWindow.call(this);
    this._statusWindow.hide();
}

Scene_Equip.prototype.commandWindowRect = function() {
    const wx = 0;
    const wy = this.mainAreaTop();
    const ww = Graphics.boxWidth;
    const wh = this.calcWindowHeight(1, true);
    return new Rectangle(wx, wy, ww, wh);
};

Scene_Equip.prototype.slotWindowRect = function() {
    const commandWindowRect = this.commandWindowRect();
    const wx = 0;
    const wy = commandWindowRect.y + commandWindowRect.height;
    const ww = Graphics.boxWidth;
    const wh = this.mainAreaHeight() - commandWindowRect.height;
    return new Rectangle(wx, wy, ww, wh);
};

Window_ShopStatus.prototype.drawPossession = function(x, y) {
    const width = 200;
    const possessionWidth = this.textWidth("00");
    this.changeTextColor(ColorManager.systemColor());
    this.drawText(TextManager.possession, x, y, width - possessionWidth);
    this.resetTextColor();
    this.drawText($gameParty.numItems(this._item), x, y, width, "right");
};


DataManager.maxSavefiles = function() {
    return 2;
};

Window_StatusBase.prototype.drawActorSimpleStatus = function(actor, x, y) {
    const lineHeight = this.lineHeight();
    const x2 = x + 180;
    this.drawActorName(actor, x, y);
    //注释等级显示
    //this.drawActorLevel(actor, x, y + lineHeight * 1);
    this.drawActorIcons(actor, x - 180, y + lineHeight * 2 + 60);
    //注释显示职业
    //this.drawActorClass(actor, x2, y);
   //注释放置计量条
   //this.placeBasicGauges(actor, x2, y + lineHeight);
   this.placeBasicGauges(actor, x2 - 180, y + lineHeight + 30);
};

/////////////////////////


Sprite_Gauge.prototype.gaugeX = function() {
    if (this._statusType === "time") {
        return 0;
    } else {
        return 0 ;
        // return this.measureLabelWidth() + 3;
    }
};


Sprite_Gauge.prototype.gaugeHeight = function() {
    return 24;
};


Sprite_Gauge.prototype.labelY = function() {
    return 1;
};


Sprite_Gauge.prototype.valueFontSize = function() {
    return $gameSystem.mainFontSize() - 10;
};

Scene_Menu.prototype.initialize = function() {
    Scene_MenuBase.prototype.initialize.call(this);
    this._sceneType = 'Scene_Menu';
};


Sprite_Gauge.prototype.bitmapWidth = function() {
    if(SceneManager._scene._sceneType == 'Scene_Menu'){
        return 144;
    }else{
        return 80;
    }
    
};

//
Sprite_Gauge.prototype.drawGaugeRect = function(x, y, width, height, color) {
    const rate = this.gaugeRate();
    const fillW = Math.floor((width - 2) * rate);
    const fillH = height - 2;
    const color0 = this.gaugeBackColor();
    let color1; 
    let color2; 
    switch (this._statusType) { 
        case "hp":
            color1 = '#DF0101'; 
            color2 = '#DF3A01'; 
            break;
        case "mp":
            color1 = '#58ACFA'; 
            color2 = '#58ACFA'; 
            break;
        case "tp":
            color1 = '#5FB404'; 
            color2 = '#5FB404';
            break;
        default:
            color1 = this.gaugeColor1(); // 
            color2 = this.gaugeColor2(); // 
            break;
    }
    this.bitmap.fillRect(x, y, width, height, color0);
    this.bitmap.gradientFillRect(x + 1, y + 1, fillW, fillH, color1, color2);
};

Sprite_Gauge.prototype.label = function() {
    // switch (this._statusType) {
    //     case "hp":
    //         return TextManager.hpA;
    //     case "mp":
    //         return TextManager.mpA;
    //     case "tp":
    //         return TextManager.tpA;
    //     default:
    //         return "";
    // }
    return '';
};

Sprite_Gauge.prototype.drawValue = function() {
    const currentValue = this.currentValue();
    const width = this.bitmapWidth();
    const height = this.textHeight();
    this.setupValueFont();
    this.bitmap.drawText(currentValue, 0, 0, width, height, "center");
};

Sprite_Name.prototype.bitmapWidth = function() {
    return 78;
};

Sprite_Name.prototype.redraw = function() {
    const name = this.name();
    const width = this.bitmapWidth();
    const height = this.bitmapHeight();
    this.setupFont();
    this.bitmap.clear();
    this.bitmap.drawText(name, 0, 0, width, height, "center");
};

Sprite_Name.prototype.fontSize = function() {
    return 18;
};