mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-12-26 15:07:14 +00:00
Merge remote-tracking branch 'public/bugfix/duplicate-controls-binds' into bugfix/public-fixes
This commit is contained in:
commit
99bd3a370f
|
@ -527,6 +527,14 @@ class Controls extends FlxActionSet
|
|||
action.inputs[i].inputID = toAdd;
|
||||
}
|
||||
hasReplaced = true;
|
||||
} else if (input.device == KEYBOARD && input.inputID == toAdd) {
|
||||
// This key is already bound!
|
||||
if (hasReplaced) {
|
||||
// Remove the duplicate keybind, don't replace.
|
||||
action.inputs.remove(input);
|
||||
} else {
|
||||
hasReplaced = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -989,6 +997,7 @@ class Controls extends FlxActionSet
|
|||
for (control in Control.createAll())
|
||||
{
|
||||
var inputs:Array<Int> = Reflect.field(data, control.getName());
|
||||
inputs = inputs.unique();
|
||||
if (inputs != null)
|
||||
{
|
||||
if (inputs.length == 0) {
|
||||
|
@ -1038,7 +1047,11 @@ class Controls extends FlxActionSet
|
|||
var inputs = getInputsFor(control, device);
|
||||
isEmpty = isEmpty && inputs.length == 0;
|
||||
|
||||
if (inputs.length == 0) inputs = [FlxKey.NONE];
|
||||
if (inputs.length == 0) {
|
||||
inputs = [FlxKey.NONE];
|
||||
} else {
|
||||
inputs = inputs.unique();
|
||||
}
|
||||
|
||||
Reflect.setField(data, control.getName(), inputs);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue