aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2022-09-11 22:11:26 +1000
committerGitHub <noreply@github.com>2022-09-11 14:11:26 +0200
commitef557a6f4dff5ed9ce13f26f41b55c60008e8eae (patch)
tree9a7cf79bf899680e67fbc767c2fa5965fa2ecd39 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
parent47af0b3eee70a5c8d7c86fff19155a97a9204708 (diff)
downloadnotenoughupdates-ef557a6f4dff5ed9ce13f26f41b55c60008e8eae.tar.gz
notenoughupdates-ef557a6f4dff5ed9ce13f26f41b55c60008e8eae.tar.bz2
notenoughupdates-ef557a6f4dff5ed9ce13f26f41b55c60008e8eae.zip
fixed backpacks when dont have fairy soul req (#264)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java45
1 files changed, 35 insertions, 10 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
index 0f9d1b4a..8576f141 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
@@ -61,6 +61,7 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.text.NumberFormat;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@@ -749,6 +750,30 @@ public class GuiProfileViewer extends GuiScreen {
lastTime = currentTime;
+ if (currentPage != ProfileViewerPage.LOADING && currentPage != ProfileViewerPage.INVALID_NAME) {
+ int ignoredTabs = 0;
+ List<Integer> configList = NotEnoughUpdates.INSTANCE.config.profileViewer.pageLayout;
+ for (int i = 0; i < configList.size(); i++) {
+ ProfileViewerPage iPage = ProfileViewerPage.getById(configList.get(i));
+ if (iPage == null) continue;
+ if (iPage.stack == null || (iPage == ProfileViewerPage.BINGO && !showBingoPage)) {
+ ignoredTabs++;
+ continue;
+ }
+ int i2 = i - ignoredTabs;
+ int x = guiLeft + i2 * 28;
+ int y = guiTop - 28;
+
+ if (mouseX > x && mouseX < x + 28) {
+ if (mouseY > y && mouseY < y + 32) {
+ tooltipToDisplay = Collections.singletonList(iPage.stack
+ .getTooltip(Minecraft.getMinecraft().thePlayer, false)
+ .get(0));
+ }
+ }
+ }
+ }
+
if (tooltipToDisplay != null) {
List<String> grayTooltip = new ArrayList<>(tooltipToDisplay.size());
for (String line : tooltipToDisplay) {
@@ -1232,16 +1257,16 @@ public class GuiProfileViewer extends GuiScreen {
LOADING(),
INVALID_NAME(),
NO_SKYBLOCK(),
- BASIC(0, Items.paper, "Your Skills"),
- DUNGEON(1, Item.getItemFromBlock(Blocks.deadbush), "Dungeoneering"),
- EXTRA(2, Items.book, "Profile Stats"),
- INVENTORIES(3, Item.getItemFromBlock(Blocks.ender_chest), "Storage"),
- COLLECTIONS(4, Items.painting, "Collections"),
- PETS(5, Items.bone, "Pets"),
- MINING(6, Items.iron_pickaxe, "Heart of the Mountain"),
- BINGO(7, Items.filled_map, "Bingo"),
- TROPHY_FISH(8, Items.fishing_rod, "Trophy Fish"),
- BESTIARY(9, Items.iron_sword, "Bestiary");
+ BASIC(0, Items.paper, "§9Your Skills"),
+ DUNGEON(1, Item.getItemFromBlock(Blocks.deadbush), "§eDungeoneering"),
+ EXTRA(2, Items.book, "§7Profile Stats"),
+ INVENTORIES(3, Item.getItemFromBlock(Blocks.ender_chest), "§bStorage"),
+ COLLECTIONS(4, Items.painting, "§6Collections"),
+ PETS(5, Items.bone, "§aPets"),
+ MINING(6, Items.iron_pickaxe, "§5Heart of the Mountain"),
+ BINGO(7, Items.filled_map, "§zBingo"),
+ TROPHY_FISH(8, Items.fishing_rod, "§3Trophy Fish"),
+ BESTIARY(9, Items.iron_sword, "§cBestiary");
public final ItemStack stack;
public final int id;