aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-05-21 17:50:43 +0700
committerGitHub <noreply@github.com>2022-05-21 12:50:43 +0200
commitba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77 (patch)
treea052e7ac963be0f64980fc3faa664ebf20a52b34 /src/main/java/cc/polyfrost/oneconfig/gui
parent1abe65dc3875df5a490d8c900399e61a378ae901 (diff)
downloadOneConfig-ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77.tar.gz
OneConfig-ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77.tar.bz2
OneConfig-ba87b8b1fa4e2397a3e0ed5a18f7ea6137d42f77.zip
vigilance compat (#15)
* vigilance compat reorganize ASM * remove non-RenderManager nanovg usage wherever possible fix build generalize utils * setupGradle task * migrate to kotlin gradle use essential gradle toolkit shade new gson * Small changes * Update .gitignore * fix natives * Fix all problems * null Co-authored-by: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java6
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java21
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java5
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java1
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java11
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java29
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java9
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java21
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java8
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java8
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java8
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java5
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java8
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java7
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java17
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java11
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java4
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/pages/Page.java3
20 files changed, 91 insertions, 95 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java
index e81fb86..4595725 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java
@@ -4,9 +4,9 @@ import cc.polyfrost.oneconfig.config.core.ConfigCore;
import cc.polyfrost.oneconfig.hud.BasicHud;
import cc.polyfrost.oneconfig.hud.HudCore;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
-import gg.essential.universal.UKeyboard;
-import gg.essential.universal.UMatrixStack;
-import gg.essential.universal.UScreen;
+import cc.polyfrost.oneconfig.libs.universal.UKeyboard;
+import cc.polyfrost.oneconfig.libs.universal.UMatrixStack;
+import cc.polyfrost.oneconfig.libs.universal.UScreen;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java
index 66bc2cd..d0e0625 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/OneConfigGui.java
@@ -14,11 +14,10 @@ import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor;
import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
-import gg.essential.universal.*;
+import cc.polyfrost.oneconfig.libs.universal.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.input.Mouse;
-import org.lwjgl.nanovg.NanoVG;
import java.util.ArrayList;
@@ -82,7 +81,7 @@ public class OneConfigGui extends UScreen {
scale = Math.min(Math.min(1f, UResolution.getWindowWidth() / 1280f), Math.min(1f, UResolution.getWindowHeight() / 800f));
int x = (int) ((UResolution.getWindowWidth() - 1280 * scale) / 2f / scale);
int y = (int) ((UResolution.getWindowHeight() - 800 * scale) / 2f / scale);
- NanoVG.nvgScale(vg, scale, scale);
+ RenderManager.scale(vg, scale, scale);
if (OneConfigConfig.ROUNDED_CORNERS) {
RenderManager.drawRoundedRect(vg, x + 224, y, 1056, 800, OneConfigConfig.GRAY_800, OneConfigConfig.CORNER_RADIUS_WIN);
RenderManager.drawRoundedRect(vg, x, y, 244, 800, OneConfigConfig.GRAY_900_80, OneConfigConfig.CORNER_RADIUS_WIN);
@@ -103,22 +102,22 @@ public class OneConfigGui extends UScreen {
if (previousPages.size() == 0) {
backArrow.disable(true);
- NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ RenderManager.withAlpha(vg, 0.5f);
} else {
backArrow.disable(false);
- if (!backArrow.isHovered() || Mouse.isButtonDown(0)) NanoVG.nvgGlobalAlpha(vg, 0.8f);
+ if (!backArrow.isHovered() || Mouse.isButtonDown(0)) RenderManager.withAlpha(vg, 0.8f);
}
RenderManager.drawSvg(vg, SVGs.ARROW_CIRCLE_LEFT, x + 249, y + 25, 22, 22);
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
if (nextPages.size() == 0) {
forwardArrow.disable(true);
- NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ RenderManager.withAlpha(vg, 0.5f);
} else {
forwardArrow.disable(false);
- if (!forwardArrow.isHovered() || Mouse.isButtonDown(0)) NanoVG.nvgGlobalAlpha(vg, 0.8f);
+ if (!forwardArrow.isHovered() || Mouse.isButtonDown(0)) RenderManager.withAlpha(vg, 0.8f);
}
RenderManager.drawSvg(vg, SVGs.ARROW_CIRCLE_RIGHT, x + 289, y + 25, 22, 22);
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
if (backArrow.isClicked() && previousPages.size() > 0) {
try {
@@ -138,7 +137,7 @@ public class OneConfigGui extends UScreen {
Scissor scissor = ScissorManager.scissor(vg, x + 224, y + 88, 1056, 698);
if (prevPage != null) {
- pageProgress = MathUtils.easeInOutCirc(50, pageProgress, 832 - pageProgress, 600);
+ pageProgress = MathUtils.easeInOutCirc(50, pageProgress, 832 - pageProgress, 600, deltaTime);
prevPage.scrollWithDraw(vg, (int) (x - pageProgress), y + 72);
RenderManager.drawLine(vg, (int) (x - pageProgress + 1055), y + 72, (int) (x - pageProgress + 1057), y + 800, 2, OneConfigConfig.GRAY_700); // TODO might remove this
currentPage.scrollWithDraw(vg, (int) (x - pageProgress + 1056), y + 72);
@@ -225,7 +224,7 @@ public class OneConfigGui extends UScreen {
/**
* initialize a new ColorSelector and add it to the draw script. This method is used to make sure it is always rendered on top.
*
- * @implNote Correct usage: <code>OneConfigGui.INSTANCE.initColorSelector(new ColorSelector(color, InputUtils.mouseX(), InputUtils.mouseY()));</code>
+ * Correct usage: <code>OneConfigGui.INSTANCE.initColorSelector(new ColorSelector(color, InputUtils.mouseX(), InputUtils.mouseY()));</code>
*/
public void initColorSelector(ColorSelector colorSelector) {
currentColorSelector = colorSelector;
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
index 059e69d..11e9c6e 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/SideBar.java
@@ -6,10 +6,9 @@ import cc.polyfrost.oneconfig.gui.pages.HomePage;
import cc.polyfrost.oneconfig.gui.pages.ModsPage;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
-import cc.polyfrost.oneconfig.lwjgl.image.Images;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
import cc.polyfrost.oneconfig.utils.MathUtils;
-import gg.essential.universal.UScreen;
+import cc.polyfrost.oneconfig.libs.universal.UScreen;
import java.util.ArrayList;
import java.util.List;
@@ -38,7 +37,7 @@ public class SideBar {
}
public void draw(long vg, int x, int y) {
- currentY = MathUtils.easeInOutCirc(50, currentY, targetY - currentY, 400);
+ currentY = MathUtils.easeInOutCirc(50, currentY, targetY - currentY, 400, OneConfigGui.INSTANCE.getDeltaTime());
RenderManager.drawRoundedRect(vg, x + 16, y + currentY, 192, 36, OneConfigConfig.BLUE_600, OneConfigConfig.CORNER_RADIUS);
int i = 0;
if (targetY == 0) {
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java
index 07c4a04..bcfebd3 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/BasicElement.java
@@ -1,5 +1,6 @@
package cc.polyfrost.oneconfig.gui.elements;
+import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java
index dc257a8..3b37b53 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java
@@ -129,7 +129,7 @@ public class ColorSelector {
}
i += 128;
}
- percentMove = MathUtils.easeOut(percentMove, mode, 100f);
+ percentMove = MathUtils.easeOut(percentMove, mode, 100f, OneConfigGui.INSTANCE.getDeltaTime());
RenderManager.drawString(vg, "HSB Box", x + 55, y + 81, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM);
RenderManager.drawString(vg, "Color Wheel", x + 172.5f, y + 81, OneConfigConfig.WHITE, 12f, Fonts.MEDIUM);
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java
index 4942f9f..9518579 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ModCard.java
@@ -8,16 +8,14 @@ import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.gui.pages.ModConfigPage;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
-import cc.polyfrost.oneconfig.lwjgl.image.Images;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
import cc.polyfrost.oneconfig.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
-import gg.essential.universal.wrappers.UPlayer;
+import cc.polyfrost.oneconfig.libs.universal.wrappers.UPlayer;
import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.fml.common.ModMetadata;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.lwjgl.nanovg.NanoVG;
import java.util.ArrayList;
@@ -44,7 +42,7 @@ public class ModCard extends BasicElement {
@Override
public void draw(long vg, int x, int y) {
- if (disabled) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (disabled) RenderManager.withAlpha(vg, 0.5f);
RenderManager.drawRoundedRectVaried(vg, x, y, width, 87, colorGray, 12f, 12f, 0f, 0f);
RenderManager.drawRoundedRectVaried(vg, x, y + 87, width, 32, colorPrimary, 0f, 0f, 12f, 12f);
RenderManager.drawLine(vg, x, y + 86, x + width, y + 86, 2, OneConfigConfig.GRAY_300);
@@ -80,15 +78,16 @@ public class ModCard extends BasicElement {
if (!active & disabled) toggled = false;
active = toggled;
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
public void onClick() {
if (isHoveredMain) {
for (Mod data : OneConfig.loadedMods) {
- if (data.modType != ModType.THIRD_PARTY) {
+ if (!data.isShortCut) {
if (data.name.equalsIgnoreCase(modData.name)) {
OneConfigGui.INSTANCE.openPage(new ModConfigPage(data.defaultPage));
+ return;
}
}
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java
index 2e8cb4f..d2a996d 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigButton.java
@@ -5,36 +5,43 @@ import cc.polyfrost.oneconfig.config.interfaces.BasicOption;
import cc.polyfrost.oneconfig.gui.elements.BasicButton;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
-import org.lwjgl.nanovg.NanoVG;
import java.lang.reflect.Field;
public class ConfigButton extends BasicOption {
private final BasicButton button;
+ public ConfigButton(Runnable runnable, Object parent, String name, int size, String text) {
+ super(null, parent, name, size);
+ this.button = new BasicButton(size == 1 ? 128 : 256, 32, text, null, null, 1, BasicButton.ALIGNMENT_CENTER, runnable);
+ }
+
public ConfigButton(Field field, Object parent, String name, int size, String text) {
super(field, parent, name, size);
- Runnable runnable = () -> {
- };
- try {
- runnable = (Runnable) get();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- }
- this.button = new BasicButton(size == 1 ? 128 : 256, 32, text, null, null, 1, BasicButton.ALIGNMENT_CENTER, runnable);
+ this.button = new BasicButton(size == 1 ? 128 : 256, 32, text, null, null, 1, BasicButton.ALIGNMENT_CENTER, getRunnableFromField(field, parent));
}
@Override
public void draw(long vg, int x, int y) {
button.disable(!isEnabled());
- if(!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if(!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
RenderManager.drawString(vg, name, x, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM);
button.draw(vg, x + (size == 1 ? 352 : 736), y);
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
@Override
public int getHeight() {
return 32;
}
+
+ private static Runnable getRunnableFromField(Field field, Object parent) {
+ Runnable runnable = () -> {};
+ try {
+ runnable = (Runnable) field.get(parent);
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ return runnable;
+ }
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java
index 36cd13f..4c864ec 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigCheckbox.java
@@ -2,14 +2,13 @@ package cc.polyfrost.oneconfig.gui.elements.config;
import cc.polyfrost.oneconfig.config.OneConfigConfig;
import cc.polyfrost.oneconfig.config.interfaces.BasicOption;
+import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
-import cc.polyfrost.oneconfig.lwjgl.image.Images;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
import cc.polyfrost.oneconfig.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
-import org.lwjgl.nanovg.NanoVG;
import java.awt.*;
import java.lang.reflect.Field;
@@ -24,7 +23,7 @@ public class ConfigCheckbox extends BasicOption {
@Override
public void draw(long vg, int x, int y) {
- if (!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
boolean toggled = false;
try {
toggled = (boolean) get();
@@ -48,7 +47,7 @@ public class ConfigCheckbox extends BasicOption {
RenderManager.drawHollowRoundRect(vg, x, y + 4, 23.5f, 23.5f, OneConfigConfig.GRAY_300, 6f, 1f); // the 0.5f is to make it look better ok
}
RenderManager.drawString(vg, name, x + 32, y + 17, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM);
- percentOn = MathUtils.clamp(MathUtils.easeOut(percentOn, toggled ? 1f : 0f, 50f));
+ percentOn = MathUtils.clamp(MathUtils.easeOut(percentOn, toggled ? 1f : 0f, 50f, OneConfigGui.INSTANCE.getDeltaTime()));
if (percentOn != 0 && percentOn != 1f) {
RenderManager.drawRoundedRect(vg, x, y + 4, 24, 24, ColorUtils.setAlpha(OneConfigConfig.BLUE_500, (int) (percentOn * 255)), 6f);
RenderManager.drawSvg(vg, SVGs.CHECKBOX_TICK, x, y + 4, 24, 24, new Color(1f, 1f, 1f, percentOn).getRGB());
@@ -57,7 +56,7 @@ public class ConfigCheckbox extends BasicOption {
RenderManager.drawSvg(vg, SVGs.CHECKBOX_TICK, x, y + 4, 24, 24);
}
if(percentOn != 0 && hover) RenderManager.drawHollowRoundRect(vg, x - 1, y + 3, 24, 24, OneConfigConfig.BLUE_600, 6f, 2f);
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
@Override
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java
index f6041c9..d39566d 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDropdown.java
@@ -2,14 +2,13 @@ package cc.polyfrost.oneconfig.gui.elements.config;
import cc.polyfrost.oneconfig.config.OneConfigConfig;
import cc.polyfrost.oneconfig.config.interfaces.BasicOption;
+import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
-import cc.polyfrost.oneconfig.lwjgl.image.Images;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
import cc.polyfrost.oneconfig.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import org.lwjgl.input.Mouse;
-import org.lwjgl.nanovg.NanoVG;
import java.awt.*;
import java.lang.reflect.Field;
@@ -27,7 +26,7 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
@Override
public void draw(long vg, int x, int y) {
- if (!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
RenderManager.drawString(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM);
boolean hovered;
@@ -49,7 +48,7 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
} catch (IllegalAccessException ignored) {
}
- if (hovered && Mouse.isButtonDown(0)) NanoVG.nvgGlobalAlpha(vg, 0.8f);
+ if (hovered && Mouse.isButtonDown(0)) RenderManager.withAlpha(vg, 0.8f);
if (size == 1) {
RenderManager.drawRoundedRect(vg, x + 224, y, 256, 32, backgroundColor, 12);
RenderManager.drawString(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM);
@@ -61,7 +60,7 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, OneConfigConfig.BLUE_600, 8);
RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 964, y + 4, 24, 24);
}
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
@Override
@@ -79,15 +78,15 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
} catch (IllegalAccessException ignored) {
}
- if (hovered && Mouse.isButtonDown(0)) NanoVG.nvgGlobalAlpha(vg, 0.8f);
+ if (hovered && Mouse.isButtonDown(0)) RenderManager.withAlpha(vg, 0.8f);
if (size == 1) {
RenderManager.drawRoundedRect(vg, x + 224, y, 256, 32, backgroundColor, 12);
RenderManager.drawString(vg, options[selected], x + 236, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM);
- if (hovered && Mouse.isButtonDown(0)) NanoVG.nvgGlobalAlpha(vg, 0.8f);
+ if (hovered && Mouse.isButtonDown(0)) RenderManager.withAlpha(vg, 0.8f);
RenderManager.drawRoundedRect(vg, x + 452, y + 4, 24, 24, OneConfigConfig.BLUE_600, 8);
RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 452, y + 4, 24, 24);
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
RenderManager.drawRoundedRect(vg, x + 224, y + 48, 256, options.length * 32 + 8, OneConfigConfig.GRAY_700, 12);
RenderManager.drawHollowRoundRect(vg, x + 223, y + 47, 258, options.length * 32 + 10, new Color(204, 204, 204, 77).getRGB(), 12, 1);
int optionY = y + 52;
@@ -115,11 +114,11 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
} else {
RenderManager.drawRoundedRect(vg, x + 352, y, 640, 32, backgroundColor, 12);
RenderManager.drawString(vg, options[selected], x + 364, y + 16, OneConfigConfig.WHITE_80, 14f, Fonts.MEDIUM);
- if (hovered && Mouse.isButtonDown(0)) NanoVG.nvgGlobalAlpha(vg, 0.8f);
+ if (hovered && Mouse.isButtonDown(0)) RenderManager.withAlpha(vg, 0.8f);
RenderManager.drawRoundedRect(vg, x + 964, y + 4, 24, 24, OneConfigConfig.BLUE_600, 8);
RenderManager.drawSvg(vg, SVGs.DROPDOWN_LIST, x + 964, y + 4, 24, 24);
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
RenderManager.drawRoundedRect(vg, x + 352, y + 48, 640, options.length * 32 + 8, OneConfigConfig.GRAY_700, 12);
RenderManager.drawHollowRoundRect(vg, x + 351, y + 47, 642, options.length * 32 + 10, new Color(204, 204, 204, 77).getRGB(), 12, 1);
int optionY = y + 52;
@@ -146,7 +145,7 @@ public class ConfigDropdown extends BasicOption { // TODO: remove dividers and f
optionY += 32;
}
}
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
@Override
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java
index 599c094..cc1af3c 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigDualOption.java
@@ -2,12 +2,12 @@ package cc.polyfrost.oneconfig.gui.elements.config;
import cc.polyfrost.oneconfig.config.OneConfigConfig;
import cc.polyfrost.oneconfig.config.interfaces.BasicOption;
+import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
import cc.polyfrost.oneconfig.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
-import org.lwjgl.nanovg.NanoVG;
import java.lang.reflect.Field;
@@ -36,7 +36,7 @@ public class ConfigDualOption extends BasicOption {
toggled = (boolean) get();
} catch (IllegalAccessException ignored) {
}
- if (!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
boolean hovered = InputUtils.isAreaHovered(x + 226, y, 256, 32) && isEnabled();
colorSelected = ColorUtils.smoothColor(colorSelected, OneConfigConfig.BLUE_600, OneConfigConfig.BLUE_500, hovered, 40f);
colorUnselected = ColorUtils.smoothColor(colorUnselected, OneConfigConfig.GRAY_500, OneConfigConfig.GRAY_400, hovered, 40f);
@@ -47,7 +47,7 @@ public class ConfigDualOption extends BasicOption {
RenderManager.drawString(vg, left, x + 290 - RenderManager.getTextWidth(vg, left, 12f, Fonts.MEDIUM) / 2, y + 17, OneConfigConfig.WHITE_90, 12f, Fonts.MEDIUM);
RenderManager.drawString(vg, right, x + 418 - RenderManager.getTextWidth(vg, right, 12f, Fonts.MEDIUM) / 2, y + 17, OneConfigConfig.WHITE_90, 12f, Fonts.MEDIUM);
- NanoVG.nvgGlobalAlpha(vg, 1);
+ RenderManager.withAlpha(vg, 1);
if (hovered && InputUtils.isClicked()) {
toggled = !toggled;
try {
@@ -57,6 +57,6 @@ public class ConfigDualOption extends BasicOption {
e.printStackTrace();
}
}
- percentMove = MathUtils.clamp(MathUtils.easeOut(percentMove, toggled ? 1f : 0f, 75));
+ percentMove = MathUtils.clamp(MathUtils.easeOut(percentMove, toggled ? 1f : 0f, 75, OneConfigGui.INSTANCE.getDeltaTime()));
}
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java
index 5b3efae..0ddcab3 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigKeyBind.java
@@ -7,10 +7,8 @@ import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.gui.elements.BasicButton;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
-import cc.polyfrost.oneconfig.lwjgl.image.Images;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
-import gg.essential.universal.UKeyboard;
-import org.lwjgl.nanovg.NanoVG;
+import cc.polyfrost.oneconfig.libs.universal.UKeyboard;
import java.lang.reflect.Field;
@@ -26,7 +24,7 @@ public class ConfigKeyBind extends BasicOption {
@Override
public void draw(long vg, int x, int y) {
- if (!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
RenderManager.drawString(vg, name, x, y + 17, OneConfigConfig.WHITE, 14f, Fonts.MEDIUM);
OneKeyBind keyBind = getKeyBind();
String text = keyBind.getDisplay();
@@ -47,7 +45,7 @@ public class ConfigKeyBind extends BasicOption {
} else if (text.equals("")) text = "None";
button.setText(text);
button.draw(vg, x + (size == 1 ? 224 : 736), y);
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
@Override
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java
index 81cd946..5878cc0 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigPageButton.java
@@ -7,12 +7,10 @@ import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.gui.pages.ModConfigPage;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
-import cc.polyfrost.oneconfig.lwjgl.image.Images;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
import cc.polyfrost.oneconfig.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import org.lwjgl.input.Mouse;
-import org.lwjgl.nanovg.NanoVG;
import java.lang.reflect.Field;
@@ -34,8 +32,8 @@ public class ConfigPageButton extends BasicOption {
boolean clicked = hovered && InputUtils.isClicked();
backgroundColor = ColorUtils.smoothColor(backgroundColor, OneConfigConfig.GRAY_500, OneConfigConfig.GRAY_400, hovered, 100);
- if (hovered && Mouse.isButtonDown(0)) NanoVG.nvgGlobalAlpha(vg, 0.8f);
- if (!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (hovered && Mouse.isButtonDown(0)) RenderManager.withAlpha(vg, 0.8f);
+ if (!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
RenderManager.drawRoundedRect(vg, x - 16, y, 1024, height, backgroundColor, 20);
RenderManager.drawString(vg, name, x + 10, y + 32, OneConfigConfig.WHITE_90, 24, Fonts.MEDIUM);
@@ -44,7 +42,7 @@ public class ConfigPageButton extends BasicOption {
RenderManager.drawSvg(vg, SVGs.CHEVRON_RIGHT, x + 981f, y + (description.equals("") ? 20f : 36f), 13, 22);
if (clicked) OneConfigGui.INSTANCE.openPage(new ModConfigPage(page));
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
@Override
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java
index c9f2691..3f8a2d9 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSlider.java
@@ -8,7 +8,6 @@ import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
import org.lwjgl.input.Mouse;
-import org.lwjgl.nanovg.NanoVG;
import java.lang.reflect.Field;
@@ -34,7 +33,7 @@ public class ConfigSlider extends BasicOption {
float value = 0;
boolean hovered = InputUtils.isAreaHovered(x + 352, y, 512, 32) && isEnabled();
inputField.disable(!isEnabled());
- if (!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
boolean isMouseDown = Mouse.isButtonDown(0);
if (hovered && isMouseDown && !mouseWasDown) dragging = true;
mouseWasDown = isMouseDown;
@@ -80,7 +79,7 @@ public class ConfigSlider extends BasicOption {
if (step == 0) RenderManager.drawRoundedRect(vg, xCoordinate - 12, y + 4, 24, 24, OneConfigConfig.WHITE, 12f);
else RenderManager.drawRoundedRect(vg, xCoordinate - 4, y + 4, 8, 24, OneConfigConfig.WHITE, 4f);
inputField.draw(vg, x + 892, y);
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
private int getStepCoordinate(int xCoordinate, int x) {
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java
index 92961a6..5eadad2 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigSwitch.java
@@ -2,12 +2,12 @@ package cc.polyfrost.oneconfig.gui.elements.config;
import cc.polyfrost.oneconfig.config.OneConfigConfig;
import cc.polyfrost.oneconfig.config.interfaces.BasicOption;
+import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
import cc.polyfrost.oneconfig.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
-import org.lwjgl.nanovg.NanoVG;
import java.lang.reflect.Field;
@@ -32,7 +32,7 @@ public class ConfigSwitch extends BasicOption {
boolean hovered = InputUtils.isAreaHovered(x, y, 42, 32);
colorDisabled = ColorUtils.smoothColor(colorDisabled, OneConfigConfig.GRAY_400, OneConfigConfig.GRAY_300, hovered, 40f);
colorEnabled = ColorUtils.smoothColor(colorEnabled, OneConfigConfig.BLUE_600, OneConfigConfig.BLUE_500, hovered, 40f);
- if (!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
RenderManager.drawRoundedRect(vg, x, y + 4, 42, 24, colorDisabled, 12f);
if (percentOn != 0)
RenderManager.drawRoundedRect(vg, x, y + 4, 42, 24, ColorUtils.setAlpha(colorEnabled, (int) (255 * percentOn)), 12f);
@@ -48,8 +48,8 @@ public class ConfigSwitch extends BasicOption {
e.printStackTrace();
}
}
- percentOn = MathUtils.clamp(MathUtils.easeOut(percentOn, toggled ? 1f : 0f, 75));
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ percentOn = MathUtils.clamp(MathUtils.easeOut(percentOn, toggled ? 1f : 0f, 75, OneConfigGui.INSTANCE.getDeltaTime()));
+ RenderManager.withAlpha(vg, 1f);
}
@Override
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java
index dbe0482..7398ddb 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigTextBox.java
@@ -8,7 +8,6 @@ import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
import cc.polyfrost.oneconfig.utils.InputUtils;
import org.lwjgl.input.Mouse;
-import org.lwjgl.nanovg.NanoVG;
import java.awt.*;
import java.lang.reflect.Field;
@@ -27,7 +26,7 @@ public class ConfigTextBox extends BasicOption {
@Override
public void draw(long vg, int x, int y) {
- if (!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
textField.disable(!isEnabled());
RenderManager.drawString(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14, Fonts.MEDIUM);
@@ -46,10 +45,10 @@ public class ConfigTextBox extends BasicOption {
boolean hovered = InputUtils.isAreaHovered(x + 967, y + 7, 18, 18) && isEnabled();
int color = hovered ? OneConfigConfig.WHITE : OneConfigConfig.WHITE_80;
if (hovered && InputUtils.isClicked()) textField.setPassword(!textField.getPassword());
- if (hovered && Mouse.isButtonDown(0)) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (hovered && Mouse.isButtonDown(0)) RenderManager.withAlpha(vg, 0.5f);
RenderManager.drawSvg(vg, icon, x + 967, y + 7, 18, 18, color);
}
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
@Override
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java
index 938e830..ccda382 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/config/ConfigUniSelector.java
@@ -2,16 +2,15 @@ package cc.polyfrost.oneconfig.gui.elements.config;
import cc.polyfrost.oneconfig.config.OneConfigConfig;
import cc.polyfrost.oneconfig.config.interfaces.BasicOption;
+import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
+import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor;
import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager;
-import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
-import cc.polyfrost.oneconfig.lwjgl.image.Images;
import cc.polyfrost.oneconfig.utils.ColorUtils;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.MathUtils;
-import org.lwjgl.nanovg.NanoVG;
import java.lang.reflect.Field;
@@ -39,7 +38,7 @@ public class ConfigUniSelector extends BasicOption {
selected = (int) get();
} catch (IllegalAccessException ignored) {
}
- if (!isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (!isEnabled()) RenderManager.withAlpha(vg, 0.5f);
String option = options[selected] + " " + (selected + 1) + "/" + options.length;
RenderManager.drawString(vg, name, x, y + 16, OneConfigConfig.WHITE_90, 14f, Fonts.MEDIUM);
@@ -58,11 +57,11 @@ public class ConfigUniSelector extends BasicOption {
colorLeft = ColorUtils.smoothColor(colorLeft, OneConfigConfig.BLUE_500, OneConfigConfig.BLUE_400, hoveredLeft, 40f);
colorRight = ColorUtils.smoothColor(colorRight, OneConfigConfig.BLUE_500, OneConfigConfig.BLUE_400, hoveredRight, 40f);
- if (selected <= 0 && isEnabled()) NanoVG.nvgGlobalAlpha(vg, 0.5f);
+ if (selected <= 0 && isEnabled()) RenderManager.withAlpha(vg, 0.5f);
RenderManager.drawSvg(vg, SVGs.CHEVRON_LEFT, x + 231, y + 7, 18, 18, colorLeft);
- if (isEnabled()) NanoVG.nvgGlobalAlpha(vg, selected >= options.length - 1 ? 0.5f : 1f);
+ if (isEnabled()) RenderManager.withAlpha(vg, selected >= options.length - 1 ? 0.5f : 1f);
RenderManager.drawSvg(vg, SVGs.CHEVRON_RIGHT, x + 455, y + 7, 18, 18, colorRight);
- if (isEnabled()) NanoVG.nvgGlobalAlpha(vg, 1f);
+ if (isEnabled()) RenderManager.withAlpha(vg, 1f);
if (hoveredLeft && InputUtils.isClicked()) {
previous = selected;
@@ -81,8 +80,8 @@ public class ConfigUniSelector extends BasicOption {
}
percentMove = selected < previous ? 0f : 1f;
}
- if (previous != -1) percentMove = MathUtils.easeOut(percentMove, selected < previous ? 1f : 0f, 75);
+ if (previous != -1) percentMove = MathUtils.easeOut(percentMove, selected < previous ? 1f : 0f, 75, OneConfigGui.INSTANCE.getDeltaTime());
if ((selected < previous ? 1f : 0f) == percentMove) previous = -1;
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
}
}
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java
index 0660efe..08e8597 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/NumberInputField.java
@@ -1,12 +1,11 @@
package cc.polyfrost.oneconfig.gui.elements.text;
import cc.polyfrost.oneconfig.config.OneConfigConfig;
+import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.gui.elements.BasicElement;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
-import cc.polyfrost.oneconfig.lwjgl.image.Images;
import cc.polyfrost.oneconfig.lwjgl.image.SVGs;
import cc.polyfrost.oneconfig.utils.ColorUtils;
-import org.lwjgl.nanovg.NanoVG;
public class NumberInputField extends TextInputField {
private final BasicElement upArrow = new BasicElement(12, 14, false);
@@ -62,20 +61,20 @@ public class NumberInputField extends TextInputField {
setCurrentValue(current);
}
if (current >= max && !disabled) {
- NanoVG.nvgGlobalAlpha(vg, 0.3f);
+ RenderManager.withAlpha(vg, 0.3f);
upArrow.disable(true);
}
RenderManager.drawRoundedRectVaried(vg, x + width + 4, y, 12, 14, colorTop, 6f, 6f, 0f, 0f);
RenderManager.drawSvg(vg, SVGs.CHEVRON_UP, x + width + 5, y + 2, 10, 10);
- if (current >= max && !disabled) NanoVG.nvgGlobalAlpha(vg, 1f);
+ if (current >= max && !disabled) RenderManager.withAlpha(vg, 1f);
if (current <= min && !disabled) {
- NanoVG.nvgGlobalAlpha(vg, 0.3f);
+ RenderManager.withAlpha(vg, 0.3f);
downArrow.disable(true);
}
RenderManager.drawRoundedRectVaried(vg, x + width + 4, y + 14, 12, 14, colorBottom, 0f, 0f, 6f, 6f);
RenderManager.drawSvg(vg, SVGs.CHEVRON_DOWN, x + width + 5, y + 15, 10, 10);
- NanoVG.nvgGlobalAlpha(vg, 1f);
+ RenderManager.withAlpha(vg, 1f);
try {
super.draw(vg, x, y - 2);
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java
index a91d19d..c08d9f6 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/text/TextInputField.java
@@ -9,7 +9,7 @@ import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor;
import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager;
import cc.polyfrost.oneconfig.utils.InputUtils;
import cc.polyfrost.oneconfig.utils.TextUtils;
-import gg.essential.universal.UKeyboard;
+import cc.polyfrost.oneconfig.libs.universal.UKeyboard;
import kotlin.Pair;
import org.jetbrains.annotations.NotNull;
import org.lwjgl.input.Keyboard;
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java
index 1d2dfac..cd46797 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java
@@ -30,7 +30,7 @@ public class ModsPage extends Page {
modCategories.add(new BasicButton(104, 32, "Utility & QoL", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(3)));
modCategories.add(new BasicButton(80, 32, "Hypixel", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(4)));
modCategories.add(new BasicButton(80, 32, "Skyblock", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(5)));
- modCategories.add(new BasicButton(88, 32, "3rd Party", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(6)));
+ modCategories.add(new BasicButton(88, 32, "3rd Party", null, null, 0, BasicButton.ALIGNMENT_CENTER, true, () -> unselect(7)));
modCategories.get(0).setToggled(true);
}
@@ -85,7 +85,7 @@ public class ModsPage extends Page {
}
private boolean inSelection(ModCard modCard) {
- return modCategories.get(0).isToggled() && (OneConfigConfig.allShowShortCut || !modCard.getModData().isShortCut) || (modCategories.get(1).isToggled() && modCard.getModData().modType == ModType.PVP) || (modCategories.get(2).isToggled() && modCard.getModData().modType == ModType.HUD) || (modCategories.get(3).isToggled() && modCard.getModData().modType == ModType.UTIL_QOL) || (modCategories.get(4).isToggled() && modCard.getModData().modType == ModType.HYPIXEL) || (modCategories.get(5).isToggled() && modCard.getModData().modType == ModType.SKYBLOCK) || (modCategories.get(6).isToggled() && modCard.getModData().modType == ModType.THIRD_PARTY);
+ return modCategories.get(0).isToggled() && (OneConfigConfig.allShowShortCut || !modCard.getModData().isShortCut) || (modCategories.get(1).isToggled() && modCard.getModData().modType == ModType.PVP) || (modCategories.get(2).isToggled() && modCard.getModData().modType == ModType.HUD) || (modCategories.get(3).isToggled() && modCard.getModData().modType == ModType.UTIL_QOL) || (modCategories.get(4).isToggled() && modCard.getModData().modType == ModType.HYPIXEL) || (modCategories.get(5).isToggled() && modCard.getModData().modType == ModType.SKYBLOCK) || (modCategories.get(6).isToggled() && modCard.getModData().modType == ModType.THIRD_PARTY);
}
@Override
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/Page.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/Page.java
index fdb5292..b4ab9e7 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/Page.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/Page.java
@@ -1,5 +1,6 @@
package cc.polyfrost.oneconfig.gui.pages;
+import cc.polyfrost.oneconfig.gui.OneConfigGui;
import cc.polyfrost.oneconfig.lwjgl.scissor.Scissor;
import cc.polyfrost.oneconfig.lwjgl.scissor.ScissorManager;
import cc.polyfrost.oneconfig.utils.MathUtils;
@@ -48,7 +49,7 @@ public abstract class Page {
if (scrollTarget > 0f) scrollTarget = 0f;
else if (scrollTarget < -maxScroll + 728) scrollTarget = -maxScroll + 728;
- currentScroll = MathUtils.easeOut(currentScroll, scrollTarget, 50f);
+ currentScroll = MathUtils.easeOut(currentScroll, scrollTarget, 50f, OneConfigGui.INSTANCE.getDeltaTime());
ScissorManager.resetScissor(vg, scissor);
}