1
0
forked from Clones/Controlify

virtual mouse + singleplayer screen compat + 22w05a

This commit is contained in:
isXander
2023-02-02 21:36:44 +00:00
parent 57fcd0c0dc
commit 09628defc4
34 changed files with 697 additions and 111 deletions

View File

@ -23,7 +23,8 @@ public class ControllerBindings {
INVENTORY,
CHANGE_PERSPECTIVE,
OPEN_CHAT,
GUI_PRESS, GUI_BACK;
GUI_PRESS, GUI_BACK,
VMOUSE_LCLICK, VMOUSE_RCLICK, VMOUSE_MCLICK, VMOUSE_ESCAPE, VMOUSE_TOGGLE;
private final Map<ResourceLocation, ControllerBinding> registry = new LinkedHashMap<>();
@ -44,7 +45,11 @@ public class ControllerBindings {
register(OPEN_CHAT = new ControllerBinding(controller, Bind.DPAD_UP, new ResourceLocation("controlify", "open_chat"), options.keyChat));
register(GUI_PRESS = new ControllerBinding(controller, Bind.A_BUTTON, new ResourceLocation("controlify", "gui_press"), null));
register(GUI_BACK = new ControllerBinding(controller, Bind.B_BUTTON, new ResourceLocation("controlify", "gui_back"), null));
register(VMOUSE_LCLICK = new ControllerBinding(controller, Bind.A_BUTTON, new ResourceLocation("controlify", "vmouse_lclick"), null));
register(VMOUSE_RCLICK = new ControllerBinding(controller, Bind.X_BUTTON, new ResourceLocation("controlify", "vmouse_rclick"), null));
register(VMOUSE_MCLICK = new ControllerBinding(controller, Bind.Y_BUTTON, new ResourceLocation("controlify", "vmouse_mclick"), null));
register(VMOUSE_ESCAPE = new ControllerBinding(controller, Bind.B_BUTTON, new ResourceLocation("controlify", "vmouse_escape"), null));
register(VMOUSE_TOGGLE = new ControllerBinding(controller, Bind.BACK, new ResourceLocation("controlify", "vmouse_toggle"), null));
ControlifyEvents.CONTROLLER_BIND_REGISTRY.invoker().onRegisterControllerBinds(this, controller);
@ -82,7 +87,7 @@ public class ControllerBindings {
}
private void imitateVanillaClick(Controller controller) {
if (Controlify.getInstance().getCurrentInputMode() != InputMode.CONTROLLER)
if (Controlify.instance().currentInputMode() != InputMode.CONTROLLER)
return;
for (var binding : registry().values()) {