Skip to content

Commit

Permalink
Add option to enable additional debug tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylveondev committed Nov 6, 2023
1 parent 8fce67a commit 56972a6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions source/ClientPrefs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4147,7 +4147,7 @@ class PlayState extends MusicBeatState
}
}

#if debug
if (ClientPrefs.debugging){
if(!endingSong && !startingSong) {
if (FlxG.keys.justPressed.ONE) {
KillNotes();
Expand Down Expand Up @@ -4194,7 +4194,7 @@ class PlayState extends MusicBeatState
setOnLuas('cameraY', camFollowPos.y);
setOnLuas('botPlay', PlayState.cpuControlled);
callOnLuas('onUpdatePost', [elapsed]);
#end
}
}

var isDead:Bool = false;
Expand Down
10 changes: 9 additions & 1 deletion source/options/PreferencesSubstate.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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':
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit 56972a6

Please sign in to comment.