diff options
| author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-04 14:51:34 +0200 |
|---|---|---|
| committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-04 14:51:34 +0200 |
| commit | 1210e38c2ff569a28b20d7d0182557fbf386d524 (patch) | |
| tree | fe1a32fd752a484eeaced6c7ee58fdaad159b412 /src/main/java/io/polyfrost/oneconfig/hud/gui | |
| parent | fe04136d705ca5f946ee8353c7f7c67e284c9ca5 (diff) | |
| download | OneConfig-1210e38c2ff569a28b20d7d0182557fbf386d524.tar.gz OneConfig-1210e38c2ff569a28b20d7d0182557fbf386d524.tar.bz2 OneConfig-1210e38c2ff569a28b20d7d0182557fbf386d524.zip | |
temp
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/hud/gui')
| -rw-r--r-- | src/main/java/io/polyfrost/oneconfig/hud/gui/HudGui.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/hud/gui/HudGui.java b/src/main/java/io/polyfrost/oneconfig/hud/gui/HudGui.java index 262e36d..6e1ce6c 100644 --- a/src/main/java/io/polyfrost/oneconfig/hud/gui/HudGui.java +++ b/src/main/java/io/polyfrost/oneconfig/hud/gui/HudGui.java @@ -3,6 +3,7 @@ package io.polyfrost.oneconfig.hud.gui; import io.polyfrost.oneconfig.hud.HudCore; import io.polyfrost.oneconfig.hud.interfaces.BasicHud; import io.polyfrost.oneconfig.renderer.Renderer; +import io.polyfrost.oneconfig.test.TestHud; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; @@ -20,13 +21,15 @@ public class HudGui extends GuiScreen { private boolean isScaling; private int xOffset; private int yOffset; - private boolean wereKeypressesEnabled; @Override public void initGui() { HudCore.editing = true; - wereKeypressesEnabled = Keyboard.areRepeatEventsEnabled(); Keyboard.enableRepeatEvents(true); + for (BasicHud hud : HudCore.huds) { + hud.childRight = new TestHud(); + hud.childRight.parent = hud; + } } @Override @@ -56,8 +59,8 @@ public class HudGui extends GuiScreen { editingHud.yUnscaled = (yFloat + (hud.getHeight(hud.scale) + hud.paddingY * hud.scale)) / (double) this.height; } - int width = (int) (hud.getWidth(hud.scale) + hud.paddingX * hud.scale); - int height = (int) (hud.getHeight(hud.scale) + hud.paddingY * hud.scale); + int width = (int) (hud.getTotalWidth(hud.scale) + hud.paddingX * hud.scale); + int height = (int) (hud.getTotalHeight(hud.scale) + hud.paddingY * hud.scale); int x = (int) hud.getXScaled(this.width); int y = (int) hud.getYScaled(this.height); @@ -232,7 +235,7 @@ public class HudGui extends GuiScreen { @Override public void onGuiClosed() { HudCore.editing = false; - Keyboard.enableRepeatEvents(wereKeypressesEnabled); + Keyboard.enableRepeatEvents(false); } @Override |
