From 69b2de53866b665a5b63c08afd3d92c0d068e812 Mon Sep 17 00:00:00 2001 From: GodOfPro <59516901+GodOfProDev@users.noreply.github.com> Date: Sun, 20 Nov 2022 14:02:47 +0330 Subject: Added Senither Weight Leaderboard Position (#436) Co-authored-by: nopo --- .../notenoughupdates/profileviewer/BasicPage.java | 31 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java index 97db29cf..30ac269b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java @@ -306,13 +306,12 @@ public class BasicPage extends GuiProfileViewerPage { if (NotEnoughUpdates.INSTANCE.config.profileViewer.useSoopyNetworth && profile.getSoopyNetworthLeaderboardPosition() >= 0 - && profile.isProfileMaxSoopyNetworth(profileId)) { + && profile.isProfileMaxSoopyWeight(profile, profileId)) { String lbPosStr = EnumChatFormatting.DARK_GREEN + "#" + EnumChatFormatting.GOLD + GuiProfileViewer.numberFormat.format( profile.getSoopyNetworthLeaderboardPosition()); - getInstance().tooltipToDisplay.add(lbPosStr + EnumChatFormatting.GREEN + " on the networth leaderboard!"); - getInstance().tooltipToDisplay.add(""); + getInstance().tooltipToDisplay.add(lbPosStr + EnumChatFormatting.GREEN + " on soopy's networth leaderboard!"); } if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { @@ -809,6 +808,9 @@ public class BasicPage extends GuiProfileViewerPage { return; } + ProfileViewer.Profile profile = GuiProfileViewer.getProfile(); + String profileId = GuiProfileViewer.getProfileId(); + if (Constants.WEIGHT == null || Utils.getElement(Constants.WEIGHT, "lily.skills.overall") == null || !Utils.getElement(Constants.WEIGHT, "lily.skills.overall").isJsonPrimitive()) { Utils.showOutdatedRepoNotification(); @@ -822,6 +824,12 @@ public class BasicPage extends GuiProfileViewerPage { SenitherWeight senitherWeight = new SenitherWeight(skyblockInfo); LilyWeight lilyWeight = new LilyWeight(skyblockInfo, profileInfo); + long weight = -2L; + if (NotEnoughUpdates.INSTANCE.config.profileViewer.useSoopyNetworth) { + weight = profile.getSoopyWeightLeaderboardPosition(); + } + + Utils.drawStringCentered( EnumChatFormatting.GREEN + "Senither Weight: " + @@ -870,6 +878,23 @@ public class BasicPage extends GuiProfileViewerPage { roundToNearestInt(senitherWeight.getDungeonsWeight().getWeightStruct().getRaw()) ) ); + + if (NotEnoughUpdates.INSTANCE.config.profileViewer.useSoopyNetworth + && profile.isProfileMaxSoopyWeight(profile, profileId)) { + + String lbPosStr = + EnumChatFormatting.DARK_GREEN + "#" + EnumChatFormatting.GOLD + GuiProfileViewer.numberFormat.format( + profile.getSoopyWeightLeaderboardPosition()); + getInstance().tooltipToDisplay.add(""); + String stateStr = EnumChatFormatting.RED + "An error occured"; + if (weight == -2) { + stateStr = EnumChatFormatting.YELLOW + "Loading"; + } + if (weight > 0) + getInstance().tooltipToDisplay.add(lbPosStr + EnumChatFormatting.GREEN + " on soopy's weight leaderboard!"); + else + getInstance().tooltipToDisplay.add(stateStr + " soopy's weight leaderboard"); + } } } -- cgit