Created
November 5, 2021 00:22
-
-
Save elleonard/2253020b8abbcb6b4a15309fb8c22207 to your computer and use it in GitHub Desktop.
特定のカテゴリを選択済みの状態でアイテムシーンを開くプラグインコマンド
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
let selectedCategory = ''; | |
const _Scene_Item_start = Scene_Item.prototype.start; | |
Scene_Item.prototype.start = function () { | |
_Scene_Item_start.call(this); | |
if (selectedCategory) { | |
this._categoryWindow.selectSymbol(selectedCategory); | |
this._categoryWindow.deactivate(); | |
this._itemWindow.activate(); | |
this._itemWindow.selectLast(); | |
selectedCategory = ''; | |
} | |
}; | |
const _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; | |
Game_Interpreter.prototype.pluginCommand = function(command, args) { | |
_Game_Interpreter_pluginCommand.call(this, command, args); | |
/** | |
* プラグインコマンド: sceneItemWithCategory 開きたいカテゴリ | |
* 開きたいカテゴリに指定できるもの: | |
* item | |
* weapon | |
* armor | |
* keyItem | |
*/ | |
if (command === 'sceneItemWithCategory') { | |
selectedCategory = args[0]; | |
SceneManager.push(Scene_Item); | |
} | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment