diff options
| author | Lulonaut <lulonaut@lulonaut.dev> | 2024-07-31 16:34:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-31 16:34:14 +0200 |
| commit | 508e4450fd7d84b42dcb72c5eb06f65347e56adf (patch) | |
| tree | 00436ba7a142afafb3fe4977d82bfba9a7923402 | |
| parent | 4dd6977ffda1256e269f70644a6eb88276980869 (diff) | |
| download | notenoughupdates-508e4450fd7d84b42dcb72c5eb06f65347e56adf.tar.gz notenoughupdates-508e4450fd7d84b42dcb72c5eb06f65347e56adf.tar.bz2 notenoughupdates-508e4450fd7d84b42dcb72c5eb06f65347e56adf.zip | |
Add percentage progress to next skill level in pv (#1281)
Show the percentage progress to the next skill level in pv
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java | 9 |
1 files changed, 7 insertions, 2 deletions
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 6c43f14b..adb3ce4c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java @@ -723,14 +723,19 @@ public class BasicPage extends GuiProfileViewerPage { EnumChatFormatting.GRAY + "Progress: " + EnumChatFormatting.GOLD + "MAXED!"); } else { int maxXp = (int) level.maxXpForLevel; + float currentXp = ((level.level % 1) * maxXp); + String currentProgressPercentage = StringUtils.formatToTenths((currentXp / maxXp) * 100); + getInstance() .tooltipToDisplay.add( EnumChatFormatting.GRAY + "Progress: " + EnumChatFormatting.DARK_PURPLE + - StringUtils.shortNumberFormat(Math.round((level.level % 1) * maxXp)) + + StringUtils.shortNumberFormat(Math.round(currentXp)) + "/" + - StringUtils.shortNumberFormat(maxXp)); + StringUtils.shortNumberFormat(maxXp) + + EnumChatFormatting.DARK_GRAY + " (" + currentProgressPercentage + "% to " + + ((int) level.level + 1) + ")"); } String totalXpS = StringUtils.formatNumber((long) level.totalXp); tooltipToDisplay.add(EnumChatFormatting.GRAY + "Total XP: " + EnumChatFormatting.DARK_PURPLE + totalXpS + |
