forked from Clones/Controlify
minor cleanup
This commit is contained in:
@ -20,7 +20,6 @@ group = "dev.isxander"
|
||||
version = "1.1.1+1.19.4"
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven("https://maven.terraformersmc.com")
|
||||
maven("https://maven.isxander.dev/releases")
|
||||
@ -33,7 +32,6 @@ repositories {
|
||||
}
|
||||
}
|
||||
maven("https://jitpack.io")
|
||||
mavenLocal()
|
||||
maven("https://maven.flashyreese.me/snapshots")
|
||||
}
|
||||
|
||||
|
@ -309,11 +309,14 @@ public class Controlify implements ControlifyApi {
|
||||
config().setDirty();
|
||||
}
|
||||
|
||||
this.askToSwitchController(controller);
|
||||
|
||||
checkCompoundJoysticks();
|
||||
|
||||
config().saveIfDirty();
|
||||
if (Controller.CONTROLLERS.size() == 1) {
|
||||
this.setCurrentController(controller);
|
||||
} else {
|
||||
this.askToSwitchController(controller);
|
||||
config().saveIfDirty();
|
||||
}
|
||||
}
|
||||
|
||||
private void onControllerDisconnect(int jid) {
|
||||
@ -368,6 +371,7 @@ public class Controlify implements ControlifyApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public @NotNull Controller<?, ?> currentController() {
|
||||
if (currentController == null)
|
||||
return Controller.DUMMY;
|
||||
@ -438,7 +442,6 @@ public class Controlify implements ControlifyApi {
|
||||
if (this.currentInputMode == currentInputMode) return false;
|
||||
this.currentInputMode = currentInputMode;
|
||||
|
||||
var minecraft = Minecraft.getInstance();
|
||||
if (!minecraft.mouseHandler.isMouseGrabbed())
|
||||
hideMouse(currentInputMode == InputMode.CONTROLLER, true);
|
||||
if (minecraft.screen != null) {
|
||||
@ -467,7 +470,6 @@ public class Controlify implements ControlifyApi {
|
||||
}
|
||||
|
||||
public void hideMouse(boolean hide, boolean moveMouse) {
|
||||
var minecraft = Minecraft.getInstance();
|
||||
GLFW.glfwSetInputMode(
|
||||
minecraft.getWindow().getWindow(),
|
||||
GLFW.GLFW_CURSOR,
|
||||
|
@ -1,15 +1,12 @@
|
||||
package dev.isxander.controlify.mixins.feature.guide.screen;
|
||||
|
||||
import dev.isxander.controlify.gui.DrawSize;
|
||||
import net.minecraft.client.gui.GuiComponent;
|
||||
import net.minecraft.client.gui.components.AbstractWidget;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(AbstractWidget.class)
|
||||
public abstract class AbstractWidgetMixin extends GuiComponent {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package dev.isxander.controlify.mixins.feature.screenop;
|
||||
|
||||
import dev.isxander.controlify.screenop.ComponentProcessorProvider;
|
||||
import dev.isxander.controlify.screenop.ScreenProcessorProvider;
|
||||
import dev.isxander.controlify.screenop.ScreenProcessor;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -21,6 +20,12 @@ public class ScreenMixin implements ScreenProcessorProvider {
|
||||
return controlify$processor;
|
||||
}
|
||||
|
||||
@Inject(method = "init(Lnet/minecraft/client/Minecraft;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/Screen;init()V", shift = At.Shift.AFTER))
|
||||
private void onScreenInitialInit(Minecraft client, int width, int height, CallbackInfo ci) {
|
||||
// cannot use screenProcessor() because it may be overriden by registry
|
||||
ScreenProcessorProvider.provide((Screen) (Object) this).onWidgetRebuild();
|
||||
}
|
||||
|
||||
@Inject(method = "rebuildWidgets", at = @At("RETURN"))
|
||||
private void onScreenInit(CallbackInfo ci) {
|
||||
// cannot use screenProcessor() because it may be overriden by registry
|
||||
|
@ -137,7 +137,7 @@ public class FakeController implements JoystickController<JoystickConfig> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRumble() {
|
||||
public boolean supportsRumble() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user