Skip to content

Commit

Permalink
Fix radial button not being able to be changed (temp fix for yacl bug) (
Browse files Browse the repository at this point in the history
closes #275)
  • Loading branch information
isXander committed Apr 10, 2024
1 parent b6363e9 commit 6a75dac
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class ControllerConfigScreenFactory {
private static final ValueFormatter<Float> percentFormatter = v -> Component.literal(String.format("%.0f%%", v*100));
Expand Down Expand Up @@ -604,13 +605,16 @@ private ConfigCategory createBindsCategory(ControllerEntity controller) {
var controlsGroup = OptionGroup.createBuilder()
.name(categoryName);

controlsGroup.options(bindGroup.stream().map(binding -> {
Option.Builder<?> option = binding.startYACLOption()
.listener((opt, val) -> updateConflictingBinds(optionBinds));
controlsGroup.options(bindGroup.stream().flatMap(binding -> {
if (binding != controller.bindings().RADIAL_MENU) {
Option.Builder<?> option = binding.startYACLOption()
.listener((opt, val) -> updateConflictingBinds(optionBinds));

Option<?> built = option.build();
optionBinds.add(new OptionBindPair(built, binding));
return built;
Option<?> built = option.build();
optionBinds.add(new OptionBindPair(built, binding));
return Stream.of(built);
}
return Stream.empty();
}).toList());

category.group(controlsGroup.build());
Expand Down

0 comments on commit 6a75dac

Please sign in to comment.