aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2022-12-22 19:36:42 +0100
committerGitHub <noreply@github.com>2022-12-22 19:36:42 +0100
commit2bb3cb42e890a80205928d19fef6538860f142fe (patch)
tree74e1af3efe3840991ff5ff5d868d66033f33d9da
parent0aefc9b967c1cdcc61e46dc822995e2f507838ab (diff)
downloadNotEnoughUpdates-2bb3cb42e890a80205928d19fef6538860f142fe.tar.gz
NotEnoughUpdates-2bb3cb42e890a80205928d19fef6538860f142fe.tar.bz2
NotEnoughUpdates-2bb3cb42e890a80205928d19fef6538860f142fe.zip
Merge pull request #502
* maxed stats are green
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java14
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);
}
}