1
0
forked from Clones/Controlify

better theme handling and better mouse hide handling (still not perfect)

This commit is contained in:
isXander
2023-02-03 20:57:42 +00:00
parent c9b0870af3
commit ee774dcfee
14 changed files with 94 additions and 84 deletions

View File

@ -48,8 +48,8 @@ public class Controlify {
controllerHIDService.start();
// load after initial controller discovery
config().load();
config().load(); // load after initial controller discovery
config().save(); // save new controller configs if they don't exist
// listen for new controllers
GLFW.glfwSetJoystickCallback((jid, event) -> {
@ -148,7 +148,8 @@ public class Controlify {
this.currentInputMode = currentInputMode;
var minecraft = Minecraft.getInstance();
hideMouse(currentInputMode == InputMode.CONTROLLER);
if (!minecraft.mouseHandler.isMouseGrabbed())
hideMouse(currentInputMode == InputMode.CONTROLLER);
if (minecraft.screen != null) {
ScreenProcessorProvider.provide(minecraft.screen).onInputModeChanged(currentInputMode);
}
@ -170,7 +171,7 @@ public class Controlify {
if (hide && !virtualMouseHandler().isVirtualMouseEnabled()) {
// stop mouse hovering over last element before hiding cursor but don't actually move it
// so when the user switches back to mouse it will be in the same place
mouseHandlerAccessor.invokeOnMove(minecraft.getWindow().getWindow(), 0, 0);
mouseHandlerAccessor.invokeOnMove(minecraft.getWindow().getWindow(), -50, -50);
}
}
}