diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2022-12-22 19:36:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-22 19:36:42 +0100 |
commit | 2bb3cb42e890a80205928d19fef6538860f142fe (patch) | |
tree | 74e1af3efe3840991ff5ff5d868d66033f33d9da /src/main/java/io | |
parent | 0aefc9b967c1cdcc61e46dc822995e2f507838ab (diff) | |
download | NotEnoughUpdates-2bb3cb42e890a80205928d19fef6538860f142fe.tar.gz NotEnoughUpdates-2bb3cb42e890a80205928d19fef6538860f142fe.tar.bz2 NotEnoughUpdates-2bb3cb42e890a80205928d19fef6538860f142fe.zip |
Merge pull request #502
* maxed stats are green
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java index 5f477196..4c58e57a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java @@ -156,11 +156,15 @@ public class ExtraPage extends GuiProfileViewerPage { for (Map.Entry<String, JsonElement> entry : essenceShops.get(essenceName).getAsJsonObject().entrySet()) { int perkTier = - (profileInfo.has("perks") && profileInfo.get("perks").getAsJsonObject().has(entry.getKey()) ? profileInfo.get("perks").getAsJsonObject().get(entry.getKey()).getAsInt() : 0); - getInstance().tooltipToDisplay.add( - EnumChatFormatting.GOLD + entry.getValue().getAsJsonObject().get("name").getAsString() + ": " + EnumChatFormatting.AQUA + - perkTier + "/" + entry.getValue().getAsJsonObject().get("costs").getAsJsonArray().size() - ); + (profileInfo.has("perks") && profileInfo.get("perks").getAsJsonObject().has(entry.getKey()) ? profileInfo + .get("perks") + .getAsJsonObject() + .get(entry.getKey()) + .getAsInt() : 0); + int max = entry.getValue().getAsJsonObject().get("costs").getAsJsonArray().size(); + EnumChatFormatting formatting = perkTier == max ? EnumChatFormatting.GREEN : EnumChatFormatting.AQUA; + String name = entry.getValue().getAsJsonObject().get("name").getAsString(); + getInstance().tooltipToDisplay.add(EnumChatFormatting.GOLD + name + ": " + formatting + perkTier + "/" + max); } } |