//=============================================================================
// MKJR_Customize.js  2025/11/23
// The MIT License (MIT)
//=============================================================================

/*:
 * @専用カスタマイズ
 * @author No_Mekujira
 *
 */

(function () {
	'use strict';
	var pluginName = "GameInfo";
	var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
	Game_Interpreter.prototype.pluginCommand = function(command,args){
		_Game_Interpreter_pluginCommand.call(this,command,args);
		if(command === pluginName){
			switch(args[0]){
				case 'show':
					SceneManager.push(Scene_GameInfo);
					break;
			}
		}
	};
	
	
	
	//Original Window
	function Scene_GameInfo(){
		this.initialize.apply(this,arguments);
	}
	
	Scene_GameInfo.prototype = Object.create(Scene_Base.prototype);
	Scene_GameInfo.prototype.constructor = Scene_GameInfo;
	Scene_GameInfo.prototype.initialize = function(){
		Scene_Base.prototype.initialize.call(this);
	};
	
	Scene_GameInfo.prototype.create = function(){
		Scene_Base.prototype.create.call(this);
		this.createWindowLayer();
		this.createMainWindow();
		this._mainWindow.drawText('hello world',0,0,this._mainWindow.width);
		this._mainWindow.drawText('Hello world!',0,20,this._mainWindow.width);
		
		this.createCommandWindow();
	};
	
	Scene_GameInfo.prototype.createMainWindow = function(){
		var ww = 240;
		var wh = 100;
		var wx = 20;//var wx = (Graphics.width-ww)/2;
		var wy = 20;//var wy = (Graphics.height-wh)/2;
		this._mainWindow = new Window_Base(wx,wy,ww,wh);
		this.addWindow(this._mainWindow);
	};
	
	Scene_GameInfo.prototype.createCommandWindow=function(){
		var wx=0;
		var wy = this._mainWindow.y+this._mainWindow.height+20;
		this._commandWindow=new CommandGameInfo(wx,wy);
		this._commandWindow.setHandler('ok',this.onCommandOk.bind(this));
		this.addWindow(this._commandWindow);
	};
	
	Scene_GameInfo.prototype.onCommandOk=function(){
		this.popScene();
	};
	
	function CommandGameInfo(){
		this.initialize.apply(this,arguments);
	}
	
	CommandGameInfo.prototype=Object.create(Window_Command.prototype);
	CommandGameInfo.prototype.constructor=CommandGameInfo;
	CommandGameInfo.prototype.initialize=function(x,y){
		Window_Command.prototype.initialize.call(this,x,y);
	};
	
	CommandGameInfo.prototype.makeCommandList=function(){
		this.addCommand('戻る','back',true);
	};

})(this);
