From 56972a60a959c61802934376e3e0b4b877833cd1 Mon Sep 17 00:00:00 2001 From: SylveonDev Date: Sun, 5 Nov 2023 21:57:25 -0500 Subject: [PATCH] Add option to enable additional debug tools --- source/ClientPrefs.hx | 5 +++++ source/PlayState.hx | 4 ++-- source/options/PreferencesSubstate.hx | 10 +++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/source/ClientPrefs.hx b/source/ClientPrefs.hx index 1a2e5648..041340d5 100644 --- a/source/ClientPrefs.hx +++ b/source/ClientPrefs.hx @@ -35,6 +35,7 @@ class ClientPrefs { public static var maxmisslimit:Bool = true; public static var lockrating:Bool = false; public static var healthrot:Int = 32; + public static var debugging:Bool = false; public static var cursing:Bool = true; public static var violence:Bool = true; public static var camZooms:Bool = true; @@ -159,6 +160,7 @@ class ClientPrefs { FlxG.save.data.healthrot = healthrot; FlxG.save.data.maxmisslimit = maxmisslimit; FlxG.save.data.lockrating = lockrating; + FlxG.save.data.debugging = debugging; FlxG.save.data.cursing = cursing; FlxG.save.data.violence = violence; FlxG.save.data.camZooms = camZooms; @@ -284,6 +286,9 @@ class ClientPrefs { if(FlxG.save.data.doScoretable != null) { doScoretable = FlxG.save.data.doScoretable; } + if(FlxG.save.data.debugging != null) { + debugging = FlxG.save.data.debugging; + } /*if(FlxG.save.data.cursing != null) { cursing = FlxG.save.data.cursing; } diff --git a/source/PlayState.hx b/source/PlayState.hx index 46b228d6..137b3882 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -4147,7 +4147,7 @@ class PlayState extends MusicBeatState } } - #if debug + if (ClientPrefs.debugging){ if(!endingSong && !startingSong) { if (FlxG.keys.justPressed.ONE) { KillNotes(); @@ -4194,7 +4194,7 @@ class PlayState extends MusicBeatState setOnLuas('cameraY', camFollowPos.y); setOnLuas('botPlay', PlayState.cpuControlled); callOnLuas('onUpdatePost', [elapsed]); - #end + } } var isDead:Bool = false; diff --git a/source/options/PreferencesSubstate.hx b/source/options/PreferencesSubstate.hx index a07370d8..8993d5d3 100644 --- a/source/options/PreferencesSubstate.hx +++ b/source/options/PreferencesSubstate.hx @@ -57,7 +57,8 @@ class PreferencesSubstate extends MusicBeatSubstate 'Hide Song Length', 'Flashing Lights', 'Move Window', - 'Camera Zooms' + 'Camera Zooms', + 'Debugging' /* 'Do HealthIcon rotation', 'HealthIcon rotation' @@ -245,6 +246,9 @@ class PreferencesSubstate extends MusicBeatSubstate case 'Camera Zooms': ClientPrefs.camZooms = !ClientPrefs.camZooms; + + case 'Debugging': + ClientPrefs.debugging = !ClientPrefs.debugging; case 'Hide HUD': ClientPrefs.hideHud = !ClientPrefs.hideHud; @@ -356,6 +360,8 @@ class PreferencesSubstate extends MusicBeatSubstate daText = "Uncheck this to disable the window moving."; case 'Camera Zooms': daText = "If unchecked, the camera won't zoom in on a beat hit."; + case 'Debugging': + daText = "If checked, enables additional tools for debugging.\nThis does not affect the chart/character editors."; case 'Hide HUD': daText = "If checked, hides most HUD elements."; case 'Hide Song Length': @@ -441,6 +447,8 @@ class PreferencesSubstate extends MusicBeatSubstate daValue = ClientPrefs.violence; case 'Camera Zooms': daValue = ClientPrefs.camZooms; + case 'Debugging': + daValue = ClientPrefs.debugging; case 'Hide HUD': daValue = ClientPrefs.hideHud; case 'Persistent Cached Data':