That sort() syntax you're referencing is a JavaScript method for arrays. The skillWindow isn't an array, it's its own Object of type Window_SkillList.
You can try applying that to the portion of the window's data that is an array. Try modifying the makeItemList() method from rpg_windows.js:
See how that works.
You can try applying that to the portion of the window's data that is an array. Try modifying the makeItemList() method from rpg_windows.js:
Code:
Window_SkillList.prototype.makeItemList = function() {
if (this._actor) {
this._data = this._actor.skills().filter(function(item) {
return this.includes(item);
}, this);
this._data.sort((a, b) => $dataSkills[a].mpCost-$dataSkills[b].mpCost);
} else {
this._data = [];
}
};See how that works.
JavaScript:
Anyway Thank you!!!this._data.sort((a, b) => a.mpCost - b.mpCost);