[RMMV] Alphabetize list of craftable items in YEP.58 – Item Synthesis plugin

If anyone else uses the Yanfly's Item Synthesis plugin, by default it sorts items to be crafted by item ID. If you're not willing to keep your items in order by ID from the start (like me) the alphabetization of items in menus is a good alternative.

I banged my head on Yanfly's code a little until I found this solution. In version 1.11 (and maybe future versions), you can change it from sorting by ID to alphabetical using the modified code below. I have not stress-tested this, but it has been working for me. Cheers!

Code:
//this is where the list of items was sorted by ID#
Scene_Synthesis.sortList = function(list) {
    list.sort((a,b) => (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0)); //now this sorts by item name
   
    /* YEP original:
    list.sort(function(a, b) {
        //var p1 = a.id;
        //var p2 = b.id;
        if (p1 !== p2) {
            return p1 - p2;
        }
        return b - a;
    });
    */
    return list;
};

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-alphabetize-list-of-craftable-items-in-yep-58-item-synthesis-plugin.103648/