aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVixid <52578495+Vixid1@users.noreply.github.com>2022-10-30 10:27:15 +0000
committerGitHub <noreply@github.com>2022-10-30 21:27:15 +1100
commit5697b510ee9e397c71439f7960c671e1b7641f34 (patch)
tree6ebde4fa5ec5daa30c36388a2ccd669240b03849
parente4033c2dad92fedb7feb7cfdd205aa6290e4294b (diff)
downloadNotEnoughUpdates-5697b510ee9e397c71439f7960c671e1b7641f34.tar.gz
NotEnoughUpdates-5697b510ee9e397c71439f7960c671e1b7641f34.tar.bz2
NotEnoughUpdates-5697b510ee9e397c71439f7960c671e1b7641f34.zip
Support for cata 50+ and class average. (#349)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java29
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java26
2 files changed, 45 insertions, 10 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java
index 6d59db27..cbebb6f4 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java
@@ -223,6 +223,7 @@ public class DungeonPage extends GuiProfileViewerPage {
getInstance().tooltipToDisplay =
Lists.newArrayList(
+ EnumChatFormatting.YELLOW + "Remaining XP: " + EnumChatFormatting.GRAY + String.format("%,d", floorLevelToXP),
String.format("# F5 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpF5), runsF5),
String.format("# F6 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpF6), runsF6),
String.format("# F7 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpF7), runsF7),
@@ -370,6 +371,7 @@ public class DungeonPage extends GuiProfileViewerPage {
getInstance().tooltipToDisplay =
Lists.newArrayList(
+ EnumChatFormatting.YELLOW + "Remaining XP: " + EnumChatFormatting.GRAY + String.format("%,d", floorLevelToXP),
String.format("# M3 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpM3), runsM3),
String.format("# M4 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpM4), runsM4),
String.format("# M5 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpM5), runsM5),
@@ -668,6 +670,8 @@ public class DungeonPage extends GuiProfileViewerPage {
activeClass = activeClassElement.getAsString();
}
+ ProfileViewer.Level classAverage = new ProfileViewer.Level();
+
for (int i = 0; i < dungSkillsName.length; i++) {
String skillName = dungSkillsName[i];
@@ -683,9 +687,19 @@ public class DungeonPage extends GuiProfileViewerPage {
50,
false
);
+
+ if (levelObj.level == 50) {
+ levelObj.level = 50 + (cataXp - 569809640) / 200000000;
+ }
+
levelObjClasses.put(skillName, levelObj);
}
+ classAverage.level = (float) (levelObjClasses.values().stream().mapToDouble(l -> l.level).sum() / 5);
+ if (classAverage.level >= 50) {
+ classAverage.maxed = true;
+ }
+
String colour = EnumChatFormatting.WHITE.toString();
if (skillName.toLowerCase().equals(activeClass)) {
colour = EnumChatFormatting.GREEN.toString();
@@ -694,8 +708,17 @@ public class DungeonPage extends GuiProfileViewerPage {
ProfileViewer.Level levelObj = levelObjClasses.get(skillName);
getInstance()
- .renderXpBar(colour + skillName, dungSkillsStack[i], x, y + 20 + 29 * i, sectionWidth, levelObj, mouseX, mouseY);
+ .renderXpBar(colour + skillName, dungSkillsStack[i], x, y + 20 + 24 * i, sectionWidth, levelObj, mouseX, mouseY);
}
+
+ getInstance().renderXpBar(
+ EnumChatFormatting.WHITE + "Class Average",
+ new ItemStack(Items.nether_star),
+ x,
+ y + 20 + 24 * 5,
+ sectionWidth,
+ classAverage,
+ mouseX, mouseY);
}
drawSideButtons();
@@ -707,7 +730,7 @@ public class DungeonPage extends GuiProfileViewerPage {
int guiLeft = GuiProfileViewer.getGuiLeft();
int guiTop = GuiProfileViewer.getGuiTop();
- if (mouseX >= guiLeft + 50 && mouseX <= guiLeft + 70 && mouseY >= guiTop + 54 && mouseY <= guiTop + 64) {
+ if (mouseX >= guiLeft + 45 && mouseX <= guiLeft + 65 && mouseY >= guiTop + 54 && mouseY <= guiTop + 64) {
dungeonLevelTextField.mouseClicked(mouseX, mouseY, mouseButton);
} else {
dungeonLevelTextField.otherComponentClick();
@@ -829,7 +852,7 @@ public class DungeonPage extends GuiProfileViewerPage {
if (level < Math.floor(levelObjCata.level)) {
continue;
}
- remaining += levelingArray.get(level).getAsFloat();
+ remaining += levelingArray.get(level).getAsFloat();
}
if (remaining < 0) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
index f327dae5..37605595 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
@@ -1039,15 +1039,27 @@ public class GuiProfileViewer extends GuiScreen {
numberFormat.format(levelObj.totalXp) + EnumChatFormatting.DARK_GRAY + " (" +
DECIMAL_FORMAT.format(getPercentage(skillName.toLowerCase(), levelObj)) + "% to 50)";
}
+ // Adds overflow level to each level object that is maxed, avoids hotm level as there is no overflow xp for it
if (levelObj.maxed) {
- levelStr = EnumChatFormatting.GOLD + "MAXED!";
+ levelStr = levelObj.maxLevel != 7 ?
+ EnumChatFormatting.GOLD + "MAXED!" + EnumChatFormatting.GRAY + " (Overflow level: " + String.format("%.2f", levelObj.level) + ")" :
+ EnumChatFormatting.GOLD + "MAXED!";
} else {
- int maxXp = (int) levelObj.maxXpForLevel;
- levelStr =
- EnumChatFormatting.DARK_PURPLE +
- StringUtils.shortNumberFormat(Math.round((level % 1) * maxXp)) +
- "/" +
- StringUtils.shortNumberFormat(maxXp);
+ if (skillName.contains("Class Average")) {
+ levelStr = "Progress: " + EnumChatFormatting.DARK_PURPLE + String.format("%.1f", (level % 1 * 100)) + "%";
+ totalXpStr = "Exact Class Average: " + EnumChatFormatting.WHITE + String.format("%.2f", levelObj.level);
+ } else {
+ int maxXp = (int) levelObj.maxXpForLevel;
+ levelStr =
+ EnumChatFormatting.DARK_PURPLE +
+ StringUtils.shortNumberFormat(Math.round((level % 1) * maxXp)) +
+ "/" +
+ StringUtils.shortNumberFormat(maxXp) +
+ // Since catacombs isn't considered 'maxed' at level 50 (since the cap is '99'), we can add
+ // a conditional here to add the overflow level rather than above
+ ((skillName.contains("Catacombs") && levelObj.level >= 50) ?
+ EnumChatFormatting.GRAY + " (Overflow level: " + String.format("%.2f", levelObj.level) + ")" : "");
+ }
}
if (totalXpStr != null) {
tooltipToDisplay = Utils.createList(levelStr, totalXpStr);