From 7a57c102a54a03c7444979ee4a9801d38fa553a2 Mon Sep 17 00:00:00 2001 From: KadeDeveloper Date: Tue, 20 Jul 2021 15:50:58 -0700 Subject: [PATCH] add a thing that tells you if it's blacklisted --- source/KeyBindMenu.hx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/KeyBindMenu.hx b/source/KeyBindMenu.hx index ff826bb..a10a43d 100644 --- a/source/KeyBindMenu.hx +++ b/source/KeyBindMenu.hx @@ -119,6 +119,8 @@ class KeyBindMenu extends FlxSubState if (frames <= 10) frames++; + infoText.text = 'Current Mode: ${KeyBinds.gamepad ? 'GAMEPAD' : 'KEYBOARD'}. Press TAB to switch\n(${KeyBinds.gamepad ? 'RIGHT Trigger' : 'Escape'} to save, ${KeyBinds.gamepad ? 'LEFT Trigger' : 'Backspace'} to leave without saving. ${KeyBinds.gamepad ? 'START To change a keybind' : ''})\n${lastKey != "" ? lastKey + " is blacklisted!" : ""}'; + switch(state){ case "select": @@ -137,7 +139,6 @@ class KeyBindMenu extends FlxSubState if (FlxG.keys.justPressed.TAB) { KeyBinds.gamepad = !KeyBinds.gamepad; - infoText.text = 'Current Mode: ${KeyBinds.gamepad ? 'GAMEPAD' : 'KEYBOARD'}. Press TAB to switch\n(${KeyBinds.gamepad ? 'RIGHT Trigger' : 'Escape'} to save, ${KeyBinds.gamepad ? 'LEFT Trigger' : 'Backspace'} to leave without saving. ${KeyBinds.gamepad ? 'START To change a keybind' : ''})'; textUpdate(); } @@ -348,6 +349,8 @@ class KeyBindMenu extends FlxSubState } + public var lastKey:String = ""; + function addKey(r:String){ var shouldReturn:Bool = true; @@ -366,6 +369,7 @@ class KeyBindMenu extends FlxSubState if (notAllowed.contains(oK)) { keys[x] = null; + lastKey = oK; return; } } @@ -373,9 +377,12 @@ class KeyBindMenu extends FlxSubState if (r.contains("NUMPAD")) { keys[curSelected] = null; + lastKey = r; return; } + lastKey = ""; + if(shouldReturn){ keys[curSelected] = r; FlxG.sound.play(Paths.sound('scrollMenu'));