aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorefefury <69400149+efefury@users.noreply.github.com>2022-01-01 22:56:14 +0100
committerGitHub <noreply@github.com>2022-01-02 08:56:14 +1100
commita2caf04c1e4a3a4f38d13c1c80db83f624c838d6 (patch)
treec5b67f71ac03004db4177ddb103b094c2986df38 /src/main/java/io
parentb0b0b7567ec0656c60f2f3e4730c0edace353fb7 (diff)
downloadNotEnoughUpdates-a2caf04c1e4a3a4f38d13c1c80db83f624c838d6.tar.gz
NotEnoughUpdates-a2caf04c1e4a3a4f38d13c1c80db83f624c838d6.tar.bz2
NotEnoughUpdates-a2caf04c1e4a3a4f38d13c1c80db83f624c838d6.zip
Added some things (#49)
Co-authored-by: Lulonaut <lulonaut@tutanota.de>
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java26
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java10
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java31
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java7
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java79
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java12
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java1
8 files changed, 148 insertions, 22 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
index 341fe9ea..99a48a36 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
@@ -33,6 +33,7 @@ import net.minecraft.event.ClickEvent;
import net.minecraft.init.Items;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
@@ -1356,6 +1357,23 @@ public class NEUEventListener {
int profitLossBIN = totalValue - chestCost;
+ boolean kismetUsed = false;
+ // checking for kismet
+ Slot slot = (eventGui.inventorySlots.getSlot(50));
+ if(slot.getHasStack()) {
+ String[] lore = NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(slot.getStack().getTagCompound());
+ for (String line : lore) {
+ if (line.contains("You already rerolled a chest!")) {
+ kismetUsed = true;
+ break;
+ }
+ }
+ }
+ int kismetPrice = neu.manager.auctionManager.getLowestBin("KISMET_FEATHER");
+ String kismetStr = EnumChatFormatting.RED + format.format(kismetPrice) + " coins";
+ if(neu.config.dungeons.useKismetOnDungeonProfit)
+ profitLossBIN = kismetUsed ? profitLossBIN-kismetPrice : profitLossBIN;
+
String profitPrefix = EnumChatFormatting.DARK_GREEN.toString();
String lossPrefix = EnumChatFormatting.RED.toString();
String prefix = profitLossBIN >= 0 ? profitPrefix : lossPrefix;
@@ -1384,16 +1402,20 @@ public class NEUEventListener {
Utils.renderAlignedString(valueStringBIN1, valueStringBIN2,
guiLeft + xSize + 4 + 10, guiTop + 14, 160);
+ if (neu.config.dungeons.useKismetOnDungeonProfit && kismetUsed) {
+ Utils.renderAlignedString(EnumChatFormatting.YELLOW + "Kismet Feather: ", kismetStr,
+ guiLeft + xSize + 4 + 10, guiTop + 24, 160);
+ }
if (totalValue >= 0) {
Utils.renderAlignedString(EnumChatFormatting.YELLOW + "Profit/Loss: ", plStringBIN,
- guiLeft + xSize + 4 + 10, guiTop + 24, 160);
+ guiLeft + xSize + 4 + 10, guiTop + (neu.config.dungeons.useKismetOnDungeonProfit ? (kismetUsed ? 34 : 24) : 24) , 160);
}
int index = 0;
for (Map.Entry<String, Float> entry : itemValues.entrySet()) {
Utils.renderAlignedString(entry.getKey(), prefix +
format.format(entry.getValue().intValue()),
- guiLeft + xSize + 4 + 10, guiTop + 29 + (++index) * 10, 160);
+ guiLeft + xSize + 4 + 10, guiTop + (neu.config.dungeons.useKismetOnDungeonProfit ? (kismetUsed ? 39 :29) : 29) + (++index) * 10, 160);
}
}
} catch (Exception e) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
index 1cb06c52..4bd65acd 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
@@ -437,6 +437,10 @@ public class NEUConfig extends Config {
put("Sapphire", 0);
put("Topaz", 0);
}};
+ @Expose
+ public long dailyGemstonePowderCompleted = 0L;
+ @Expose
+ public long dailyMithrilPowerCompleted = 0L;
}
public HiddenLocationSpecific getLocationSpecific() {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java
index 4e83410d..468cad81 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java
@@ -77,6 +77,16 @@ public class Dungeons {
@ConfigAccordionId(id = 1)
public int profitDisplayLoc = 0;
+ @Expose
+ @ConfigOption(
+ name = "Include Kismet Feather",
+ desc = "Include Kismet Feathers in the Profit Calculation after rerolling"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 1)
+ public boolean useKismetOnDungeonProfit = true;
+
+
@ConfigOption(
name = "Dungeon Win Overlay",
desc = ""
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java
index 2eca5b8e..aec7b326 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java
@@ -39,10 +39,13 @@ public class MiscOverlays {
"\u00a73Puzzler: \u00a7e13h",
"\u00a73Fetchur: \u00a7e3h38m",
"\u00a73Commissions: \u00a7e3h38m",
- "\u00a73Experiments: \u00a7e3h38m"}
+ "\u00a73Experiments: \u00a7e3h38m",
+ "\u00a73Daily Mithril Powder: \u00a7e3h38m",
+ "\u00a73Daily Gemstone Powder: \u00a7e3h38m",
+ }
)
@ConfigAccordionId(id = 0)
- public List<Integer> todoText2 = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6));
+ public List<Integer> todoText2 = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8));
@ConfigOption(
name = "Show Only If Soon",
@@ -136,6 +139,30 @@ public class MiscOverlays {
)
public int godpotDisplay = 0;
+ @Expose
+ @ConfigOption(
+ name = "Daily Mithril Powder Display",
+ desc = "Change the way the daily mithril powder displays\n" +
+ "Only when ready, When very Soon, When soon, When kinda soon or always."
+ )
+ @ConfigAccordionId(id = 1)
+ @ConfigEditorDropdown(
+ values = {"Only when ready", "When very Soon", "When soon", "When Kinda Soon", "Always"}
+ )
+ public int dailyMithrilPowderDisplay = 0;
+
+ @Expose
+ @ConfigOption(
+ name = "Daily Gemstone Powder Display",
+ desc = "Change the way the daily gemstone powder displays\n" +
+ "Only when ready, When very Soon, When soon, When kinda soon or always."
+ )
+ @ConfigAccordionId(id = 1)
+ @ConfigEditorDropdown(
+ values = {"Only when ready", "When very Soon", "When soon", "When Kinda Soon", "Always"}
+ )
+ public int dailyGemstonePowderDisplay = 0;
+
@ConfigOption(
name = "Colours",
desc = ""
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java
index 2788b54c..ecb217d8 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java
@@ -31,13 +31,18 @@ public class OverlayManager {
"\u00a73Fetchur: \u00a7eReady!",
"\u00a73Commissions: \u00a7eReady!",
"\u00a73Experiments: \u00a7eReady!",
+ "\u00a73Daily Mithril Powder: \u00a7eReady",
+ "\u00a73Daily Gemstone Powder: \u00a7eReady",
"\u00a73Cakes: \u00a7e1d21h",
"\u00a73Cookie Buff: \u00a7e2d23h",
"\u00a73Godpot: \u00a7e19h",
"\u00a73Puzzler: \u00a7e13h",
"\u00a73Fetchur: \u00a7e3h38m",
"\u00a73Commissions: \u00a7e3h38m",
- "\u00a73Experiments: \u00a7e3h38m");
+ "\u00a73Experiments: \u00a7e3h38m",
+ "\u00a73Daily Mithril Powder: \u00a7e3h38m",
+ "\u00a73Daily Gemstone Powder: \u00a7e3h38m"
+ );
textOverlays.add(timersOverlay = new TimersOverlay(NotEnoughUpdates.INSTANCE.config.miscOverlays.todoPosition, () -> {
List<String> strings = new ArrayList<>();
for (int i : NotEnoughUpdates.INSTANCE.config.miscOverlays.todoText2) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java
index 44108682..da45304e 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java
@@ -41,8 +41,8 @@ public class TimersOverlay extends TextOverlay {
private static final Pattern PUZZLER_PATTERN = Pattern.compile("\u00a7r\u00a7dPuzzler\u00a7r\u00a76 gave you .+ \u00a7r\u00a76for solving the puzzle!\u00a7r");
private static final Pattern FETCHUR_PATTERN = Pattern.compile("\u00a7e\\[NPC] Fetchur\u00a7f: \u00a7rthanks thats probably what i needed\u00a7r");
private static final Pattern FETCHUR2_PATTERN = Pattern.compile("\u00a7e\\[NPC] Fetchur\u00a7f: \u00a7rcome back another time, maybe tmrw\u00a7r");
-
- private final boolean hideGodpot = false;
+ private static final Pattern DAILY_MITHRIL_POWDER = Pattern.compile("\u00a7r\u00a79\u1805 \u00a7r\u00a7fYou've earned \u00a7r\u00a72.+ Mithril Powder \u00a7r\u00a7ffrom mining your first Mithril Ore of the day!\u00a7r");
+ private static final Pattern DAILY_GEMSTONE_POWDER = Pattern.compile("\u00a7r\u00a79\u1805 \u00a7r\u00a7fYou've earned \u00a7r\u00a7d.+ Gemstone Powder \u00a7r\u00a7ffrom mining your first Gemstone of the day!\u00a7r");
@SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
public void onChatMessageReceived(ClientChatReceivedEvent event) {
@@ -51,13 +51,11 @@ public class TimersOverlay extends TextOverlay {
if (event.type == 0) {
long currentTime = System.currentTimeMillis();
-
Matcher cakeMatcher = CAKE_PATTERN.matcher(event.message.getFormattedText());
if (cakeMatcher.matches()) {
hidden.firstCakeAte = currentTime;
return;
}
-
Matcher puzzlerMatcher = PUZZLER_PATTERN.matcher(event.message.getFormattedText());
if (puzzlerMatcher.matches()) {
hidden.puzzlerCompleted = currentTime;
@@ -75,7 +73,15 @@ public class TimersOverlay extends TextOverlay {
hidden.fetchurCompleted = currentTime;
return;
}
-
+ Matcher dailyGemstonePowder = DAILY_GEMSTONE_POWDER.matcher(event.message.getFormattedText());
+ if (dailyGemstonePowder.matches()) {
+ hidden.dailyGemstonePowderCompleted = currentTime;
+ return;
+ }
+ Matcher dailyMithrilPowder = DAILY_MITHRIL_POWDER.matcher(event.message.getFormattedText());
+ if (dailyMithrilPowder.matches()) {
+ hidden.dailyMithrilPowerCompleted = currentTime;
+ }
}
}
@@ -132,7 +138,6 @@ public class TimersOverlay extends TextOverlay {
//new ItemStack(Items.ender_pearl, 16, 0)
};
}
- long currentTime = System.currentTimeMillis();
ZonedDateTime currentTimeEST = ZonedDateTime.now(ZoneId.of("America/Atikokan"));
@@ -154,6 +159,12 @@ public class TimersOverlay extends TextOverlay {
case "Cookie Buff":
icon = COOKIE_ICON;
break;
+ case "Daily Mithril Powder":
+ icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("MITHRIL_ORE"));
+ break;
+ case "Daily Gemstone Powder":
+ icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PERFECT_AMETHYST_GEM"));
+ break;
}
if (icon != null) {
@@ -169,6 +180,7 @@ public class TimersOverlay extends TextOverlay {
super.renderLine(line, position, dummy);
}
+
@Override
public void update() {
@@ -396,11 +408,11 @@ public class TimersOverlay extends TextOverlay {
map.put(3, DARK_AQUA + "Puzzler: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + Utils.prettyTime(puzzlerEnd));
}
- long midnightReset = (currentTime - 18000000) / 86400000 * 86400000 + 18000000;
-
- long fetchurComplete = hidden.fetchurCompleted;
-
+ long midnightReset = (currentTime - 18000000) / 86400000 * 86400000 + 18000000; // 12am est
+ long catacombsReset = currentTime / 86400000 * 86400000; // 7pm est
long timeDiffMidnightNow = midnightReset + 86400000 - currentTime;
+ long catacombsDiffNow = catacombsReset + 86400000 - currentTime;
+ long fetchurComplete = hidden.fetchurCompleted;
//Fetchur Display
if (fetchurComplete < midnightReset) {
@@ -439,17 +451,52 @@ public class TimersOverlay extends TextOverlay {
map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready!");
} else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.VERYSOON.ordinal() &&
(hidden.experimentsCompleted < (midnightReset - TimeEnums.HALFANHOUR.time))) {
- map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + Utils.prettyTime(timeDiffMidnightNow));
+ map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + Utils.prettyTime(catacombsReset));
} else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.SOON.ordinal() &&
(hidden.experimentsCompleted < (midnightReset - TimeEnums.HOUR.time))) {
- map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + Utils.prettyTime(timeDiffMidnightNow));
+ map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + Utils.prettyTime(catacombsReset));
} else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.KINDASOON.ordinal() &&
(hidden.experimentsCompleted < (midnightReset - (TimeEnums.HOUR.time * 3)))) {
- map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + Utils.prettyTime(timeDiffMidnightNow));
+ map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + Utils.prettyTime(catacombsReset));
} else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.ALWAYS.ordinal()) {
- map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + Utils.prettyTime(timeDiffMidnightNow));
+ map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + Utils.prettyTime(catacombsReset));
+ }
+
+ // Daily Mithril Powder display
+ long mithrilPowderCompleted = hidden.dailyMithrilPowerCompleted + 1000 * 60 * 60 * 24 - currentTime;
+
+ if (hidden.dailyMithrilPowerCompleted < midnightReset) {
+ map.put(7, DARK_AQUA + "Daily Mithril Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready!");
+ } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.dailyMithrilPowderDisplay >= DISPLAYTYPE.VERYSOON.ordinal() &&
+ (hidden.dailyMithrilPowerCompleted < (midnightReset - TimeEnums.HALFANHOUR.time))) {
+ map.put(7, DARK_AQUA + "Daily Mithril Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + Utils.prettyTime(timeDiffMidnightNow));
+ } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.dailyMithrilPowderDisplay >= DISPLAYTYPE.SOON.ordinal() &&
+ (hidden.dailyMithrilPowerCompleted < (midnightReset - TimeEnums.HOUR.time))) {
+ map.put(7, DARK_AQUA + "Daily Mithril Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + Utils.prettyTime(timeDiffMidnightNow));
+ } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.dailyMithrilPowderDisplay >= DISPLAYTYPE.KINDASOON.ordinal() &&
+ (hidden.dailyMithrilPowerCompleted < (midnightReset - (TimeEnums.HOUR.time * 3)))) {
+ map.put(7, DARK_AQUA + "Daily Mithril Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + Utils.prettyTime(timeDiffMidnightNow));
+ } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.dailyMithrilPowderDisplay >= DISPLAYTYPE.ALWAYS.ordinal()) {
+ map.put(7, DARK_AQUA + "Daily Mithril Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + Utils.prettyTime(timeDiffMidnightNow));
}
+ // Daily Gemstone Powder Display
+ if (hidden.dailyGemstonePowderCompleted < midnightReset) {
+ map.put(8, DARK_AQUA + "Daily Gemstone Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready!");
+ } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.dailyGemstonePowderDisplay >= DISPLAYTYPE.VERYSOON.ordinal() &&
+ (hidden.dailyGemstonePowderCompleted < (midnightReset - TimeEnums.HALFANHOUR.time))) {
+ map.put(8, DARK_AQUA + "Daily Gemstone Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + Utils.prettyTime(timeDiffMidnightNow));
+ } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.dailyGemstonePowderDisplay >= DISPLAYTYPE.SOON.ordinal() &&
+ (hidden.dailyGemstonePowderCompleted < (midnightReset - TimeEnums.HOUR.time))) {
+ map.put(8, DARK_AQUA + "Daily Gemstone Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + Utils.prettyTime(timeDiffMidnightNow));
+ } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.dailyGemstonePowderDisplay >= DISPLAYTYPE.KINDASOON.ordinal() &&
+ (hidden.dailyGemstonePowderCompleted < (midnightReset - (TimeEnums.HOUR.time * 3)))) {
+ map.put(8, DARK_AQUA + "Daily Gemstone Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + Utils.prettyTime(timeDiffMidnightNow));
+ } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.dailyGemstonePowderDisplay >= DISPLAYTYPE.ALWAYS.ordinal()) {
+ map.put(8, DARK_AQUA + "Daily Gemstone Powder: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + Utils.prettyTime(timeDiffMidnightNow));
+ }
+
+
overlayStrings = new ArrayList<>();
for (int index : NotEnoughUpdates.INSTANCE.config.miscOverlays.todoText2) {
if (map.containsKey(index)) {
@@ -459,6 +506,10 @@ public class TimersOverlay extends TextOverlay {
if (overlayStrings.isEmpty()) overlayStrings = null;
}
+ public String compactRemaining(int amount) {
+ return (5-amount) + " remaining";
+ }
+
private enum TimeEnums {
DAY(86400000),
HALFDAY(43200000),
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 c3c68b9b..dd7fac79 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
@@ -911,6 +911,7 @@ public class GuiProfileViewer extends GuiScreen {
"dungeons.dungeon_types.catacombs.experience"), 0);
levelObjCata = ProfileViewer.getLevel(Utils.getElement(leveling, "catacombs").getAsJsonArray(),
cataXp, 50, false);
+ levelObjCata.totalXp = cataXp;
levelObjCatas.put(profileId, levelObjCata);
}
@@ -1369,15 +1370,20 @@ public class GuiProfileViewer extends GuiScreen {
if (mouseX > x && mouseX < x + 120) {
if (mouseY > y - 4 && mouseY < y + 13) {
String levelStr;
+ String totalXpStr = null;
if (levelObj.maxed) {
levelStr = EnumChatFormatting.GOLD + "MAXED!";
+ totalXpStr = EnumChatFormatting.GRAY + "Total XP: " + EnumChatFormatting.DARK_PURPLE + Utils.formatNumberWithDots((long) levelObj.totalXp);
} else {
int maxXp = (int) levelObj.maxXpForLevel;
levelStr = EnumChatFormatting.DARK_PURPLE + shortNumberFormat(Math.round((level % 1) * maxXp),
0) + "/" + shortNumberFormat(maxXp, 0);
}
-
- tooltipToDisplay = Utils.createList(levelStr);
+ if (totalXpStr != null) {
+ tooltipToDisplay = Utils.createList(levelStr, totalXpStr);
+ } else {
+ tooltipToDisplay = Utils.createList(levelStr);
+ }
}
}
@@ -1502,7 +1508,7 @@ public class GuiProfileViewer extends GuiScreen {
put("PET_ITEM_IRON_CLAWS_COMMON", new HashMap<String, Float>() {{ put("CRIT_DAMAGE", 1.4f); put("CRIT_CHANCE", 1.4f); }});
put("PET_ITEM_TEXTBOOK", new HashMap<String, Float>() {{ put("INTELLIGENCE", 2f); }});
}};
-
+
private int selectedPet = -1;
private int petsPage = 0;
private List<JsonObject> sortedPets = null;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
index f1b106d9..bdffb42f 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
@@ -188,6 +188,7 @@ public class ProfileViewer {
public float level = 0;
public float maxXpForLevel = 0;
public boolean maxed = false;
+ public double totalXp;
}
public static Level getLevel(JsonArray levelingArray, float xp, int levelCap, boolean cumulative) {