RPG Maker MV - изменение использования пункта в меню
Я пытаюсь создать свое собственное меню в своей игре RPG Maker MV, и в этом меню я немного изменяю раздел пунктов, но столкнулся с парой проблем, с которыми, я надеялся, кто-то может мне помочь.
Я вставлю свой код внизу, чтобы вы могли видеть, что у меня есть на нем до сих пор
Категории товаров
В моем меню есть только две категории элементов ("Элемент" и "Ключевой элемент"), поэтому я изменил его так, чтобы в окне категорий отображались только эти два элемента, а максимальное количество столбцов было равно 2. Однако в в окне категорий метка "Ключевой элемент" не видна, а поля выбора для категорий вообще не совпадают с метками.
Описание предметов / Помощь
Я переместил окно справки, которое показывает описания элементов справа, с окном категорий и списков элементов слева. Однако, хотя это выглядит хорошо, текст описания элемента обрезается из-за уменьшенной ширины окна справки. Есть ли способ, которым текст может быть перенесен на размер поля?
Пункт использования
Возможно, самое большое изменение, которое я хочу сделать, это то, что когда вы используете предмет, вам не нужно выбирать, на каком актере вы хотите его использовать. Ни один из элементов в моей игре не относится к конкретному действующему лицу (например, зелья и т. Д.), Поэтому нет необходимости использовать его на актере, вместо этого они вызывают общие функции, которые затем выполняют требуемое действие.
Однако я изменил функцию "Использовать элемент", чтобы удалить некоторые ее элементы, которые вызывали ошибки из-за того, что окно актера больше не присутствует. Но я, кажется, в ситуации, когда он зависает, когда я пытаюсь использовать предмет или получаю ошибку перегрузки. Так может кто-нибудь помочь мне с тем, что мне нужно сделать здесь?
КОД
(function(){
Scene_Menu.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createCommandWindow();
this.createCommandImages();
};
Scene_Menu.prototype.createCommandImages = function() {
this._itemButton = new Sprite();
this._itemButton.x = 7;
this._itemButton.y = 41;
this._mapButton = new Sprite();
this._mapButton.x = 7;
this._mapButton.y = 169;
this._optionsButton = new Sprite();
this._optionsButton.x = 10;
this._optionsButton.y = 281;
this._endButton = new Sprite();
this._endButton.x = 14;
this._endButton.y = 389;
this.addChild(this._itemButton);
this.addChild(this._mapButton);
this.addChild(this._optionsButton);
this.addChild(this._endButton);
};
Scene_Menu.prototype.update = function() {
Scene_MenuBase.prototype.update.call(this);
switch(this._commandWindow._index)
{
case 0:
this._itemButton.bitmap = ImageManager.loadPicture('ItemsA');
this._mapButton.bitmap = ImageManager.loadPicture('Map');
this._optionsButton.bitmap = ImageManager.loadPicture('Options');
this._endButton.bitmap = ImageManager.loadPicture('End');
break;
case 1:
this._itemButton.bitmap = ImageManager.loadPicture('Items');
this._mapButton.bitmap = ImageManager.loadPicture('MapA');
this._optionsButton.bitmap = ImageManager.loadPicture('Options');
this._endButton.bitmap = ImageManager.loadPicture('End');
break;
case 2:
this._itemButton.bitmap = ImageManager.loadPicture('Items');
this._mapButton.bitmap = ImageManager.loadPicture('Map');
this._optionsButton.bitmap = ImageManager.loadPicture('OptionsA');
this._endButton.bitmap = ImageManager.loadPicture('End');
break;
case 3:
this._itemButton.bitmap = ImageManager.loadPicture('Items');
this._mapButton.bitmap = ImageManager.loadPicture('Map');
this._optionsButton.bitmap = ImageManager.loadPicture('Options');
this._endButton.bitmap = ImageManager.loadPicture('EndA');
break;
}
};
Scene_Menu.prototype.start = function() {
Scene_MenuBase.prototype.start.call(this);
};
Scene_Menu.prototype.createCommandWindow = function() {
this._commandWindow = new Window_MenuCommand(0, 0);
this._commandWindow.visible = false;
this._commandWindow.x = Graphics.boxWidth;
this._commandWindow.y = Graphics.boxHeight;
this._commandWindow.setHandler('item', this.commandItem.bind(this));
//this._commandWindow.setHandler('map', this.commandItem.bind(this));
this._commandWindow.setHandler('options', this.commandOptions.bind(this));
//this._commandWindow.setHandler('save', this.commandSave.bind(this));
this._commandWindow.setHandler('gameEnd', this.commandGameEnd.bind(this));
this._commandWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._commandWindow);
};
//Scene_Menu.prototype.commandMap = function(){
//SceneManager.push(Scene_Map);
//};
Scene_MenuBase.prototype.createBackground = function() {
this._backgroundSprite = new Sprite();
this._backgroundSprite.bitmap = ImageManager.loadPicture('MenuBackground');
this.addChild(this._backgroundSprite);
};
Window_MenuCommand.prototype.makeCommandList = function() {
this.addMainCommands();
this.addMapCommand();
this.addOptionsCommand();
this.addGameEndCommand();
};
Window_MenuCommand.prototype.addMainCommands = function() {
var enabled = this.areMainCommandsEnabled();
if (this.needsCommand('item')) {
this.addCommand(TextManager.item, 'item', enabled);
}
};
Window_MenuCommand.prototype.addMapCommand = function(){
this.addCommand('Map', 'map', true);
};
Scene_MenuBase.prototype.createHelpWindow = function() {
this._helpWindow = new Window_Help();
this._helpWindow.x = 430;
this._helpWindow.y = 30;
this._helpWindow.width = 340;
this._helpWindow.height = 570;
this._helpWindow.opacity = 0;
this.addWindow(this._helpWindow);
};
//-----------------------------------------------------------------------------
// Scene_Item
//
// The scene class of the item screen.
Scene_Item.prototype.create = function() {
Scene_ItemBase.prototype.create.call(this);
this.createCategoryWindow();
this.createHelpWindow();
this.createItemWindow();
};
Scene_Item.prototype.createCategoryWindow = function() {
this._categoryWindow = new Window_ItemCategory();
this._categoryWindow.setHelpWindow(this._helpWindow);
this._categoryWindow.x = 60;
this._categoryWindow.y = 30;
this._categoryWindow.width = 350;
this._categoryWindow.opacity = 0;
this._categoryWindow.setHandler('ok', this.onCategoryOk.bind(this));
this._categoryWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._categoryWindow);
};
Window_ItemCategory.prototype.makeCommandList = function() {
this.addCommand(TextManager.item, 'item');
this.addCommand(TextManager.keyItem, 'keyItem');
};
Scene_Item.prototype.createItemWindow = function() {
var wy = this._categoryWindow.y + this._categoryWindow.height;
var wh = Graphics.boxHeight - wy - 20;
this._itemWindow = new Window_ItemList(60, wy, 350, wh);
this._itemWindow.opacity = 0;
this._itemWindow.setHelpWindow(this._helpWindow);
this._itemWindow.setHandler('ok', this.onItemOk.bind(this));
this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
this.addWindow(this._itemWindow);
this._categoryWindow.setItemWindow(this._itemWindow);
};
Scene_Item.prototype.onItemOk = function() {
$gameParty.setLastItem(this.item());
this.useItem();
};
Scene_ItemBase.prototype.useItem = function() {
this.playSeForItem();
//this.user().useItem(this.item());
//this.applyItem();
this.checkCommonEvent();
//this.checkGameover();
//this._actorWindow.refresh();
};
Window_ItemCategory.prototype.maxCols = function() {
return 2;
};
Window_ItemList.prototype.maxCols = function() {
return 1;
};
Window_ItemList.prototype.spacing = function() {
return 24;
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Scene_Options
//
// The scene class of the options screen.
Scene_Options.prototype.createOptionsWindow = function() {
this._optionsWindow = new Window_Options();
this._optionsWindow.x = 60;
this._optionsWindow.y = 30;
this._optionsWindow.width = 350;
this._optionsWindow.opacity = 0;
this._optionsWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._optionsWindow);
this.setBackgroundOpacity = 0;
};
Window_Options.prototype.windowWidth = function() {
return 350;
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Scene_GameEnd
//
// The scene class of the game end screen.
Scene_GameEnd.prototype.createCommandWindow = function() {
this._commandWindow = new Window_GameEnd();
this._commandWindow.x = 60;
this._commandWindow.y = 30;
this._commandWindow.opacity = 0;
this._commandWindow.setHandler('toTitle', this.commandToTitle.bind(this));
this._commandWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._commandWindow);
};
Scene_GameEnd.prototype.createBackground = function() {
Scene_MenuBase.prototype.createBackground.call(this);
this.setBackgroundOpacity(255);
};
//-----------------------------------------------------------------------------
})();