[2023/09/14: Inchar] wait import.
Use `yield` as `await` to wait `game.import` done.
This commit is contained in:
parent
0eec9bcb51
commit
31a7b69799
12
game/game.js
12
game/game.js
|
@ -33694,12 +33694,10 @@
|
|||
},
|
||||
importExtension:gnc.async(function*(data,finishLoad,exportext,pkg){
|
||||
//by 来瓶可乐加冰
|
||||
if(!window.JSZip){
|
||||
lib.init.js(lib.assetURL+'game','jszip',function(){
|
||||
game.importExtension(data,finishLoad,exportext,pkg);
|
||||
});
|
||||
}
|
||||
else if(get.objtype(data)=='object'){
|
||||
if(!window.JSZip)
|
||||
yield new Promise((resolve,reject)=>lib.init.js(`${lib.assetURL}game`,"jszip",resolve,reject));
|
||||
|
||||
if(get.objtype(data)=='object'){
|
||||
//导出
|
||||
var zip=new JSZip();
|
||||
var filelist=[];
|
||||
|
@ -33807,6 +33805,8 @@
|
|||
if(str===""||undefined) throw('你导入的不是扩展!请选择正确的文件');
|
||||
_status.importingExtension=true;
|
||||
eval(str);
|
||||
yield Promise.allSettled(_status.extensionLoading);
|
||||
delete _status.extensionLoading;
|
||||
_status.importingExtension=false;
|
||||
if(!game.importedPack) throw('err');
|
||||
var extname=game.importedPack.name;
|
||||
|
|
Loading…
Reference in New Issue