From 6fdc090eccdeab76503918b4810c42114bbbaab5 Mon Sep 17 00:00:00 2001 From: nebulazorua Date: Wed, 8 May 2024 19:53:47 +0800 Subject: [PATCH 1/2] i have accidentally done this and wiped out my chart many times --- source/funkin/play/PlayState.hx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 44ad819c4..c5f76710e 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2549,12 +2549,20 @@ class PlayState extends MusicBeatSubState // Redirect to the chart editor playing the current song. if (controls.DEBUG_CHART) { - disableKeys = true; - persistentUpdate = false; - FlxG.switchState(() -> new ChartEditorState( - { - targetSongId: currentSong.id, - })); + if (isChartingMode) + { + if (FlxG.sound.music != null) FlxG.sound.music.pause(); // Don't reset song position! + PlayState.instance.close(); // This only works because PlayState is a substate! + } + else + { + disableKeys = true; + persistentUpdate = false; + FlxG.switchState(() -> new ChartEditorState( + { + targetSongId: currentSong.id, + })); + } } #end From f5143c2d7859ef51912155243b7411f1ad6d8c1d Mon Sep 17 00:00:00 2001 From: nebulazorua Date: Wed, 8 May 2024 19:56:13 +0800 Subject: [PATCH 2/2] this is better --- source/funkin/play/PlayState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index c5f76710e..0ba4e17ec 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2552,7 +2552,7 @@ class PlayState extends MusicBeatSubState if (isChartingMode) { if (FlxG.sound.music != null) FlxG.sound.music.pause(); // Don't reset song position! - PlayState.instance.close(); // This only works because PlayState is a substate! + this.close(); // This only works because PlayState is a substate! } else {