I'm posting this on behalf of a friend who I'm working along in a game, but we had encountered a problem.
Console logs:
for the SelectPartyColumn object, here setData exists as a function
this is for PartyMembersColumn object, and here it shows that setData also exists
but somehow it says "undefined" in the console log
and gave the error:
Code:
Scene_PartyCreator.prototype.createSelectPartyColumn = function() {
this._selectPartyColumn = new SelectPartyWindow(0, Graphics.height/8, Graphics.width/3, Graphics.height*(7/8));
console.log("This is suppose to be the method for selectPartyColumn Object: ");
console.log(this._selectPartyColumn.setData);
console.log(this._selectPartyColumn);
this._selectPartyColumn.setData(this._partyList);
this._selectPartyColumn.setHandler('ok', this.onPartyOk.bind(this));
this._selectPartyColumn.setHandler('cancel', this.onTestCancel.bind(this));
this.addWindow(this._selectPartyColumn);
};
Scene_PartyCreator.prototype.createPartyMembersColumn = function() {
this._partyMembersColumn = new PartyMembersWindow(Graphics.width/3, Graphics.height/8, Graphics.width/3, Graphics.height*(7/8));
console.log("This is suppose to be the method for partyMembersColumn Object: ");
console.log(this._partyMembersColumn.setData);
console.log(this._partyMembersColumn);
this._partyMembersColumn.setData($gameParties.getParty(1));
this._partyMembersColumn.setHandler('cancel', this.onLustrousCancel.bind(this));
this.addWindow(this._partyMembersColumn);
};
Code:
SelectPartyWindow.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this._data = $gameParties.parties();
console.log(this._data);
this.refresh();
};
SelectPartyWindow.prototype.setData = function(data) {
if (this._data !== data) {
this._data = data;
this.refresh();
}
};
Code:
PartyMembersWindow.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this._data = $gameParties.getParty(1);
this.refresh();
};
// TODO: Somehow this isn't a function...
PartyMembersWindow.prototype.setData = function(data) {
console.log("Setting data for party members window");
console.log(data);
if (this._data !== data) {
this._data = data;
this.refresh();
}
};
Console logs:
Code:
This is suppose to be the method for selectPartyColumn Object:
PartyCreator.js:130 ƒ (data) {
if (this._data !== data) {
this._data = data;
this.refresh();
}
}
Code:
This is suppose to be the method for partyMembersColumn Object:
PartyCreator.js:141 undefined
for the SelectPartyColumn object, here setData exists as a function
this is for PartyMembersColumn object, and here it shows that setData also exists
but somehow it says "undefined" in the console log
and gave the error: