Skip to content

Commit

Permalink
Fix mixed input not working after enabling explicitly in config screen (
Browse files Browse the repository at this point in the history
closes #267)
  • Loading branch information
isXander committed Apr 10, 2024
1 parent 0b52b91 commit b6363e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/dev/isxander/controlify/Controlify.java
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ private void tickController(ControllerEntity controller, boolean outOfFocus) {
|| state.getAxes().stream().map(state::getAxisState).anyMatch(axis -> Math.abs(axis) > 0.1f)
|| state.getHats().stream().map(state::getHatState).anyMatch(hat -> hat != HatState.CENTERED);
if (givingInput && !this.currentInputMode().isController()) {
this.setInputMode(input.config().config().mixedInput ? InputMode.MIXED : InputMode.CONTROLLER);
this.setInputMode(input.confObj().mixedInput ? InputMode.MIXED : InputMode.CONTROLLER);

return; // don't process input if this is changing mode.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private ConfigCategory createAdvancedCategory(ControllerEntity controller) {
input.ifPresent(inputComponent -> builder.option(Option.<Boolean>createBuilder()
.name(Component.translatable("controlify.gui.mixed_input"))
.description(OptionDescription.of(Component.translatable("controlify.gui.mixed_input.tooltip")))
.binding(inputComponent.defObj().mixedInput, () -> inputComponent.defObj().mixedInput, v -> inputComponent.defObj().mixedInput = v)
.binding(inputComponent.defObj().mixedInput, () -> inputComponent.confObj().mixedInput, v -> inputComponent.confObj().mixedInput = v)
.controller(TickBoxControllerBuilder::create)
.build()));

Expand Down

0 comments on commit b6363e9

Please sign in to comment.