gui not working, but im tried
This commit is contained in:
parent
f38629a294
commit
8d47394acc
18 changed files with 428 additions and 59 deletions
|
@ -18,6 +18,8 @@ import java.util.UUID;
|
|||
public abstract class PlayerMixin {
|
||||
@Inject(at = @At(value = "HEAD"), method = "disconnect")
|
||||
private void disconnect(Text disconnectReason, CallbackInfo ci) {
|
||||
System.out.println("on client close");
|
||||
if (Main.me.is_replaying) {
|
||||
Main.me.stopReplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,53 +12,79 @@ 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;
|
||||
import themixray.repeating.mod.Main;
|
||||
import themixray.repeating.mod.TickTask;
|
||||
import themixray.repeating.mod.event.events.*;
|
||||
|
||||
@Mixin(Screen.class)
|
||||
public abstract class ScreenMixin extends AbstractParentElement implements Drawable {
|
||||
@Inject(at = @At(value = "HEAD"), method = "close")
|
||||
private void close(CallbackInfo ci) {
|
||||
System.out.println("on screen close");
|
||||
if (Main.me.is_recording) {
|
||||
Main.me.now_record.addEvent(new GuiCloseEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At(value = "HEAD"), method = "keyPressed")
|
||||
private void keyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable<Boolean> cir) {
|
||||
System.out.println("on screen keyPressed");
|
||||
if (Main.me.is_recording) {
|
||||
Main.me.now_record.addEvent(new GuiKeyPressEvent(keyCode, scanCode, modifiers));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean charTyped(char chr, int modifiers) {
|
||||
System.out.println("on screen charTyped");
|
||||
if (Main.me.is_recording) {
|
||||
Main.me.now_record.addEvent(new GuiCharTypeEvent(chr, modifiers));
|
||||
}
|
||||
return super.charTyped(chr, modifiers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean keyReleased(int keyCode, int scanCode, int modifiers) {
|
||||
System.out.println("on screen keyReleased");
|
||||
if (Main.me.is_recording) {
|
||||
Main.me.now_record.addEvent(new GuiKeyReleaseEvent(keyCode, scanCode, modifiers));
|
||||
}
|
||||
return super.keyReleased(keyCode, scanCode, modifiers);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int button) {
|
||||
System.out.println("on screen mouseClicked");
|
||||
if (Main.me.is_recording) {
|
||||
Main.me.now_record.addEvent(new GuiMouseClickEvent(mouseX, mouseY, button));
|
||||
}
|
||||
return super.mouseClicked(mouseX, mouseY, button);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMoved(double mouseX, double mouseY) {
|
||||
if (Main.me.is_recording) {
|
||||
Main.me.now_record.addEvent(new GuiMouseMoveEvent(mouseX, mouseY));
|
||||
}
|
||||
super.mouseMoved(mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY) {
|
||||
System.out.println("on screen mouseDragged");
|
||||
if (Main.me.is_recording) {
|
||||
Main.me.now_record.addEvent(new GuiMouseDragEvent(mouseX, mouseY, button, deltaX, deltaY));
|
||||
}
|
||||
return super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseReleased(double mouseX, double mouseY, int button) {
|
||||
System.out.println("on screen mouseReleased");
|
||||
if (Main.me.is_recording) {
|
||||
Main.me.now_record.addEvent(new GuiMouseReleaseEvent(mouseX, mouseY, button));
|
||||
}
|
||||
return super.mouseReleased(mouseX, mouseY, button);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseScrolled(double mouseX, double mouseY, double amount) {
|
||||
System.out.println("on screen mouseScrolled");
|
||||
if (Main.me.is_recording) {
|
||||
Main.me.now_record.addEvent(new GuiMouseScrollEvent(mouseX, mouseY, amount));
|
||||
}
|
||||
return super.mouseScrolled(mouseX, mouseY, amount);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue