From 1c8d032f62c39240c62163bb4b30ddf43a48b3de Mon Sep 17 00:00:00 2001 From: HackDev <80620538+Hackx2@users.noreply.github.com> Date: Mon, 1 Apr 2024 12:06:10 +0100 Subject: [PATCH] tutorial fix --- source/backend/utils/Paths.hx | 10 +++++++--- source/game/Main.hx | 5 ++++- source/game/editors/ChartingState.hx | 8 +++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/source/backend/utils/Paths.hx b/source/backend/utils/Paths.hx index 0d96ac3..998470e 100644 --- a/source/backend/utils/Paths.hx +++ b/source/backend/utils/Paths.hx @@ -221,9 +221,13 @@ class Paths inline static public function voices(song:String):Any { - var songKey:String = '${formatToSongPath(song)}/Voices'; - var voices = returnSound('songs', songKey); - return voices; + if(song == 'tutorial') return null; + else { + var songKey:String = '${formatToSongPath(song)}/Voices'; + var voices = returnSound('songs', songKey); + return voices; + } + } inline static public function inst(song:String):Any diff --git a/source/game/Main.hx b/source/game/Main.hx index 9bd10a7..4f72bd3 100644 --- a/source/game/Main.hx +++ b/source/game/Main.hx @@ -133,11 +133,14 @@ class Main extends Sprite var path:String; var callStack:Array = CallStack.exceptionStack(true); var dateNow:String = Date.now().toString(); + var currentName = Application.current.meta.get('file'); dateNow = dateNow.replace(" ", "_"); dateNow = dateNow.replace(":", "'"); - path = "./crash/" + "AstroEngine_" + dateNow + ".txt"; + //path = "./crash/" + "AstroEngine_" + dateNow + ".txt"; + path = './crash/${currentName}_$dateNow.txt'; + trace(path); for (stackItem in callStack) { diff --git a/source/game/editors/ChartingState.hx b/source/game/editors/ChartingState.hx index f9d26be..36f53dd 100644 --- a/source/game/editors/ChartingState.hx +++ b/source/game/editors/ChartingState.hx @@ -1370,15 +1370,13 @@ class ChartingState extends MusicBeatState function loadSong():Void { if (FlxG.sound.music != null) - { FlxG.sound.music.stop(); - // vocals.stop(); - } - var file:Dynamic = backend.utils.Paths.voices(currentSongName); + var file = Paths.voices(currentSongName); vocals = new FlxSound(); - if (Std.isOfType(file, Sound) || OpenFlAssets.exists(file)) { + if (Std.isOfType(file, Sound) || OpenFlAssets.exists(file) && file != null) { vocals.loadEmbedded(file); + vocals.autoDestroy = false; FlxG.sound.list.add(vocals); } generateSong();