diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 92098668c..15b5e73fa 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -130,18 +130,7 @@ class ChartingState extends MusicBeatState _song = PlayState.SONG; else { - _song = { - song: 'Test', - notes: {easy: [], normal: [], hard: []}, - bpm: 150, - needsVoices: true, - player1: 'bf', - player2: 'dad', - speed: {easy: 1, normal: 1, hard: 1}, - validScore: false, - voiceList: ["BF", "BF-pixel"], - extraNotes: [] - }; + _song = SongLoad.songData = SongLoad.getDefaultSwagSong(); } FlxG.mouse.visible = true; diff --git a/source/SongLoad.hx b/source/SongLoad.hx index e5ccd7146..c7bfa7477 100644 --- a/source/SongLoad.hx +++ b/source/SongLoad.hx @@ -77,14 +77,18 @@ class SongLoad diff = SongLoad.curDiff; var songShit:Array = []; - switch (diff) + + if (songData != null) { - case 'easy': - songShit = songData.notes.easy; - case 'normal': - songShit = songData.notes.normal; - case 'hard': - songShit = songData.notes.hard; + switch (diff) + { + case 'easy': + songShit = songData.notes.easy; + case 'normal': + songShit = songData.notes.normal; + case 'hard': + songShit = songData.notes.hard; + } } return songShit; @@ -109,6 +113,22 @@ class SongLoad return speedShit; } + public static function getDefaultSwagSong():SwagSong + { + return { + song: 'Test', + notes: {easy: [], normal: [], hard: []}, + bpm: 150, + needsVoices: true, + player1: 'bf', + player2: 'dad', + speed: {easy: 1, normal: 1, hard: 1}, + validScore: false, + voiceList: ["BF", "BF-pixel"], + extraNotes: [] + }; + } + public static function parseJSONshit(rawJson:String):SwagSong { var swagShit:SwagSong = cast Json.parse(rawJson).song;