From 5cf69eba548d281cfa31dfe8a0430c00762d4525 Mon Sep 17 00:00:00 2001 From: jediexe Date: Mon, 21 Aug 2023 12:21:01 -0400 Subject: [PATCH] 2.4.5 fixed sky flickering sometimes when hovering over pouch made pouch tooltip not clip through the bottom of the screen redid logic for the side of the screen clipping because I forgot forge adds the mod name under the tooltip which is really long for the lotr mod --- .gitignore | 28 +++++++++++++++++++ gradle.properties | 2 +- .../java/com/jediexe/pouchviewer/Main.java | 2 +- .../com/jediexe/pouchviewer/Pouchviewer.java | 15 +++++++--- src/main/resources/mcmod.info | 2 +- 5 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..73b38e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +# mac os +.DS_Store + +# forge / gradle +.gradle +build/ +out/ +classes/ +run/ + +# eclipse +*.launch +.settings +.classpath +.project +eclipse + +.idea/ +*.iml +*.ipr +*.iws + +# vscode + +.settings/ +.vscode/ +bin/ +.classpath diff --git a/gradle.properties b/gradle.properties index 6640380..1914ba0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Mod properties -version=2.4.4 +version=2.4.5 # http://maven.apache.org/guides/mini/guide-naming-conventions.html group=com.jediexe.pouchviewer diff --git a/src/main/java/com/jediexe/pouchviewer/Main.java b/src/main/java/com/jediexe/pouchviewer/Main.java index d5c34f4..58fd156 100644 --- a/src/main/java/com/jediexe/pouchviewer/Main.java +++ b/src/main/java/com/jediexe/pouchviewer/Main.java @@ -22,7 +22,7 @@ public class Main{ public static final String NAME = "LOTR Pouch Viewer"; public static final String MODID = "pouchviewer"; - public static final String VERSION = "2.4.4"; + public static final String VERSION = "2.4.5"; public static Configuration config = new Configuration(new File("config/lotrpouchviewer.cfg")); public static List Categories; diff --git a/src/main/java/com/jediexe/pouchviewer/Pouchviewer.java b/src/main/java/com/jediexe/pouchviewer/Pouchviewer.java index a13544f..a0403f3 100644 --- a/src/main/java/com/jediexe/pouchviewer/Pouchviewer.java +++ b/src/main/java/com/jediexe/pouchviewer/Pouchviewer.java @@ -82,7 +82,7 @@ public void onTooltipGen(ItemTooltipEvent event) { } event.toolTip.remove(event.toolTip.size()-1); event.toolTip.add(" "); - event.toolTip.add(" "); + event.toolTip.add(" "); } } } @@ -115,8 +115,12 @@ public static void draw() { int sh = sr.getScaledHeight(); int mx = Mouse.getX() * sw / Minecraft.getMinecraft().displayWidth; int my = sh - Mouse.getY() * sh / Minecraft.getMinecraft().displayHeight; - if (mx+172>sw) mx=mx-188; + mx+=2; + if (mx+174>sw) mx=mx-192; if (Main.showEmptySlots) { + if (my+66>sh && count==27) my=sh-66; + if (my+48>sh && count==18) my=sh-48; + if (my+30>sh && count==9) my=sh-30; if (count==9) drawBackground(mx+11,my, 7, 97, 162, 18); if (count==18) drawBackground(mx+11,my, 7, 97, 162, 36); if (count==27) drawBackground(mx+11,my, 7, 97, 162, 54); @@ -194,6 +198,9 @@ public static void draw() { } } else { + if (my+66>sh && usedslots>18) my=sh-66; + if (my+48>sh && usedslots>9 && usedslots<=18) my=sh-48; + if (my+30>sh && usedslots<=9) my=sh-30; if (usedslots<=9) drawBackground(mx+11,my, 7, 97, 162, 18); if (usedslots>9) drawBackground(mx+11,my, 7, 97, 162, 36); if (usedslots>18) drawBackground(mx+11,my, 7, 97, 162, 54); @@ -341,7 +348,7 @@ public static void drawBackground(int x, int y, int a, int b, int aa, int bb) { GL11.glDisable(2929); gui.drawTexturedModalRect(x, y-1, a, b, aa, bb); GL11.glEnable(2929); - RenderHelper.enableStandardItemLighting(); + RenderHelper.enableStandardItemLighting(); } public static void drawText(String text, int x, int y) { @@ -349,6 +356,6 @@ public static void drawText(String text, int x, int y) { GL11.glDisable(2929); Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(text, x, y, 0xffffff); GL11.glEnable(2929); - RenderHelper.enableStandardItemLighting(); + RenderHelper.enableStandardItemLighting(); } } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 1f58965..500f1db 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "pouchviewer", "name": "LOTR Pouch Viewer", "description": "LOTR mod addon to view pouch contents on hover.", - "version": "2.4.4", + "version": "2.4.5", "mcversion": "${mcversion}", "url": "", "updateUrl": "",