diff --git a/source/ChartingState.hx b/source/ChartingState.hx index dd22f1f71..20bfa51ed 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -350,6 +350,23 @@ class ChartingState extends MusicBeatState // vocals.stop(); } + var pathShit = Paths.inst(daSong); + + if (!openfl.utils.Assets.cache.hasSound(pathShit)) + { + var library = Assets.getLibrary("songs"); + var symbolPath = pathShit.split(":").pop(); + // @:privateAccess + // library.types.set(symbolPath, SOUND); + // @:privateAccess + // library.pathGroups.set(symbolPath, [library.__cacheBreak(symbolPath)]); + // var callback = callbacks.add("song:" + pathShit); + openfl.utils.Assets.loadSound(pathShit).onComplete(function(_) + { + // callback(); + }); + } + FlxG.sound.playMusic(Paths.inst(daSong), 0.6); // WONT WORK FOR TUTORIAL OR TEST SONG!!! REDO LATER @@ -549,7 +566,8 @@ class ChartingState extends MusicBeatState PlayState.SONG = _song; FlxG.sound.music.stop(); vocals.stop(); - FlxG.switchState(new PlayState()); + LoadingState.loadAndSwitchState(new PlayState()); + // FlxG.switchState(new PlayState()); } if (FlxG.keys.justPressed.E) @@ -1064,6 +1082,10 @@ class ChartingState extends MusicBeatState var data:String = Json.stringify(json); + #if hl + var filename = _song.song.toLowerCase(); + sys.io.File.saveContent('./$filename.json', data); + #else if ((data != null) && (data.length > 0)) { _file = new FileReference(); @@ -1072,6 +1094,7 @@ class ChartingState extends MusicBeatState _file.addEventListener(IOErrorEvent.IO_ERROR, onSaveError); _file.save(data.trim(), _song.song.toLowerCase() + ".json"); } + #end } function onSaveComplete(_):Void diff --git a/source/ui/animDebugShit/DebugBoundingState.hx b/source/ui/animDebugShit/DebugBoundingState.hx index c1b810a23..5a2b1535d 100644 --- a/source/ui/animDebugShit/DebugBoundingState.hx +++ b/source/ui/animDebugShit/DebugBoundingState.hx @@ -69,8 +69,8 @@ class DebugBoundingState extends FlxState FlxG.cameras.add(hudCam, false); - // bg = FlxGridOverlay.create(10, 10); - bg = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.GREEN); + bg = FlxGridOverlay.create(10, 10); + // bg = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.GREEN); bg.scrollFactor.set(); add(bg);