Skip to content

Commit

Permalink
add back the konami code method-
Browse files Browse the repository at this point in the history
-that was used to access the debug menu in 1.18.0

the reason is i thought this method was cooler, and it allows iOS users to access the menu too
  • Loading branch information
JordanSantiagoYT committed Sep 16, 2024
1 parent 3e6c155 commit 6e61e04
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions source/options/OptionsState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class OptionsState extends MusicBeatState
var kId = 0;
var keys:Array<FlxKey> = [D, E, B, U, G, SEVEN]; // lol
var konamiIndex:Int = 0; // Track the progress in the Konami code sequence
var konamiCode = [];
var konamiCode = [virtualPad.buttonUp, virtualPad.buttonUp, virtualPad.buttonDown, virtualPad.buttonDown, virtualPad.buttonLeft, virtualPad.buttonRight, virtualPad.buttonLeft, virtualPad.buttonRight, virtualPad.buttonB, virtualPad.buttonA];
var isEnteringKonamiCode:Bool = false;
var options:Array<String> = ['Note Colors', 'Controls', 'Adjust Delay and Combo', 'Graphics', 'Optimization', #if !mobile 'Game Rendering', #end 'Visuals and UI', 'Gameplay', 'Misc', 'Mobile Options'];
private var grpOptions:FlxTypedGroup<Alphabet>;
Expand Down Expand Up @@ -185,9 +185,12 @@ class OptionsState extends MusicBeatState
openSelectedSubstate(options[curSelected]);
}

#if android
if (FlxG.android.justReleased.BACK) enterSuperSecretDebugMenu();
#end
if (virtualPad.buttonUp.justPressed || virtualPad.buttonDown.justPressed || virtualPad.buttonLeft.justPressed || virtualPad.buttonRight.justPressed || virtualPad.buttonB.justPressed || virtualPad.buttonA.justPressed) {
var k = keys[kId];
if (!enteringDebugMenu && checkKonamiCode()) {
if (konamiIndex >= konamiCode.length) enterSuperSecretDebugMenu();
}
}

if (ClientPrefs.mobileCPlayStateVpad && virtualPad.buttonC.justPressed) {
persistentUpdate = false;
Expand Down Expand Up @@ -233,20 +236,20 @@ class OptionsState extends MusicBeatState
}
FlxG.sound.play(Paths.sound('scrollMenu'));
}
function checkKonamiCode():Bool {
if (konamiCode[konamiIndex].justPressed) {
konamiIndex++;
if (konamiIndex > 6) isEnteringKonamiCode = true;
if (konamiIndex >= konamiCode.length) {
return true;
konamiIndex = 0;
}
} else { //you messed up the code
konamiIndex = 0;
isEnteringKonamiCode = false;
}
return false;
}
function checkKonamiCode():Bool {
if (konamiCode[konamiIndex].justPressed) {
konamiIndex++;
if (konamiIndex > 6) isEnteringKonamiCode = true;
if (konamiIndex >= konamiCode.length) {
return true;
konamiIndex = 0;
}
} else { //you messed up the code
konamiIndex = 0;
isEnteringKonamiCode = false;
}
return false;
}
function enterSuperSecretDebugMenu():Void // so secret I can tell
{
enteringDebugMenu = true;
Expand Down

0 comments on commit 6e61e04

Please sign in to comment.