add a thing that tells you if it's blacklisted

This commit is contained in:
KadeDeveloper 2021-07-20 15:50:58 -07:00
parent 592a76eed4
commit 7a57c102a5

View File

@ -119,6 +119,8 @@ class KeyBindMenu extends FlxSubState
if (frames <= 10) if (frames <= 10)
frames++; 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){ switch(state){
case "select": case "select":
@ -137,7 +139,6 @@ class KeyBindMenu extends FlxSubState
if (FlxG.keys.justPressed.TAB) if (FlxG.keys.justPressed.TAB)
{ {
KeyBinds.gamepad = !KeyBinds.gamepad; 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(); textUpdate();
} }
@ -348,6 +349,8 @@ class KeyBindMenu extends FlxSubState
} }
public var lastKey:String = "";
function addKey(r:String){ function addKey(r:String){
var shouldReturn:Bool = true; var shouldReturn:Bool = true;
@ -366,6 +369,7 @@ class KeyBindMenu extends FlxSubState
if (notAllowed.contains(oK)) if (notAllowed.contains(oK))
{ {
keys[x] = null; keys[x] = null;
lastKey = oK;
return; return;
} }
} }
@ -373,9 +377,12 @@ class KeyBindMenu extends FlxSubState
if (r.contains("NUMPAD")) if (r.contains("NUMPAD"))
{ {
keys[curSelected] = null; keys[curSelected] = null;
lastKey = r;
return; return;
} }
lastKey = "";
if(shouldReturn){ if(shouldReturn){
keys[curSelected] = r; keys[curSelected] = r;
FlxG.sound.play(Paths.sound('scrollMenu')); FlxG.sound.play(Paths.sound('scrollMenu'));