Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
moxie-coder committed Sep 21, 2024
2 parents 85a4034 + 2b45293 commit 3e79456
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
32 changes: 30 additions & 2 deletions source/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ class Paths
var config = splashConfigs.get(splashSkin);
if (config == null) config = initSplashConfig(splashSkin);
var maxAnims:Int = 0;
var animName = config.anim;
if(animName == null)
var animName:String = 'note splash';
if (config != null)
animName = config.anim;
else if(animName == null)
animName = config != null ? config.anim : 'note splash';

var shouldBreakLoop = false;
Expand Down Expand Up @@ -359,6 +361,32 @@ class Paths
return getPreloadPath(file);
}

public static inline function readDirectory(path:String):Array<String> {
#if sys
return FileSystem.readDirectory(path);
#else
// original by Karim Akra
var files:Array<String> = [];

for (possibleFile in Assets.list().filter((f) -> f.contains(path))) {
var file:String = possibleFile.replace('${path}/', "");
if (file.contains("/"))
file = file.replace(file.substring(file.indexOf("/"), file.length), "");

if (!files.contains(file))
files.push(file);
}

files.sort((a, b) -> {
a = a.toUpperCase();
b = b.toUpperCase();
return (a < b) ? -1 : (a > b) ? 1 : 0;
});

return files;
#end
}

static public function getLibraryPath(file:String, library = "preload")
{
return if (library == "preload" || library == "default") getPreloadPath(file); else getLibraryPathForce(file, library);
Expand Down
3 changes: 2 additions & 1 deletion source/UpdateState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ class UpdateState extends MusicBeatState
return '';
#end
}
online_url = "https://github.com/JordanSantiagoYT/FNF-JS-Engine/releases/download/" + TitleState.updateVersion + '/FNF-JS-Engine-${getPlatform}.zip';
var fileEnd = #if android 'apk' #else 'zip' #end;
online_url = "https://github.com/JordanSantiagoYT/FNF-JS-Engine/releases/download/" + TitleState.updateVersion + '/FNF-JS-Engine-${getPlatform}.$fileEnd';
trace("update url: " + online_url);
}

Expand Down

0 comments on commit 3e79456

Please sign in to comment.