Pressing the chat button if a GuiMouseInput is already present closes this GuiMouseInput (easier toggle between mouse and camera mode)

This commit is contained in:
CrushedPixel
2015-07-29 12:24:43 +02:00
parent dd68b1546d
commit d4e16ee07e

View File

@@ -15,10 +15,21 @@ public class GuiMouseInput extends GuiScreen {
private final GuiReplayOverlay overlay; private final GuiReplayOverlay overlay;
private boolean shouldClose = false;
public GuiMouseInput(GuiReplayOverlay overlay) { public GuiMouseInput(GuiReplayOverlay overlay) {
this.overlay = overlay; this.overlay = overlay;
Mouse.setGrabbed(false); Mouse.setGrabbed(false);
Mouse.setCursorPosition(mc.displayWidth/2, mc.displayHeight/2); Mouse.setCursorPosition(mc.displayWidth/2, mc.displayHeight/2);
if(mc.currentScreen instanceof GuiMouseInput) {
shouldClose = true;
}
}
@Override
public void initGui() {
if(shouldClose) mc.displayGuiScreen(null);
} }
@Override @Override