From 4dfdf7f3776acdfaff7e9ba7d5f8df35cf4f5ebf Mon Sep 17 00:00:00 2001 From: kuangthree Date: Wed, 14 Feb 2024 14:31:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=A9=E5=B1=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=A8=A1=E5=BC=8F=E6=97=B6=E4=BB=8E=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E5=90=AF=E5=8A=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/init/import.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/noname/init/import.js b/noname/init/import.js index 97dafd47f..2b7f302b5 100644 --- a/noname/init/import.js +++ b/noname/init/import.js @@ -39,6 +39,13 @@ function generateImportFunction(type, pathParser) { await game.import(type, await createEmptyExtension(name)); return; } + if(type == 'mode' && lib.mode[name] && lib.mode[name].fromextension){ + let loadModeMethod = lib.init['setMode_'+name]; + if(typeof loadModeMethod === 'function'){ + await Promise.resolve(loadModeMethod()); + return; + } + } let path = pathParser(name); // 通过浏览器自带的script标签导入可直接获取报错信息,且不会影响JS运行 // 此时代码内容也将缓存在浏览器中,故再次import后将不会重新执行代码内容(测试下来如此)