Raptorkillz func _input(e):
for a in InputMap.get_actions().filter(func(aa): return e.is_action_pressed(aa)).slice(0,1):
s += a if not s else " " + a
for k in cheats.keys(): if s.contains(k): code_entered.emit(cheats[k]); s = ""
is this function even correct?
im not fond of lambdas because its convoluted.
i dont like this line:
s += a if not s else " " + a
Seems like if s
- the entered cheat sequence is nothing/empty then you start new sequence with " " a space at the beninging. So it will never match the cheat or i maybe wrong here?
also the last line
for k in cheats.keys(): if s.contains(k): code_entered.emit(cheats[k]); s = ""
does ;
at the end or signal.emit() means if condition fails then do - s = ""??