forked from Clones/Controlify
fix events
This commit is contained in:
@ -5,5 +5,5 @@ modName=Controlify
|
|||||||
modDescription=Another controller mod - for fabric!
|
modDescription=Another controller mod - for fabric!
|
||||||
|
|
||||||
curseforgeId=
|
curseforgeId=
|
||||||
modrinthId=
|
modrinthId=DOUdJVEm
|
||||||
githubProject=isXander/Controlify
|
githubProject=isXander/Controlify
|
||||||
|
@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
|
||||||
@Mixin(BaseOptionElementWidget.class)
|
@Mixin(value = BaseOptionElementWidget.class, remap = false)
|
||||||
public abstract class BaseOptionElementWidgetMixin implements ComponentProcessorProvider {
|
public abstract class BaseOptionElementWidgetMixin implements ComponentProcessorProvider {
|
||||||
@Shadow public abstract boolean applyPreviousValue();
|
@Shadow public abstract boolean applyPreviousValue();
|
||||||
@Shadow public abstract boolean applyNextValue();
|
@Shadow public abstract boolean applyNextValue();
|
||||||
|
@ -16,7 +16,7 @@ public class KeyboardHandlerMixin {
|
|||||||
@Shadow @Final private Minecraft minecraft;
|
@Shadow @Final private Minecraft minecraft;
|
||||||
|
|
||||||
// m_unngxkoe is lambda for GLFW keypress hook - do it outside of the `keyPress` method due to fake inputs
|
// m_unngxkoe is lambda for GLFW keypress hook - do it outside of the `keyPress` method due to fake inputs
|
||||||
@Inject(method = "m_unngxkoe", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/KeyboardHandler;keyPress(JIIII)V"))
|
@Inject(method = "method_22678", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/KeyboardHandler;keyPress(JIIII)V"))
|
||||||
private void onKeyboardInput(long window, int i, int j, int k, int m, CallbackInfo ci) {
|
private void onKeyboardInput(long window, int i, int j, int k, int m, CallbackInfo ci) {
|
||||||
if (window == minecraft.getWindow().getWindow())
|
if (window == minecraft.getWindow().getWindow())
|
||||||
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
|
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
|
||||||
|
@ -16,21 +16,21 @@ public class MouseHandlerMixin {
|
|||||||
@Shadow @Final private Minecraft minecraft;
|
@Shadow @Final private Minecraft minecraft;
|
||||||
|
|
||||||
// m_sljgmtqm is lambda for GLFW mouse click hook - do it outside of the `onPress` method due to fake inputs
|
// m_sljgmtqm is lambda for GLFW mouse click hook - do it outside of the `onPress` method due to fake inputs
|
||||||
@Inject(method = "m_sljgmtqm", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onPress(JIII)V"))
|
@Inject(method = "method_22686", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onPress(JIII)V"))
|
||||||
private void onMouseClickInput(long window, int button, int action, int modifiers, CallbackInfo ci) {
|
private void onMouseClickInput(long window, int button, int action, int modifiers, CallbackInfo ci) {
|
||||||
if (window == minecraft.getWindow().getWindow())
|
if (window == minecraft.getWindow().getWindow())
|
||||||
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
|
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_swhlgdws is lambda for GLFW mouse move hook - do it outside of the `onMove` method due to fake inputs
|
// m_swhlgdws is lambda for GLFW mouse move hook - do it outside of the `onMove` method due to fake inputs
|
||||||
@Inject(method = "m_swhlgdws", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onMove(JDD)V"))
|
@Inject(method = "method_22689", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onMove(JDD)V"))
|
||||||
private void onMouseMoveInput(long window, double x, double y, CallbackInfo ci) {
|
private void onMouseMoveInput(long window, double x, double y, CallbackInfo ci) {
|
||||||
if (window == minecraft.getWindow().getWindow())
|
if (window == minecraft.getWindow().getWindow())
|
||||||
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
|
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_qoshpwkl is lambda for GLFW mouse scroll hook - do it outside of the `onScroll` method due to fake inputs
|
// m_qoshpwkl is lambda for GLFW mouse scroll hook - do it outside of the `onScroll` method due to fake inputs
|
||||||
@Inject(method = "m_qoshpwkl", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onScroll(JDD)V"))
|
@Inject(method = "method_22687", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MouseHandler;onScroll(JDD)V"))
|
||||||
private void onMouseScrollInput(long window, double scrollDeltaX, double scrollDeltaY, CallbackInfo ci) {
|
private void onMouseScrollInput(long window, double scrollDeltaX, double scrollDeltaY, CallbackInfo ci) {
|
||||||
if (window == minecraft.getWindow().getWindow())
|
if (window == minecraft.getWindow().getWindow())
|
||||||
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
|
Controlify.instance().setInputMode(InputMode.KEYBOARD_MOUSE);
|
||||||
|
Reference in New Issue
Block a user