diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-28 20:45:50 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-28 20:45:50 +0200 |
commit | 117d80ff0e343eecf260fd363db896166d8061d7 (patch) | |
tree | 8ef0ead687b69caf646874458beefa1d1710a38a /src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java | |
parent | 7c5123ff64c751c19411982189321be3511a9815 (diff) | |
download | OneConfig-117d80ff0e343eecf260fd363db896166d8061d7.tar.gz OneConfig-117d80ff0e343eecf260fd363db896166d8061d7.tar.bz2 OneConfig-117d80ff0e343eecf260fd363db896166d8061d7.zip |
better mousepressed handling, some more option types and some other things I forgor
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java')
-rw-r--r-- | src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java index 67ddc21..22e8f71 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java @@ -11,6 +11,7 @@ import io.polyfrost.oneconfig.utils.MathUtils; import net.minecraft.client.gui.GuiScreen; import org.jetbrains.annotations.NotNull; import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; import static org.lwjgl.nanovg.NanoVG.nvgResetScissor; import static org.lwjgl.nanovg.NanoVG.nvgScissor; @@ -30,6 +31,7 @@ public class OneConfigGui extends GuiScreen { private final TextInputField textInputField = new TextInputField(248, 40, "Search all of OneConfig...", false, false); + public boolean mouseDown; public OneConfigGui() { INSTANCE = this; @@ -47,8 +49,6 @@ public class OneConfigGui extends GuiScreen { RenderManager.drawRoundedRect(vg, 320, 140, 244, 800, OneConfigConfig.GRAY_900_80, OneConfigConfig.CORNER_RADIUS_WIN); RenderManager.drawRect(vg, 544, 140, 20, 800, OneConfigConfig.GRAY_800); //RenderManager.drawDropShadow(vg, 544, 140, 1056, 800, 20f, 32f, OneConfigConfig.GRAY_800); - } else { - // L; } RenderManager.drawLine(vg, 544, 212, 1600, 212, 1, OneConfigConfig.GRAY_700); @@ -78,15 +78,8 @@ public class OneConfigGui extends GuiScreen { String s = (" draw: " + end / 1000000f + "ms"); RenderManager.drawString(vg, currentPage.getTitle(), x + 336, y + 36, OneConfigConfig.WHITE_90, 32f, Fonts.INTER_SEMIBOLD); RenderManager.drawString(vg, s, x + 1170, y + 790, OneConfigConfig.GRAY_300, 10f, Fonts.INTER_MEDIUM); - - - //textInputField.draw(vg, 792, 548); - //btn.draw(vg, 976, 870); - - //RenderManager.drawGradientRoundedRect(vg, 100, 100, 500, 100, OneConfigConfig.BLUE_600, OneConfigConfig.BLUE_500, OneConfigConfig.CORNER_RADIUS_WIN); - }); - + mouseDown = Mouse.isButtonDown(0) && prevPage == null; } protected void keyTyped(char key, int keyCode) { @@ -112,4 +105,9 @@ public class OneConfigGui extends GuiScreen { public boolean doesGuiPauseGame() { return false; } + + @Override + public void onGuiClosed() { + currentPage.finishUpAndClose(); + } } |