From e03475737d0805024c23dfc4a2f7b53ff074ebb5 Mon Sep 17 00:00:00 2001 From: Kade M Date: Sat, 5 Jun 2021 13:52:40 -0700 Subject: [PATCH] unforseen --- source/FreeplayState.hx | 2 ++ source/PlayState.hx | 13 ++++++++++++- source/Song.hx | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index f5ee518..c330edc 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -202,6 +202,8 @@ class FreeplayState extends MusicBeatState if (accepted) { + trace(StringTools.replace(songs[curSelected].songName," ", "-").toLowerCase()); + var poop:String = Highscore.formatSong(StringTools.replace(songs[curSelected].songName," ", "-").toLowerCase(), curDifficulty); trace(poop); diff --git a/source/PlayState.hx b/source/PlayState.hx index a5fe2e0..9c24a1d 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -859,8 +859,15 @@ class PlayState extends MusicBeatState // startCountdown(); + if (SONG.song == null) + trace('song is null???'); + else + trace('song looks gucci'); + generateSong(SONG.song); + trace('generated'); + // add(strumLine); camFollow = new FlxObject(0, 0, 1, 1); @@ -987,6 +994,8 @@ class PlayState extends MusicBeatState // cameras = [FlxG.cameras.list[1]]; startingSong = true; + trace('starting'); + if (isStoryMode) { switch (curSong.toLowerCase()) @@ -1345,6 +1354,8 @@ class PlayState extends MusicBeatState else vocals = new FlxSound(); + trace('loaded vocals'); + FlxG.sound.list.add(vocals); notes = new FlxTypedGroup(); @@ -1359,7 +1370,7 @@ class PlayState extends MusicBeatState // Per song offset check #if windows - var songPath = 'assets/data/' + PlayState.SONG.song.toLowerCase() + '/'; + var songPath = 'assets/data/' + StringTools.replace(PlayState.SONG.song," ", "-").toLowerCase() + '/'; for(file in sys.FileSystem.readDirectory(songPath)) { var path = haxe.io.Path.join([songPath, file]); diff --git a/source/Song.hx b/source/Song.hx index bb13aec..d7bf608 100644 --- a/source/Song.hx +++ b/source/Song.hx @@ -46,6 +46,8 @@ class Song public static function loadFromJson(jsonInput:String, ?folder:String):SwagSong { + trace('loading ' + folder.toLowerCase() + '/' + jsonInput.toLowerCase()); + var rawJson = Assets.getText(Paths.json(folder.toLowerCase() + '/' + jsonInput.toLowerCase())).trim(); while (!rawJson.endsWith("}"))