From a1fa5a67caebf754a0fcc43168672823ede0db93 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 4 Jun 2021 01:18:28 +0800 Subject: merge is pain --- .../collectionlog/GuiCollectionLog.java | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java (limited to 'src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java b/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java new file mode 100644 index 00000000..a2c8bfa9 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java @@ -0,0 +1,103 @@ +package io.github.moulberry.notenoughupdates.collectionlog; + +import io.github.moulberry.notenoughupdates.core.BackgroundBlur; +import io.github.moulberry.notenoughupdates.core.GlScissorStack; +import io.github.moulberry.notenoughupdates.util.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class GuiCollectionLog extends GuiScreen { + + private static final ResourceLocation COLLECTION_LOG_TEX = new ResourceLocation("notenoughupdates:collectionlog.png"); + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + int width = scaledResolution.getScaledWidth(); + int height = scaledResolution.getScaledHeight(); + + int colwidth = 307; + int colheight = 187; + + int left = width/2 - colwidth/2; + int top = height/2 - colheight/2; + + BackgroundBlur.renderBlurredBackground(10, width, height, left, top, colwidth, colheight); + super.drawDefaultBackground(); + + Utils.drawStringCentered("\u00a7lCollection Log", fontRendererObj, width/2, top - 27, true, 0xfff5aa00); + + String[] cats = {"Bosses", "Dragons", "Slayer", "Dungeons"}; + + GlStateManager.enableDepth(); + + GlStateManager.translate(0, 0, 2); + for(int i=0; i<4; i++) { + if(i == 0) { + int offset = i == 0 ? 1 : 2; + + Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(left+i*71, top-21, 71, 25, + (71*offset)/512f, (71+71*offset)/512f, 211/512f, (211+25)/512f, GL11.GL_NEAREST); + + Utils.drawStringCentered(cats[i], fontRendererObj, left+i*71+71/2, top - 8, true, 0xfff5aa00); + } + } + + GlStateManager.translate(0, 0, -1); + Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(left, top, colwidth, colheight, + 0, colwidth/512f, 0, colheight/512f, GL11.GL_NEAREST); + + GlScissorStack.push(0, top+3, width, top+colheight-6, scaledResolution); + int catIndex = 0; + for(int h=top+3; h