z-edit / zedit-unified-patching-framework

A zEdit module which provides a framework for dynamic patch generation, similar to SkyProc/SUM.
MIT License
14 stars 3 forks source link

Order of patchers within a single patch file not preserved between sessions. #23

Open mrudat opened 4 years ago

mrudat commented 4 years ago

The order of individual patchers within a patch file is not preserved between sessions. Every time you re-open the "Build Patches" dialogue, the order is reset to what appears to be asciibetical order.

Perhaps something like the following in patcherSevice's getPatchPlugins:

        patchPlugins.forEach(patchPlugin => {
            patchPlugin.patchers = patchPlugin.patchers
                .map((patcher) => [service.settings[patcher.id].order || 0, patcher])
                .sort((a,b) => (a[0] - b[0]))
                .map((e) => e[1]);
        });

And the following in buildPatchesController's updatePatchStatuses:

            patchPlugin.patchers.forEach((patcher, i) => {
                $scope.settings[patcher.id].order = i;
            });
            patcherService.saveSettings();