Merge pull request #284 from nofficalfs/PR-Node-Path

[Suggest] Support lib.path
This commit is contained in:
Spmario233 2023-09-07 08:10:26 +08:00 committed by GitHub
commit 7f25ec94f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 0 deletions

View File

@ -6992,6 +6992,7 @@
'<li>游击:若一名角色拥有带有“游击”的技能,则当该游击技能执行至“游击”处时,若本次技能的目标角色在你的攻击范围内,且你不在其攻击范围内,则你可以执行“游击”后的额外效果。'+
''
},
path:{},
setIntro:function(node,func,left){
if(lib.config.touchscreen){
if(left){
@ -8237,6 +8238,13 @@
delete _status.htmlbg;
window.game=game;
// 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)=>{
throw e;
});
var styleToLoad=6;
var styleLoaded=function(){
styleToLoad--;
@ -8588,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;

24
game/path.min.js vendored Normal file

File diff suppressed because one or more lines are too long