From d7105e8b8e26e2fe1337c14862f7968f5dcd7893 Mon Sep 17 00:00:00 2001
From: Cameron Taylor <cameron.taylor.ninja@gmail.com>
Date: Mon, 8 Jul 2024 16:22:38 -0400
Subject: [PATCH] change debug menu and add key for freeplay

---
 source/funkin/ui/debug/DebugMenuSubState.hx | 2 ++
 source/funkin/ui/freeplay/FreeplayState.hx  | 5 +++++
 source/funkin/ui/mainmenu/MainMenuState.hx  | 4 +---
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/source/funkin/ui/debug/DebugMenuSubState.hx b/source/funkin/ui/debug/DebugMenuSubState.hx
index 22dc5dba6..590cce88b 100644
--- a/source/funkin/ui/debug/DebugMenuSubState.hx
+++ b/source/funkin/ui/debug/DebugMenuSubState.hx
@@ -54,7 +54,9 @@ class DebugMenuSubState extends MusicBeatSubState
 
     // Create each menu item.
     // Call onMenuChange when the first item is created to move the camera .
+    #if CHART_EDITOR_SUPPORTED
     onMenuChange(createItem("CHART EDITOR", openChartEditor));
+    #end
     // createItem("Input Offset Testing", openInputOffsetTesting);
     createItem("CHARACTER SELECT", openCharSelect, true);
     createItem("ANIMATION EDITOR", openAnimationEditor);
diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx
index 3b003cf89..4b0ae7839 100644
--- a/source/funkin/ui/freeplay/FreeplayState.hx
+++ b/source/funkin/ui/freeplay/FreeplayState.hx
@@ -1206,6 +1206,11 @@ class FreeplayState extends MusicBeatSubState
     // }
     #end
 
+    if (FlxG.keys.justPressed.TAB)
+    {
+      FlxG.switchState(new funkin.ui.charSelect.CharSelectSubState());
+    }
+
     if (controls.FREEPLAY_FAVORITE && !busy)
     {
       var targetSong = grpCapsules.members[curSelected]?.songData;
diff --git a/source/funkin/ui/mainmenu/MainMenuState.hx b/source/funkin/ui/mainmenu/MainMenuState.hx
index 2eba406d9..eab116c86 100644
--- a/source/funkin/ui/mainmenu/MainMenuState.hx
+++ b/source/funkin/ui/mainmenu/MainMenuState.hx
@@ -341,17 +341,15 @@ class MainMenuState extends MusicBeatState
       }
     }
 
+    #if (debug || FORCE_DEBUG_VERSION)
     // Open the debug menu, defaults to ` / ~
-    #if CHART_EDITOR_SUPPORTED
     if (controls.DEBUG_MENU)
     {
       persistentUpdate = false;
 
       FlxG.state.openSubState(new DebugMenuSubState());
     }
-    #end
 
-    #if (debug || FORCE_DEBUG_VERSION)
     if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.W)
     {
       // Give the user a score of 1 point on Weekend 1 story mode.