From e7d5a64b7637994eb1be0a4c924041330391154d Mon Sep 17 00:00:00 2001 From: Rintim Date: Sun, 10 Sep 2023 21:06:46 +0800 Subject: [PATCH] async. --- game/game.js | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/game/game.js b/game/game.js index 8441b63d2..1d344f67b 100644 --- a/game/game.js +++ b/game/game.js @@ -8415,13 +8415,16 @@ styleToLoad--; if(styleToLoad==0){ if(extensionlist.length&&(lib.config.mode!='connect'||show_splash)){ - var extToLoad=extensionlist.length; - var extLoaded=function(){ - extToLoad--; + _status.extensionLoading=[]; + let extToLoad=extensionlist.length; + const extLoaded=gnc.async(function*(){ + --extToLoad; if(extToLoad==0){ + yield Promise.allSettled(_status.extensionLoading); + delete _status.extensionLoading; loadPack(); } - } + }); //读取扩展 var alerted=false; for(var i=0;i