1
0
forked from Clones/Controlify

vanilla keybind override and config system

This commit is contained in:
isXander
2023-02-01 13:27:21 +00:00
parent aad9447325
commit 89c4409371
19 changed files with 441 additions and 64 deletions

View File

@ -1,6 +1,7 @@
package dev.isxander.controlify.event;
import dev.isxander.controlify.InputMode;
import dev.isxander.controlify.bindings.ControllerBindings;
import dev.isxander.controlify.controller.Controller;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
@ -18,6 +19,12 @@ public class ControlifyEvents {
}
});
public static final Event<ControllerBindRegistry> CONTROLLER_BIND_REGISTRY = EventFactory.createArrayBacked(ControllerBindRegistry.class, callbacks -> bindings -> {
for (ControllerBindRegistry callback : callbacks) {
callback.onRegisterControllerBinds(bindings);
}
});
@FunctionalInterface
public interface InputModeChanged {
void onInputModeChanged(InputMode mode);
@ -27,4 +34,9 @@ public class ControlifyEvents {
public interface ControllerStateUpdate {
void onControllerStateUpdate(Controller controller);
}
@FunctionalInterface
public interface ControllerBindRegistry {
void onRegisterControllerBinds(ControllerBindings bindings);
}
}