It seems like this function of Window_ItemList is responsible for returning the database item:
However, when I invoke this function in my own script, it always returns null for some reason instead of returning the item that is currently selected in the menu... I don't understand why?
this._data is an empty array which is truthy, and the _index property shouldn't be -1 once the selectable window is already set up. Maybe someone can explain what I'm missing here
Code:
Window_ItemList.prototype.item = function() {
var index = this.index();
return this._data && index >= 0 ? this._data[index] : null;
};
However, when I invoke this function in my own script, it always returns null for some reason instead of returning the item that is currently selected in the menu... I don't understand why?
this._data is an empty array which is truthy, and the _index property shouldn't be -1 once the selectable window is already set up. Maybe someone can explain what I'm missing here