//=============================================================================
// InfoWindow.js
//=============================================================================

/*:
 * @plugindesc 情報表示ウィンドウをメニュー画面に追加するプラグイン
 * @author Me
 *
 * @help 情報表示ウィンドウをメニュー画面上に追加します。
 *
 */

(function() {

	// マップ上にウィンドウ表示するよ宣言
	var Scene_map_start = Scene_Map.prototype.start;
	Scene_Map.prototype.start = function() {
		Scene_map_start.call(this);
	    this._InfoWindow = new Window_Info();
	    this.addWindow(this._InfoWindow);
	};
    var _Scene_Map_update = Scene_Map.prototype.update;
    Scene_Map.prototype.update = function() {
        _Scene_Map_update.call(this);
        this._InfoWindow.setText();
    };
	
	// ここからメニューウィンドウ作り始まります。
	function Window_Info() {
	    this.initialize.apply(this, arguments);
	}

	Window_Info.prototype = Object.create(Window_Base.prototype);
	Window_Info.prototype.constructor = Window_Info;
	Window_Info.prototype.initialize = function() {
		var x =46;
		var y = 30;
	    var width = 250;
	    var height = 210;
	    Window_Base.prototype.initialize.call(this, x, y, width, height);
	};

	Window_Info.prototype.setText = function(str) {
		this._text = str;
		this.refresh();
	};
	
	// ウィンドウに載せる内容
	Window_Info.prototype.refresh = function() {
	    this.contents.clear();
		this.resetTextColor();

        //this.drawIcon(210, 1, 1);
		//this.changeTextColor(this.textColor(16));
		//this.resetTextColor(18);

		this.changeTextColor(this.textColor(0));


		this.drawText("攻撃力",30, 0);
		this.drawText($gameVariables.value(3) + "",180,0, 50,"right");

		this.drawText("最大HP",30, 30);
		this.drawText($gameVariables.value(4) + "",180,30, 50,"right");

		this.drawText("最大MP",30, 60);
		this.drawText($gameVariables.value(5) + "",180,60, 50,"right");

		this.drawText("HP回復量",30, 90);
		this.drawText($gameVariables.value(8) + "",180,90, 50,"right");

		//this.drawText("MP回復量",30, 120);
		//this.drawText($gameVariables.value(7) + "",180,120, 50,"right");

		this.drawText("ターン数",30, 120);
		this.drawText($gameVariables.value(54) + "",180,120, 50,"right");

		this.drawText("光の珠",0, 162);
		this.drawText($gameVariables.value(59) + "",180,162, 50,"right");

		//this.drawIcon(162, 4, 150);
		//this.drawText("現在地点",30, 150);
		//this.drawText($gameVariables.value(36) + "",140,150,  0,"left");

	};
	
	// フォントサイズ
	Window_Info.prototype.standardFontSize = function() {
    	return 22;
    	};
	// ウィンドウの透明度
	Window_Info.prototype.standardBackOpacity = function() {
    	return 0;
	};
    // ウィンドウの余白
	Window_Info.prototype.standardPadding = function() {
    	return 8;
	};
	// ウィンドウの色調
	Window_Info.prototype.updateTone = function() {
    	this.setTone(0, 0, 0);
	};
	
})();