Skip to content

Commit

Permalink
tutorial fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Apr 1, 2024
1 parent e2aaeaf commit 1c8d032
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
10 changes: 7 additions & 3 deletions source/backend/utils/Paths.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion source/game/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ class Main extends Sprite
var path:String;
var callStack:Array<StackItem> = 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)
{
Expand Down
8 changes: 3 additions & 5 deletions source/game/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1c8d032

Please sign in to comment.