diff options
author | nextdaydelivery <12willettsh@gmail.com> | 2022-02-12 13:02:02 +0000 |
---|---|---|
committer | nextdaydelivery <12willettsh@gmail.com> | 2022-02-12 13:02:02 +0000 |
commit | aba637fd14fbcbda7e036874d164ddba8236e739 (patch) | |
tree | 57fcded0100b95bb6f6c0cae86c142c57c46edb7 /src/main/java/io/polyfrost/oneconfig/gui/Window.java | |
parent | 2231da6af9982840fa9d3bd24c4333bdbbe19cc2 (diff) | |
download | OneConfig-aba637fd14fbcbda7e036874d164ddba8236e739.tar.gz OneConfig-aba637fd14fbcbda7e036874d164ddba8236e739.tar.bz2 OneConfig-aba637fd14fbcbda7e036874d164ddba8236e739.zip |
more theme stuff
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/gui/Window.java')
-rw-r--r-- | src/main/java/io/polyfrost/oneconfig/gui/Window.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/gui/Window.java b/src/main/java/io/polyfrost/oneconfig/gui/Window.java index ed4e0cd..c15356c 100644 --- a/src/main/java/io/polyfrost/oneconfig/gui/Window.java +++ b/src/main/java/io/polyfrost/oneconfig/gui/Window.java @@ -1,19 +1,20 @@ package io.polyfrost.oneconfig.gui; import io.polyfrost.oneconfig.renderer.Renderer; +import io.polyfrost.oneconfig.themes.Theme; +import io.polyfrost.oneconfig.themes.Themes; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.util.ResourceLocation; import java.awt.*; +import static io.polyfrost.oneconfig.renderer.Renderer.clamp; import static io.polyfrost.oneconfig.renderer.Renderer.easeOut; public class Window extends GuiScreen { - private static ResourceLocation location = new ResourceLocation("oneconfig", "textures/hudsettings128.png"); private float currentProgress = 0f; public static Window currentWindow; + private final Theme t = Themes.getActiveTheme(); public Window() { super.initGui(); @@ -26,15 +27,30 @@ public class Window extends GuiScreen { public void drawScreen(int mouseX, int mouseY, float partialTicks) { super.drawScreen(mouseX, mouseY, partialTicks); - currentProgress = easeOut(currentProgress, 1f); + currentProgress = clamp(easeOut(currentProgress, 1f)); int alphaVal = (int) (50 * currentProgress); - //drawGradientRect(0, 0, super.width, super.height, new Color(80, 80, 80, alphaVal).getRGB(), new Color(80, 80, 80, alphaVal + 10).getRGB()); + drawGradientRect(0, 0, super.width, super.height, new Color(80, 80, 80, alphaVal).getRGB(), new Color(80, 80, 80, alphaVal + 10).getRGB()); drawWindow(); } public void drawWindow() { - + Color testingColor = new Color(127, 144, 155, 255); + //System.out.println(testingColor.getRGB()); + int middleX = this.width / 2; + int middleY = this.height / 2; + int left = middleX - 600; + int right = (int) (left + 1200 * currentProgress); + int top = middleY - 350; + int bottom = (int) (top + 700 * currentProgress); + Gui.drawRect(left -1, top - 1, right + 1, bottom + 1, testingColor.getRGB()); + Gui.drawRect(left,top,right,bottom,t.getBaseColor().getRGB()); + + Gui.drawRect(left, top, right, top + 100, t.getTitleBarColor().getRGB()); + Gui.drawRect(left, top + 100, right, top + 101, testingColor.getRGB()); + + //ResourceLocation location = mc.getRenderManager().renderEngine.getDynamicTextureLocation("oneconfig",new DynamicTexture(ImageIO.read(t.getResource("assets/textures/icons/hudsettings128.png")))); + Renderer.drawScaledImage(t.getIcons(), left + 10, top + 10, 128, 1152); } public static Window getWindow() { |