Hello,
As per the title, I am looking for any sort of code that allows me to sort skills, items and equip menu alphabetically. Optionally, I'd want it to be conditional (like checking for a switch), but I haven't found a way to put custom switch flipping into Visustella's Options Core. I had gotten the sorting to work for the skill and item window (see below), but opening the equip menu for any character that has something equipped would crash the game (and putting switch conditions wouldn't let me switch between on/off for some reason). Any help with this would be greatly appreciated. If it helps, I am using the majority of Visustella's plugins.
Code that worked for skills/items but crashed on equip with the message 'cannot read property 'name' of null':
As per the title, I am looking for any sort of code that allows me to sort skills, items and equip menu alphabetically. Optionally, I'd want it to be conditional (like checking for a switch), but I haven't found a way to put custom switch flipping into Visustella's Options Core. I had gotten the sorting to work for the skill and item window (see below), but opening the equip menu for any character that has something equipped would crash the game (and putting switch conditions wouldn't let me switch between on/off for some reason). Any help with this would be greatly appreciated. If it helps, I am using the majority of Visustella's plugins.
Code that worked for skills/items but crashed on equip with the message 'cannot read property 'name' of null':
JavaScript:
if(a.name.toLowerCase() < b.name.toLowerCase()) return -1;
if(a.name.toLowerCase() > b.name.toLowerCase()) return 1;
return 0;