From 2bb3cb42e890a80205928d19fef6538860f142fe Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Thu, 22 Dec 2022 19:36:42 +0100 Subject: Merge pull request #502 * maxed stats are green --- .../notenoughupdates/profileviewer/ExtraPage.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') 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 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); } } -- cgit