diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-30 11:58:23 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-04-30 11:58:23 +0200 |
commit | cb211a4c727243ede579a439008c6097506fe046 (patch) | |
tree | f2c7c20b5659ff4df657179e404b14b3583046a7 /src/main/java/io | |
parent | b49893c61b81d326e69212f3784933209834ee61 (diff) | |
parent | 9c22bd4d7f23256f97175cdeb1412505f56d2e73 (diff) | |
download | OneConfig-cb211a4c727243ede579a439008c6097506fe046.tar.gz OneConfig-cb211a4c727243ede579a439008c6097506fe046.tar.bz2 OneConfig-cb211a4c727243ede579a439008c6097506fe046.zip |
Merge branch 'master' of github.com:Polyfrost/OneConfig
Diffstat (limited to 'src/main/java/io')
5 files changed, 0 insertions, 15 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java index 8a39c38..ae8d796 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/OneConfigGui.java @@ -18,7 +18,6 @@ import static org.lwjgl.nanovg.NanoVG.nvgScissor; public class OneConfigGui extends GuiScreen { public static OneConfigGui INSTANCE; - private final BasicElement element = new BasicElement(200, 200, 1, true); public final int x = 320; public final int y = 140; diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/TextInputField.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/TextInputField.java index d5dcfdd..8f7f77c 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/elements/TextInputField.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/TextInputField.java @@ -14,9 +14,6 @@ import java.awt.*; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; -import static org.lwjgl.nanovg.NanoVG.nvgResetScissor; -import static org.lwjgl.nanovg.NanoVG.nvgScissor; - public class TextInputField extends BasicElement { protected final String defaultText; @@ -78,7 +75,6 @@ public class TextInputField extends BasicElement { } width = RenderManager.getTextWidth(vg, s.substring(0, caretPos), 14f, Fonts.INTER_REGULAR); } - nvgScissor(vg, x, y, this.width, height); if(hovered) { while (Mouse.next()) { if (Mouse.getEventButtonState()) { @@ -139,7 +135,6 @@ public class TextInputField extends BasicElement { } else { RenderManager.drawString(vg, s.toString(), x + 12, y + height / 2f + 1, color, 14f, Fonts.INTER_REGULAR); } - nvgResetScissor(vg); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigPage.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigPage.java index 65be59f..569d799 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigPage.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigPage.java @@ -27,7 +27,6 @@ public class ConfigPage extends BasicOption { @Override public void draw(long vg, int x, int y) { int height = description.equals("") ? 64 : 96; - NanoVG.nvgScissor(vg, x - 16, y, 1024, height); boolean hovered = InputUtils.isAreaHovered(x - 2, y, 1024, height); boolean clicked = InputUtils.isAreaClicked(x - 2, y, 1024, height); backgroundColor = ColorUtils.smoothColor(backgroundColor, OneConfigConfig.GRAY_500, OneConfigConfig.GRAY_400, hovered, 100); @@ -42,7 +41,6 @@ public class ConfigPage extends BasicOption { if (clicked) OneConfigGui.INSTANCE.openPage(new ModConfigPage(page)); NanoVG.nvgGlobalAlpha(vg, 1f); - NanoVG.nvgResetScissor(vg); } @Override diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java index 5a4288b..581257b 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java @@ -10,9 +10,6 @@ import io.polyfrost.oneconfig.utils.MathUtils; import java.lang.reflect.Field; -import static org.lwjgl.nanovg.NanoVG.nvgResetScissor; -import static org.lwjgl.nanovg.NanoVG.nvgScissor; - public class ConfigSwitch extends BasicOption { private int color; private float percentOn = 0f; @@ -29,7 +26,6 @@ public class ConfigSwitch extends BasicOption { toggled = (boolean) get(); } catch (IllegalAccessException ignored) { } - nvgScissor(vg, x, y, size == 1 ? 480 : 992, 32); int x2 = x + 19 + (int) (percentOn * 18); color = ColorUtils.smoothColor(color, OneConfigConfig.GRAY_400, OneConfigConfig.BLUE_500, toggled, 20f); if (color == -15123643) { @@ -49,7 +45,6 @@ public class ConfigSwitch extends BasicOption { } } percentOn = MathUtils.clamp(MathUtils.easeOut(percentOn, toggled ? 1f : 0f, 10)); - nvgResetScissor(vg); } @Override diff --git a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java index 4d44701..8d6179c 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java @@ -30,9 +30,7 @@ public class ConfigTextBox extends BasicOption { @Override public void draw(long vg, int x, int y) { - NanoVG.nvgScissor(vg, x, y, size == 1 && !secure && !multiLine ? 216 : 344, 32); RenderManager.drawString(vg, name, x, y + 16, OneConfigConfig.WHITE, 14, Fonts.INTER_MEDIUM); - NanoVG.nvgResetScissor(vg); textField.draw(vg, x + (size == 1 && hasHalfSize() ? 224 : 352), y); |