forked from Clones/Controlify
🐛 Make the reset button act as an unbind button. (close #120)
This commit is contained in:
@ -169,9 +169,9 @@ public class ControllerBindingImpl<T extends ControllerState> implements Control
|
||||
|
||||
@Override
|
||||
public Option.Builder<?> startYACLOption() {
|
||||
Option.Builder<IBind<T>> option = Option.createBuilder((Class<IBind<T>>) (Class<?>) IBind.class)
|
||||
Option.Builder<IBind<T>> option = Option.<IBind<T>>createBuilder()
|
||||
.name(name())
|
||||
.binding(defaultBind(), this::currentBind, this::setCurrentBind)
|
||||
.binding(new EmptyBind<>(), this::currentBind, this::setCurrentBind)
|
||||
.description(OptionDescription.of(this.description()));
|
||||
|
||||
if (controller instanceof GamepadController gamepad) {
|
||||
|
@ -65,8 +65,7 @@ public class ControllerBindings<T extends ControllerState> {
|
||||
VMOUSE_SHIFT,
|
||||
VMOUSE_TOGGLE,
|
||||
GUI_NAVI_UP, GUI_NAVI_DOWN, GUI_NAVI_LEFT, GUI_NAVI_RIGHT,
|
||||
CYCLE_OPT_FORWARD, CYCLE_OPT_BACKWARD,
|
||||
CLEAR_BINDING;
|
||||
CYCLE_OPT_FORWARD, CYCLE_OPT_BACKWARD;
|
||||
|
||||
private final Map<ResourceLocation, ControllerBinding> registry = new LinkedHashMap<>();
|
||||
|
||||
@ -397,12 +396,6 @@ public class ControllerBindings<T extends ControllerState> {
|
||||
.category(GUI_CATEGORY)
|
||||
.context(BindContexts.GUI)
|
||||
.build());
|
||||
register(CLEAR_BINDING = ControllerBindingBuilder.create(controller)
|
||||
.identifier("controlify", "clear_binding")
|
||||
.defaultBind(GamepadBinds.RIGHT_STICK_PRESS)
|
||||
.category(GUI_CATEGORY)
|
||||
.context(BindContexts.CONTROLIFY_CONFIG)
|
||||
.build());
|
||||
|
||||
for (var constructor : CUSTOM_BINDS.values()) {
|
||||
register(constructor.apply(this));
|
||||
|
@ -95,11 +95,6 @@ public abstract class AbstractBindController<T extends ControllerState> implemen
|
||||
if (controller != control.controller) return true;
|
||||
|
||||
if (!justTookInput && !awaitingControllerInput) {
|
||||
if (controller.bindings().CLEAR_BINDING.justPressed()) {
|
||||
control.option().requestSet(new EmptyBind<>());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (controller.bindings().GUI_PRESS.justPressed()) {
|
||||
ControllerBindHandler.setBindListener(this);
|
||||
return awaitingControllerInput = true;
|
||||
|
Reference in New Issue
Block a user