This commit is contained in:
Rintim 2023-09-06 22:21:37 +08:00
parent 21133e1cb2
commit a288afc29c
1 changed files with 4 additions and 3 deletions

View File

@ -8238,9 +8238,8 @@
delete _status.htmlbg; delete _status.htmlbg;
window.game=game; window.game=game;
// node:path library // node:path library alternative
if (typeof window.require=="function") lib.path=require("path"); if (typeof module!="object"||typeof module.exports!="object") lib.init.js(`${lib.assetURL}game`,"path.min",()=>{
else lib.init.js(`${lib.assetURL}game`,"path.min",()=>{
lib.path=window._noname_path; lib.path=window._noname_path;
delete window._noname_path; delete window._noname_path;
},(e)=>{ },(e)=>{
@ -8597,10 +8596,12 @@
else if(typeof window.require=='function'){ else if(typeof window.require=='function'){
lib.node={ lib.node={
fs:require('fs'), fs:require('fs'),
path:require("path"),
debug:function(){ debug:function(){
require('electron').remote.getCurrentWindow().toggleDevTools(); require('electron').remote.getCurrentWindow().toggleDevTools();
} }
}; };
lib.path=lib.node.path;
game.download=function(url,folder,onsuccess,onerror,dev,onprogress){ game.download=function(url,folder,onsuccess,onerror,dev,onprogress){
if(url.indexOf('http')!=0){ if(url.indexOf('http')!=0){
url=get.url(dev)+url; url=get.url(dev)+url;