From a288afc29cb287c6e28d0026cfa344391c36caeb Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 6 Sep 2023 22:21:37 +0800 Subject: [PATCH] format. --- game/game.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/game/game.js b/game/game.js index 8285ac3ea..34abde0f5 100644 --- a/game/game.js +++ b/game/game.js @@ -8238,9 +8238,8 @@ delete _status.htmlbg; window.game=game; - // node:path library - if (typeof window.require=="function") lib.path=require("path"); - else lib.init.js(`${lib.assetURL}game`,"path.min",()=>{ + // node:path library alternative + if (typeof module!="object"||typeof module.exports!="object") lib.init.js(`${lib.assetURL}game`,"path.min",()=>{ lib.path=window._noname_path; delete window._noname_path; },(e)=>{ @@ -8597,10 +8596,12 @@ else if(typeof window.require=='function'){ lib.node={ fs:require('fs'), + path:require("path"), debug:function(){ require('electron').remote.getCurrentWindow().toggleDevTools(); } }; + lib.path=lib.node.path; game.download=function(url,folder,onsuccess,onerror,dev,onprogress){ if(url.indexOf('http')!=0){ url=get.url(dev)+url;