aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
diff options
context:
space:
mode:
authorefefury <69400149+efefury@users.noreply.github.com>2023-01-31 22:04:33 +0000
committerGitHub <noreply@github.com>2023-01-31 23:04:33 +0100
commit7d34b5456f9978d063b9098ab095256109d522c2 (patch)
tree3752f4adb11ef6bf77c017102343121141e3571b /src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
parent291860435d5487562b122aaddbe57c178a8734de (diff)
downloadnotenoughupdates-7d34b5456f9978d063b9098ab095256109d522c2.tar.gz
notenoughupdates-7d34b5456f9978d063b9098ab095256109d522c2.tar.bz2
notenoughupdates-7d34b5456f9978d063b9098ab095256109d522c2.zip
Levels page in Profile Viewer (#562)
* ughidontwannafigureouthowtousethis * not finished hgdt< * Make use of new collections api in collectionspage * final commit HOPEFULLY * fix infer v1 * fix mithril powder going over cap my beloved * Formatting :thumbsup: * More Formatting :thumbsup: important * ea sports its in the game * maybe fix cache * change location of weight and networth and config option for weght requested by alea * Fix jump at CAP powder * Code formatting and deleted unused variables. * Used KUUDRA_TIERS array from CrimsonIslePage in SlayingTaskLevel. * Used SLAYERS array from PROFILEVIEWER in SlayingTaskLevel. * Intellij Code Cleanup. * revert fun things Please efe put formatting in another PR. * fix issues idk * Import fixes and formatting. And an unnecessary empty space in 2.1.1 for jani. * fix nea issue --------- Co-authored-by: nea <nea@nea.moe> Co-authored-by: jani270 <jani270@gmx.de> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java79
1 files changed, 72 insertions, 7 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
index 571a43f9..952eb50f 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java
@@ -28,6 +28,7 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking;
+import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
@@ -569,6 +570,70 @@ public class Utils {
drawTexturedRect(x, y, width, height, 0, 1, 0, 1);
}
+ public static void drawPvSideButton(
+ int yIndex,
+ ItemStack itemStack,
+ boolean pressed,
+ GuiProfileViewer guiProfileViewer
+ ) {
+ int guiLeft = GuiProfileViewer.getGuiLeft();
+ int guiTop = GuiProfileViewer.getGuiTop();
+
+ GlStateManager.disableLighting();
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.enableAlpha();
+ GlStateManager.alphaFunc(516, 0.1F);
+
+ int x = guiLeft - 28;
+ int y = guiTop + yIndex * 28;
+
+ float uMin = 193 / 256f;
+ float uMax = 223 / 256f;
+ float vMin = 200 / 256f;
+ float vMax = 228 / 256f;
+ if (pressed) {
+ uMin = 224 / 256f;
+ uMax = 1f;
+
+ if (yIndex != 0) {
+ vMin = 228 / 256f;
+ vMax = 1f;
+ }
+
+ guiProfileViewer.renderBlurredBackground(
+ guiProfileViewer.width,
+ guiProfileViewer.height,
+ x + 2,
+ y + 2,
+ 30,
+ 28 - 4
+ );
+ } else {
+ guiProfileViewer.renderBlurredBackground(
+ guiProfileViewer.width,
+ guiProfileViewer.height,
+ x + 2,
+ y + 2,
+ 28 - 2,
+ 28 - 4
+ );
+ }
+
+ GlStateManager.disableLighting();
+ GlStateManager.enableBlend();
+ GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GlStateManager.enableAlpha();
+ GlStateManager.alphaFunc(516, 0.1F);
+
+ Minecraft.getMinecraft().getTextureManager().bindTexture(GuiProfileViewer.pv_elements);
+
+ Utils.drawTexturedRect(x, y, pressed ? 32 : 28, 28, uMin, uMax, vMin, vMax, GL11.GL_NEAREST);
+
+ GlStateManager.enableDepth();
+ Utils.drawItemStack(itemStack, x + 8, y + 7);
+ }
+
public static void drawTexturedRect(float x, float y, float width, float height, int filter) {
drawTexturedRect(x, y, width, height, 0, 1, 0, 1, filter);
}
@@ -1961,13 +2026,13 @@ public class Utils {
if (NotEnoughUpdates.INSTANCE.config.notifications.outdatedRepo) {
NotificationHandler.displayNotification(Lists.newArrayList(
EnumChatFormatting.RED + EnumChatFormatting.BOLD.toString() + "Missing repo data",
- EnumChatFormatting.RED +
- "Data used for many NEU features is not up to date, this should normally not be the case.",
- EnumChatFormatting.RED + "You can try " + EnumChatFormatting.BOLD + "/neuresetrepo" + EnumChatFormatting.RESET +
- EnumChatFormatting.RED + " and restart your game" +
- " to see if that fixes the issue.",
- EnumChatFormatting.RED + "If the problem persists please join " + EnumChatFormatting.BOLD +
- "discord.gg/moulberry" +
+ EnumChatFormatting.RED +
+ "Data used for many NEU features is not up to date, this should normally not be the case.",
+ EnumChatFormatting.RED + "You can try " + EnumChatFormatting.BOLD + "/neuresetrepo" + EnumChatFormatting.RESET +
+ EnumChatFormatting.RED + " and restart your game" +
+ " to see if that fixes the issue.",
+ EnumChatFormatting.RED + "If the problem persists please join " + EnumChatFormatting.BOLD +
+ "discord.gg/moulberry" +
EnumChatFormatting.RESET + EnumChatFormatting.RED + " and message in " + EnumChatFormatting.BOLD +
"#neu-support" + EnumChatFormatting.RESET + EnumChatFormatting.RED + " to get support"
),