Merge pull request #861 from universe-st/PR-Branch-extsort

扩展列表项预留排序方法
This commit is contained in:
Spmario233 2024-01-27 19:53:16 +08:00 committed by GitHub
commit 434d81eb5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -3703,7 +3703,13 @@ class Create extends Uninstantable {
// if(!get.config('menu_loadondemand')) node._initLink();
return node;
};
for (var i in lib.extensionMenu) {
let extensionsInMenu = Object.keys(lib.extensionMenu);
if(lib.config.extensionSort && Array.isArray(lib.config.extensionSort)){
extensionsInMenu.sort((a,b)=>{
return lib.config.extensionSort.indexOf(a) - lib.config.extensionSort.indexOf(b);
});
}
for (let i of extensionsInMenu) {
if (lib.config.all.stockextension.includes(i) && !lib.config.all.plays.includes(i)) continue;
if (lib.config.hiddenPlayPack.includes(i)) continue;
createModeConfig(i, start.firstChild);