aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/collectionlog
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-27 11:53:57 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-27 11:53:57 -0500
commitb09f774d422263ce15b97d6d0804beddf856176d (patch)
treee542258481d7496b15679f3c329ef9e087c7d8fc /src/main/java/io/github/moulberry/notenoughupdates/collectionlog
parent22cb02adbeb24b7ec98f843bcaba99cebe3e4f03 (diff)
downloadnotenoughupdates-b09f774d422263ce15b97d6d0804beddf856176d.tar.gz
notenoughupdates-b09f774d422263ce15b97d6d0804beddf856176d.tar.bz2
notenoughupdates-b09f774d422263ce15b97d6d0804beddf856176d.zip
feat: improve formating :)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/collectionlog')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/collectionlog/CollectionConstant.java12
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java181
2 files changed, 102 insertions, 91 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/CollectionConstant.java b/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/CollectionConstant.java
index 6931ceea..e789e882 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/CollectionConstant.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/CollectionConstant.java
@@ -5,11 +5,11 @@ import java.util.List;
import java.util.regex.Pattern;
public class CollectionConstant {
- public static class DropEntry {
- public String type;
- public Pattern regex;
- public HashMap<String, String> items;
- }
+ public static class DropEntry {
+ public String type;
+ public Pattern regex;
+ public HashMap<String, String> items;
+ }
- public List<DropEntry> dropdata;
+ public List<DropEntry> dropdata;
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java b/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java
index 39e27d57..dac104c6 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java
@@ -12,89 +12,100 @@ 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 < top + colheight - 6; h += 24) {
- catIndex += 2;
-
- Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX);
- GlStateManager.color(1, 1, 1, 1);
- Utils.drawTexturedRect(left, h, 100, 24,
- 0, 100 / 512f, 187 / 512f, 211 / 512f, GL11.GL_NEAREST);
-
- fontRendererObj.drawString("Thing " + catIndex, left + 5, h + 2, 0xfff5aa00, true);
- fontRendererObj.drawString("Thing " + (catIndex + 1), left + 5, h + 14, 0xfff5aa00, true);
- }
- GlScissorStack.pop(scaledResolution);
-
- fontRendererObj.drawString("\u00a7lSuperior Dragon", left + 119, top + 8, 0xfff5aa00, true);
- fontRendererObj.drawString("Obtained: " + EnumChatFormatting.YELLOW + "3/5", left + 122, top + 23, 0xfff5aa00, true);
-
- String killCountText = "Kills: " + EnumChatFormatting.WHITE + "3";
- //int killCountLen = fontRendererObj.getStringWidth(killCountText);
- fontRendererObj.drawString(killCountText, left + 122, top + 68, 0xfff5aa00, true);
-
- Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX);
- GlStateManager.color(1, 1, 1, 1);
- Utils.drawTexturedRect(left + colwidth - 196, top, 196, colheight,
- (512 - 196) / 512f, 1, 0 / 512f, colheight / 512f, GL11.GL_NEAREST);
-
- GlStateManager.translate(0, 0, -1);
-
- for (int i = 0; i < 4; i++) {
- if (i != 0) {
- Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX);
- GlStateManager.color(1, 1, 1, 1);
- Utils.drawTexturedRect(left + i * 71, top - 21, 71, 25,
- 0, 71 / 512f, 211 / 512f, (211 + 25) / 512f, GL11.GL_NEAREST);
-
- Utils.drawStringCentered(cats[i], fontRendererObj, left + i * 71 + 71 / 2, top - 8, true, 0xfff5aa00);
- }
- }
-
- super.drawScreen(mouseX, mouseY, partialTicks);
- }
+ 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 < top + colheight - 6; h += 24) {
+ catIndex += 2;
+
+ Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX);
+ GlStateManager.color(1, 1, 1, 1);
+ Utils.drawTexturedRect(left, h, 100, 24,
+ 0, 100 / 512f, 187 / 512f, 211 / 512f, GL11.GL_NEAREST
+ );
+
+ fontRendererObj.drawString("Thing " + catIndex, left + 5, h + 2, 0xfff5aa00, true);
+ fontRendererObj.drawString("Thing " + (catIndex + 1), left + 5, h + 14, 0xfff5aa00, true);
+ }
+ GlScissorStack.pop(scaledResolution);
+
+ fontRendererObj.drawString("\u00a7lSuperior Dragon", left + 119, top + 8, 0xfff5aa00, true);
+ fontRendererObj.drawString(
+ "Obtained: " + EnumChatFormatting.YELLOW + "3/5",
+ left + 122,
+ top + 23,
+ 0xfff5aa00,
+ true
+ );
+
+ String killCountText = "Kills: " + EnumChatFormatting.WHITE + "3";
+ //int killCountLen = fontRendererObj.getStringWidth(killCountText);
+ fontRendererObj.drawString(killCountText, left + 122, top + 68, 0xfff5aa00, true);
+
+ Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX);
+ GlStateManager.color(1, 1, 1, 1);
+ Utils.drawTexturedRect(left + colwidth - 196, top, 196, colheight,
+ (512 - 196) / 512f, 1, 0 / 512f, colheight / 512f, GL11.GL_NEAREST
+ );
+
+ GlStateManager.translate(0, 0, -1);
+
+ for (int i = 0; i < 4; i++) {
+ if (i != 0) {
+ Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX);
+ GlStateManager.color(1, 1, 1, 1);
+ Utils.drawTexturedRect(left + i * 71, top - 21, 71, 25,
+ 0, 71 / 512f, 211 / 512f, (211 + 25) / 512f, GL11.GL_NEAREST
+ );
+
+ Utils.drawStringCentered(cats[i], fontRendererObj, left + i * 71 + 71 / 2, top - 8, true, 0xfff5aa00);
+ }
+ }
+
+ super.drawScreen(mouseX, mouseY, partialTicks);
+ }
}