Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Craft4Cube committed Feb 24, 2019
2 parents 37b3b7f + 12ab3fc commit a373271
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/main/java/li/netcube/mcvm/client/ui/DisplayGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiLabel;
import net.minecraft.client.gui.GuiScreen;
<<<<<<< HEAD
import net.minecraft.client.gui.ScaledResolution;
=======
>>>>>>> refs/remotes/origin/master
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.DynamicTexture;
Expand Down Expand Up @@ -88,6 +91,10 @@ public String get() {
client = new VernacularClient(config);
connect();

<<<<<<< HEAD
=======

>>>>>>> refs/remotes/origin/master
Keyboard.enableRepeatEvents(true);
}

Expand Down Expand Up @@ -223,6 +230,7 @@ public void DisplayDrawTexturedModalRect(int x, int y, int width, int height)
boolean lastMouseR = false;

public void checkMouse(int bX, int bY, int bW, int bH) {
<<<<<<< HEAD
ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft());
float guiScale = scaledresolution.getScaleFactor()/2f;
if (client != null && client.isRunning()) {
Expand Down Expand Up @@ -254,14 +262,33 @@ public void checkMouse(int bX, int bY, int bW, int bH) {
System.out.println(mouseX);
System.out.println(mouseY);
System.out.println("-------------");
=======
if (client != null && client.isRunning()) {
int mouseX = Mouse.getX();
int mouseY = Mouse.getY();
if (lastMouseX != mouseX || lastMouseY != mouseY) {
lastMouseY = mouseY; lastMouseX = mouseX;

mouseY = this.height - mouseY;

mouseX = mouseX - bX;
mouseY = mouseY + bY;

mouseX = scaleMouseX(mouseX, bW, bW);
mouseY = scaleMouseY(mouseY, bH, bH);
>>>>>>> refs/remotes/origin/master


if (mouseX < 0) {mouseX = 0;}
if (mouseX > bW) {mouseX = bW;}
if (mouseY < 0) {mouseY = 0;}
if (mouseY > bH) {mouseY = bH;}

<<<<<<< HEAD
client.moveMouse((int)(mouseX/guiScale), (int)(mouseY/guiScale));
=======
client.moveMouse(mouseX, mouseY);
>>>>>>> refs/remotes/origin/master
}

boolean mouseL = Mouse.isButtonDown(0);
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/li/netcube/mcvm/util/vm/VirtualMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,16 @@ public void start() {
errorGobbler.start();
outputGobbler.start();

<<<<<<< HEAD
System.out.println(commandLine);
=======
//builder.directory(gameFolder);

System.out.println(commandLine);
//builder.inheritIO();
//builder.redirectOutput(new File("mcvm_vmlog.txt"));
//builder.redirectError(new File("mcvm_vmerrlog.txt"));
>>>>>>> refs/remotes/origin/master
System.out.println();

MCVM.virtualMachines.add(this);
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/mcvm/models/item/computer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "mcvm:block/computer"
}
3 changes: 3 additions & 0 deletions src/main/resources/assets/mcvm/models/item/display.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "mcvm:block/display"
}

0 comments on commit a373271

Please sign in to comment.