diff options
author | Vixid <52578495+Vixid1@users.noreply.github.com> | 2022-10-21 02:11:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-20 21:11:40 -0400 |
commit | 549d95150c664c581a04ca11a90c169cd98f735d (patch) | |
tree | c1797738c59dbc66f4fe317ef54eab103a299277 /src/main/java | |
parent | 877878bc802d7f09841aed6d6de2f60dbab48f6d (diff) | |
download | NotEnoughUpdates-549d95150c664c581a04ca11a90c169cd98f735d.tar.gz NotEnoughUpdates-549d95150c664c581a04ca11a90c169cd98f735d.tar.bz2 NotEnoughUpdates-549d95150c664c581a04ca11a90c169cd98f735d.zip |
Trophy Fish Total Count (#338)
* Added trophy fish total count to each trophy fish. Also formatted the numbers for readability.
* Removed double brackets.
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java index cda47ffd..7fc9bd0d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java @@ -26,6 +26,14 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewerPage; import io.github.moulberry.notenoughupdates.util.Utils; + +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; @@ -121,6 +129,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { } }; private static final ResourceLocation TROPHY_FISH_TEXTURE = new ResourceLocation("notenoughupdates:pv_trophy_fish_tab.png"); + private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(Locale.US); private static final String checkX = "§c✖"; private static final String check = "§a✔"; private final Map<String, Integer> total = new HashMap<>(); @@ -357,6 +366,8 @@ public class TrophyFishPage extends GuiProfileViewerPage { tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.GOLD, EnumChatFormatting.GOLD)); tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.SILVER, EnumChatFormatting.GRAY)); tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.BRONZE, EnumChatFormatting.DARK_GRAY)); + tooltip.add(" "); + tooltip.add(EnumChatFormatting.GRAY + "Total: " + EnumChatFormatting.GOLD + NUMBER_FORMAT.format(trophyFishList.get(name).getTotal())); return tooltip; } @@ -371,7 +382,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { } if (trophyFishRarityIntegerMap.containsKey(rarity)) { - return color + name + ": " + EnumChatFormatting.GOLD + trophyFishRarityIntegerMap.get(rarity); + return color + name + ": " + EnumChatFormatting.GOLD + NUMBER_FORMAT.format(trophyFishRarityIntegerMap.get(rarity)); } else { return color + name + ": " + checkX; } |