aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/test
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-05-14 00:59:25 -0700
committerGitHub <noreply@github.com>2022-05-14 09:59:25 +0200
commit2c592090b9448203559e01326bc2c2d995b15d53 (patch)
tree821d347aefc828c214d817c8b7be8cf3c0b0ea9f /src/main/java/cc/polyfrost/oneconfig/test
parent4b8f98aa1435817c13e7083e30896ef8b5cbdaf0 (diff)
downloadOneConfig-2c592090b9448203559e01326bc2c2d995b15d53.tar.gz
OneConfig-2c592090b9448203559e01326bc2c2d995b15d53.tar.bz2
OneConfig-2c592090b9448203559e01326bc2c2d995b15d53.zip
de-minecraftify a lot of things + use mixin instead of reflection (#11)
* de-minecraftify * use mixin instead of reflection * lol
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/test')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/test/TestHud.java3
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui.java27
2 files changed, 16 insertions, 14 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java b/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java
index 80f3bbc..c4349e8 100644
--- a/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java
+++ b/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java
@@ -2,6 +2,7 @@ package cc.polyfrost.oneconfig.test;
import cc.polyfrost.oneconfig.hud.BasicHud;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
+import gg.essential.universal.UMinecraft;
import net.minecraft.client.Minecraft;
public class TestHud extends BasicHud {
@@ -11,7 +12,7 @@ public class TestHud extends BasicHud {
@Override
public int getWidth(float scale) {
- return (int) (Minecraft.getMinecraft().fontRendererObj.getStringWidth("FPS: " + Minecraft.getDebugFPS()) * scale);
+ return (int) (UMinecraft.getFontRenderer().getStringWidth("FPS: " + Minecraft.getDebugFPS()) * scale);
}
@Override
diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui.java b/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui.java
index 60cfe2f..dac7e12 100644
--- a/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui.java
+++ b/src/main/java/cc/polyfrost/oneconfig/test/TestNanoVGGui.java
@@ -1,26 +1,27 @@
package cc.polyfrost.oneconfig.test;
import cc.polyfrost.oneconfig.lwjgl.RenderManager;
-import net.minecraft.client.gui.GuiScreen;
+import cc.polyfrost.oneconfig.lwjgl.font.Fonts;
+import gg.essential.universal.UMatrixStack;
+import gg.essential.universal.UScreen;
+import org.jetbrains.annotations.NotNull;
import java.awt.*;
-public class TestNanoVGGui extends GuiScreen {
+public class TestNanoVGGui extends UScreen {
@Override
- public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- super.drawScreen(mouseX, mouseY, partialTicks);
+ public void onDrawScreen(@NotNull UMatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
+ super.onDrawScreen(matrixStack, mouseX, mouseY, partialTicks);
drawRect(0, 0, width, height, Color.BLACK.getRGB());
long startTime = System.nanoTime();
RenderManager.setupAndDraw((vg) -> {
- //RenderManager.drawRect(vg, 0, 0, 100, 100, Color.BLUE.getRGB());
- //RenderManager.drawRoundedRect(vg, 305, 305, 100, 100, Color.YELLOW.getRGB(), 8);
- //RenderManager.drawString(vg, "Hello!", 80, 20, Color.WHITE.getRGB(), 50, Fonts.MC_REGULAR);
- //RenderManager.drawString(vg, "Hello!", 100, 100, Color.WHITE.getRGB(), 50, Fonts.INTER_BOLD);
- //RenderManager.drawLine(vg, 0, 0, 100, 100, 7, Color.PINK.getRGB());
- //RenderManager.drawCircle(vg, 200, 200, 50, Color.WHITE.getRGB());
- //RenderManager.drawString(vg, (float) (System.nanoTime() - startTime) / 1000000f + "ms", 500, 500, Color.WHITE.getRGB(), 100, Fonts.INTER_BOLD);
+ RenderManager.drawRect(vg, 0, 0, 100, 100, Color.BLUE.getRGB());
+ RenderManager.drawRoundedRect(vg, 305, 305, 100, 100, Color.YELLOW.getRGB(), 8);
+ RenderManager.drawString(vg, "Hello!", 100, 100, Color.WHITE.getRGB(), 50, Fonts.BOLD);
+ RenderManager.drawLine(vg, 0, 0, 100, 100, 7, Color.PINK.getRGB());
+ RenderManager.drawCircle(vg, 200, 200, 50, Color.WHITE.getRGB());
+ RenderManager.drawString(vg, (float) (System.nanoTime() - startTime) / 1000000f + "ms", 500, 500, Color.WHITE.getRGB(), 100, Fonts.BOLD);
});
- drawString(fontRendererObj, "Hello!", 0, 0, -1);
- } // hi
+ }
}