forked from RepoMirrors/kami-blue
cleanup code in gui stuff
This commit is contained in:
parent
02f529e3d4
commit
11b79dd197
|
@ -69,18 +69,18 @@ public class DisplayGuiScreen extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
|
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||||
gui.handleMouseDown(this.mouseX, this.mouseY);
|
gui.handleMouseDown(DisplayGuiScreen.mouseX, DisplayGuiScreen.mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void mouseReleased(int mouseX, int mouseY, int state) {
|
protected void mouseReleased(int mouseX, int mouseY, int state) {
|
||||||
gui.handleMouseRelease(this.mouseX, this.mouseY);
|
gui.handleMouseRelease(DisplayGuiScreen.mouseX, DisplayGuiScreen.mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) {
|
protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) {
|
||||||
gui.handleMouseDrag(this.mouseX, this.mouseY);
|
gui.handleMouseDrag(DisplayGuiScreen.mouseX, DisplayGuiScreen.mouseY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -88,13 +88,13 @@ public class DisplayGuiScreen extends GuiScreen {
|
||||||
if (Mouse.hasWheel()) {
|
if (Mouse.hasWheel()) {
|
||||||
int a = Mouse.getDWheel();
|
int a = Mouse.getDWheel();
|
||||||
if (a != 0) {
|
if (a != 0) {
|
||||||
gui.handleWheel(this.mouseX, this.mouseY, a);
|
gui.handleWheel(mouseX, mouseY, a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void keyTyped(char typedChar, int keyCode) throws IOException {
|
protected void keyTyped(char typedChar, int keyCode) {
|
||||||
if (ModuleManager.getModuleByName("clickGUI").getBind().isDown(keyCode) || keyCode == Keyboard.KEY_ESCAPE) {
|
if (ModuleManager.getModuleByName("clickGUI").getBind().isDown(keyCode) || keyCode == Keyboard.KEY_ESCAPE) {
|
||||||
mc.displayGuiScreen(lastScreen);
|
mc.displayGuiScreen(lastScreen);
|
||||||
}
|
}
|
||||||
|
@ -119,8 +119,8 @@ public class DisplayGuiScreen extends GuiScreen {
|
||||||
private void calculateMouse() {
|
private void calculateMouse() {
|
||||||
Minecraft minecraft = Minecraft.getMinecraft();
|
Minecraft minecraft = Minecraft.getMinecraft();
|
||||||
int scaleFactor = getScale();
|
int scaleFactor = getScale();
|
||||||
this.mouseX = Mouse.getX() / scaleFactor;
|
mouseX = Mouse.getX() / scaleFactor;
|
||||||
this.mouseY = minecraft.displayHeight / scaleFactor - Mouse.getY() / scaleFactor - 1;
|
mouseY = minecraft.displayHeight / scaleFactor - Mouse.getY() / scaleFactor - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue