Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Customizable Debug Key #507

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/funkin/backend/system/Controls.hx
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ class Controls extends FlxActionSet
inline bindKeys(Control.BACK, Options.SOLO_BACK);
inline bindKeys(Control.PAUSE, Options.SOLO_PAUSE);
inline bindKeys(Control.RESET, Options.SOLO_RESET);
inline bindKeys(Control.CHEAT, Options.SOLO_CHEAT);
inline bindKeys(Control.SWITCHMOD, Options.SOLO_SWITCHMOD);
case Duo(true):
inline bindKeys(Control.UP, Options.P1_UP);
Expand All @@ -700,6 +701,7 @@ class Controls extends FlxActionSet
inline bindKeys(Control.BACK, Options.P1_BACK);
inline bindKeys(Control.PAUSE, Options.P1_PAUSE);
inline bindKeys(Control.RESET, Options.P1_RESET);
inline bindKeys(Control.CHEAT, Options.P1_CHEAT);
inline bindKeys(Control.SWITCHMOD, Options.P1_SWITCHMOD);
case Duo(false):
inline bindKeys(Control.UP, Options.P2_UP);
Expand All @@ -714,6 +716,7 @@ class Controls extends FlxActionSet
inline bindKeys(Control.BACK, Options.P2_BACK);
inline bindKeys(Control.PAUSE, Options.P2_PAUSE);
inline bindKeys(Control.RESET, Options.P2_RESET);
inline bindKeys(Control.CHEAT, Options.P2_CHEAT);
inline bindKeys(Control.SWITCHMOD, Options.P2_SWITCHMOD);
case None: // nothing
case Custom: // nothing
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ class PlayState extends MusicBeatState
pauseGame();

if (canAccessDebugMenus) {
if (chartingMode && FlxG.keys.justPressed.SEVEN) {
if (chartingMode && controls.CHEAT) {
FlxG.switchState(new funkin.editors.charter.Charter(SONG.meta.name, difficulty, false));
}
if (FlxG.keys.justPressed.F5) {
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/menus/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class MainMenuState extends MusicBeatState
if (!selectedSomethin)
{
if (canAccessDebugMenus) {
if (FlxG.keys.justPressed.SEVEN) {
if (controls.CHEAT) {
persistentUpdate = false;
persistentDraw = true;
openSubState(new funkin.editors.EditorPicker());
Expand Down
3 changes: 3 additions & 0 deletions source/funkin/options/Options.hx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Options
public static var P1_BACK:Array<FlxKey> = [BACKSPACE];
public static var P1_PAUSE:Array<FlxKey> = [ENTER];
public static var P1_RESET:Array<FlxKey> = [R];
public static var P1_CHEAT:Array<FlxKey> = [SEVEN];
public static var P1_SWITCHMOD:Array<FlxKey> = [TAB];

/**
Expand All @@ -100,6 +101,7 @@ class Options
public static var P2_BACK:Array<FlxKey> = [ESCAPE];
public static var P2_PAUSE:Array<FlxKey> = [ESCAPE];
public static var P2_RESET:Array<FlxKey> = [];
public static var P2_CHEAT:Array<FlxKey> = [];
public static var P2_SWITCHMOD:Array<FlxKey> = [];

/**
Expand All @@ -117,6 +119,7 @@ class Options
public static var SOLO_BACK(get, null):Array<FlxKey>;
public static var SOLO_PAUSE(get, null):Array<FlxKey>;
public static var SOLO_RESET(get, null):Array<FlxKey>;
public static var SOLO_CHEAT(get, null):Array<FlxKey>;
public static var SOLO_SWITCHMOD(get, null):Array<FlxKey>;

public static function load() {
Expand Down
12 changes: 8 additions & 4 deletions source/funkin/options/keybinds/KeybindsOptions.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class KeybindsOptions extends MusicBeatSubstate {
{
name: '{noteRight}',
control: 'NOTE_RIGHT'
},
}
]
},
{
Expand Down Expand Up @@ -63,16 +63,20 @@ class KeybindsOptions extends MusicBeatSubstate {
{
name: 'Pause',
control: 'PAUSE'
},
}
]
},
{
name: 'Engine',
settings: [
{
name: 'Cheat',
control: 'CHEAT'
},
{
name: 'Switch Mod',
control: 'SWITCHMOD'
},
}
]
}
];
Expand Down Expand Up @@ -248,4 +252,4 @@ class KeybindsOptions extends MusicBeatSubstate {
camFollow.setPosition(FlxG.width / 2, FlxG.height / 2);
}
}
}
}