mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 22:16:01 +00:00
Stuff
This commit is contained in:
1 parent
9c4a30d224
commit
666398e480
174 files changed
+8694
-2942
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package com.moulberry.flashback.mixin;
|
||||
|
||||
import com.moulberry.flashback.editor.ui.CustomImGuiImplGlfw;
|
||||
import com.moulberry.flashback.editor.ui.ReplayUI;
|
||||
import net.minecraft.client.MouseHandler;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(MouseHandler.class)
|
||||
public class MixinMouseHandler {
|
||||
|
||||
@Inject(method = "isMouseGrabbed", at=@At("HEAD"), cancellable = true)
|
||||
public void isMouseGrabbed(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (ReplayUI.isActive()) {
|
||||
cir.setReturnValue(ReplayUI.imguiGlfw.getMouseHandledBy() == CustomImGuiImplGlfw.MouseHandledBy.GAME);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "grabMouse", at=@At("HEAD"), cancellable = true)
|
||||
public void grabMouse(CallbackInfo ci) {
|
||||
if (ReplayUI.isActive()) ci.cancel();
|
||||
}
|
||||
|
||||
@Inject(method = "releaseMouse", at=@At("HEAD"), cancellable = true)
|
||||
public void releaseMouse(CallbackInfo ci) {
|
||||
if (ReplayUI.isActive()) ci.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user