mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 22:16:01 +00:00
Public Release
This commit is contained in:
1 parent
666398e480
commit
61bb497a22
126 files changed
+8435
-1240
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package com.moulberry.flashback.mixin;
|
||||
|
||||
import com.moulberry.flashback.Flashback;
|
||||
import com.moulberry.flashback.editor.ui.CustomImGuiImplGlfw;
|
||||
import com.moulberry.flashback.editor.ui.ReplayUI;
|
||||
import net.minecraft.client.MouseHandler;
|
||||
@@ -16,17 +17,23 @@ public class MixinMouseHandler {
|
||||
public void isMouseGrabbed(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (ReplayUI.isActive()) {
|
||||
cir.setReturnValue(ReplayUI.imguiGlfw.getMouseHandledBy() == CustomImGuiImplGlfw.MouseHandledBy.GAME);
|
||||
} else if (Flashback.isExporting()) {
|
||||
cir.setReturnValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "grabMouse", at=@At("HEAD"), cancellable = true)
|
||||
public void grabMouse(CallbackInfo ci) {
|
||||
if (ReplayUI.isActive()) ci.cancel();
|
||||
if (ReplayUI.isActive() || Flashback.isExporting()) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "releaseMouse", at=@At("HEAD"), cancellable = true)
|
||||
public void releaseMouse(CallbackInfo ci) {
|
||||
if (ReplayUI.isActive()) ci.cancel();
|
||||
if (ReplayUI.isActive()) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user