Кто-нибудь разбирается в JavaScript?
Я честно вообще 0 в этом, поэтому использую ИИ
я делаю игру на RPG maker MV
И сколько ни пытаюсь объяснить задачу иишке
Все равно он делает по итогу плагин, который выдает ошибку
Обьясняю зачем он: У меня в меню паузы только кнопка INVENTORY. Нет отдельно Items и Equipment. (Rpg maker не может сделать так, чтобы броню можно было одевать через items, только через equipment) И при нажатии на Inventory - открывается Items. и вот функция плагина: В сцене Items он создает кнопку Equipment при нажатии на которую переносит в сцену Equipment. Ошибка: при нажатии на Equipment экран просто застывает и меня не переносит в сцену Equipment.
Как мне объяснили вот в чем ошибка: "Экран зависает, потому что твоя сцена Inventory грузится раньше, чем движок инициализирует Scene_Equip. У тебя Scene_Equip - undefined в момент вызова, из-за чего SceneManager не может перейти, и игра замирает, либо updateTabNavigation - лоно может зациклиться или конфликтовать с вводом, когда push сцены происходит. Код ты не писал - ты просто вставил то, что GPT сгенерил, соответсвтенно тут и косяк."
Как исправить не знаю :') Помогите пожалуйста
Плагин:
Плагин:
/*:
*
@plugindesc Добавляет кнопку Equip в сцену инвентаря для перехода в экипировку
*
*
@param Button Width
*
@desc Ширина кнопки Equip (по умолчанию: 220)
*
@default 220
*
@type number
*
*
@param Button Height
*
@desc Высота кнопки Equip (по умолчанию: 80)
*
@default 80
*
@type number
(function() {
'use strict';
var parameters = PluginManager.parameters('InventoryEquipButton');
var buttonWidth = Number(parameters['Button Width'] || 220);
var buttonHeight = Number(parameters['Button Height'] || 80);
function Window_TabButton() {
this.initialize.apply(this, arguments);
}
Window_TabButton.prototype = Object.create(Window_Selectable.prototype);
Window_TabButton.prototype.constructor = Window_TabButton;
Window_TabButton.prototype.initialize = function(x, y, width, height, text) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this._text = text;
this.refresh();
this.deactivate();
};
Window_TabButton.prototype.maxItems = function() {
return 1;
};
Window_TabButton.prototype.itemWidth = function() {
return this.width - this.padding * 2;
};
Window_TabButton.prototype.itemHeight = function() {
return this.lineHeight() + 16;
};
Window_TabButton.prototype.refresh = function() {
this.contents.clear();
this.drawButtonText();
};
Window_TabButton.prototype.drawButtonText = function() {
var rect = this.itemRect(0);
var color = this.isActive() && this._index >= 0 ?
this.activeColor() : this.normalColor();
this.changeTextColor(color);
this.drawText(this._text, rect.x, rect.y, rect.width, 'center');
};
Window_TabButton.prototype.isActive = function() {
return this.active;
};
Window_TabButton.prototype.processOk = function() {
if (this.isCurrentItemEnabled()) {
SoundManager.playOk();
}
Window_Selectable.prototype.processOk.call(this);
if (this._callback && this.isActive()) {
this._callback();
}
};
Window_TabButton.prototype.processCancel = function() {
Window_Selectable.prototype.processCancel.call(this);
if (this._cancelCallback) {
this._cancelCallback();
}
};
Window_TabButton.prototype.playCursorSound = function() {
SoundManager.playCursor();
};
Window_TabButton.prototype.setHandler = function(symbol, method) {
if (symbol === 'ok') {
this._callback = method;
} else if (symbol === 'cancel') {
this._cancelCallback = method;
}
};
Window_TabButton.prototype.deselect = function() {
this._index = -1;
this.refresh();
};