fixed the scripts

This commit is contained in:
Yoshman29
2023-01-10 13:54:54 +01:00
parent adb8a48480
commit 494f1ac3ca
5 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
1991
1994
+2 -2
View File
@@ -549,8 +549,8 @@ class PlayState extends MusicBeatState
// ADD YOUR HARDCODED SCRIPTS HERE!
default:
for(content in [
Paths.getFolderContent('songs/${SONG.song.toLowerCase()}/scripts', true, !fromMods),
Paths.getFolderContent('data/charts/', true, !fromMods)]) {
Paths.getFolderContent('songs/${SONG.song.toLowerCase()}/scripts', true, fromMods ? MODS : SOURCE),
Paths.getFolderContent('data/charts/', true, fromMods ? MODS : SOURCE)]) {
for(file in content) {
var ext = Path.extension(file).toLowerCase();
if (Script.scriptExtensions.contains(ext))
+2 -2
View File
@@ -260,7 +260,7 @@ class FreeplaySonglist {
try {
var json:FreeplayJSON = Json.parse(Paths.assetsTree.getSpecificAsset(path, "TEXT", source));
addOGSongs = CoolUtil.getDefault(json.addOGSongs, true);
_addJSONSongs(json.songs, false);
_addJSONSongs(json.songs, source == SOURCE);
} catch(e) {
Logs.trace('Couldn\'t parse Freeplay JSON: ${e.toString()}');
}
@@ -286,7 +286,7 @@ class FreeplaySonglist {
});
}
}
_addJSONSongs(found, false);
_addJSONSongs(found, source == SOURCE);
}
return addOGSongs;
}
+1
View File
@@ -274,6 +274,7 @@ class CoolUtil
}
public static function __loadSong(name:String, difficulty:String) {
PlayState.difficulty = difficulty;
PlayState.SONG = Song.loadFromJson(name, difficulty);
}
public static function setSpriteSize(sprite:FlxSprite, width:Float, height:Float) {
+1 -1
View File
@@ -31,7 +31,7 @@ class Song
public static function loadFromJson(songName:String, ?difficulty:String = "normal"):SwagSong
{
var assetPath = Paths.chart(songName, difficulty);
PlayState.fromMods = assetPath.startsWith("mods");
PlayState.fromMods = Paths.assetsTree.existsSpecific(assetPath, "TEXT", MODS);
var rawJson = Assets.getText(assetPath).trim();
while (!rawJson.endsWith("}"))