Skip to content

Commit

Permalink
2.4.5
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jediexe committed Aug 21, 2023
1 parent ce8cf0e commit 5cf69eb
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/jediexe/pouchviewer/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConfigCategory> Categories;
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/com/jediexe/pouchviewer/Pouchviewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(" ");
}
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -341,14 +348,14 @@ 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) {
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2929);
Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(text, x, y, 0xffffff);
GL11.glEnable(2929);
RenderHelper.enableStandardItemLighting();
RenderHelper.enableStandardItemLighting();
}
}
2 changes: 1 addition & 1 deletion src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down

0 comments on commit 5cf69eb

Please sign in to comment.