From 122545405b311b995010b4f3dca5d0df2e12b9e5 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 2 Aug 2021 13:54:19 -0400 Subject: [PATCH 1/2] chart editor slight fixins in progress --- source/ChartingState.hx | 20 ++++++++++++++++++- source/ui/animDebugShit/DebugBoundingState.hx | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index dd22f1f71..7cce329f9 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) 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); From 3fe28602d3dd4eb7a789df474752e036fda73acf Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 2 Aug 2021 14:11:43 -0400 Subject: [PATCH 2/2] chart shit cooler (hashlink saving workaround) --- source/ChartingState.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 7cce329f9..20bfa51ed 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -1082,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(); @@ -1090,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