(function () { var _currentWindow = null; var Game_Interpreter_PluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function (command, args) { Game_Interpreter_PluginCommand.call(this, command, args); if (command === "ItemInfo") { if (args.length < 2) { return; } if (_currentWindow === null) { _currentWindow = new Window_Item_Info(); SceneManager._scene.addWindow(_currentWindow); } _currentWindow.open(args[0], args[1]); } }; function Window_Item_Info() { this.initialize.apply(this, arguments); } Window_Item_Info.prototype = Object.create(Window_MapName.prototype); Window_Item_Info.prototype.constructor = Window_Item_Info; Window_Item_Info.prototype.initialize = function () { Window_Base.prototype.initialize.call(this, Graphics.boxWidth - this.windowWidth(), 0, this.windowWidth(), this.windowHeight()); this.opacity = 0; this.contentsOpacity = 0; this._showCount = 0; this._text = ""; this._iconIndex = 0; this.refresh(); }; Window_Item_Info.prototype.refresh = function () { this.contents.clear(); var width = this.contentsWidth(); this.drawBackground(0, 0, width, this.lineHeight()); this.drawIcon(this._iconIndex, 10, 2); this.drawText(this._text, 50, 0, width, "left"); } Window_Item_Info.prototype.open = function (type, itemId) { var item = null; switch (type) { case "Weapon": item = $dataWeapons[itemId]; break; case "Armor": item = $dataArmors[itemId]; break; case "Item": default: item = $dataItems[itemId]; break; } this._text = item.name; this._iconIndex = item.iconIndex; Window_MapName.prototype.open.call(this); }}());