diff options
author | Planterror <47764567+Plantterror@users.noreply.github.com> | 2023-03-11 07:55:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 15:55:22 +0100 |
commit | 14ebdfce401ff955d6d00bf00684ac1058d26259 (patch) | |
tree | 889171ce1681836700773e9c39cc740c389fbb83 | |
parent | e010edcc074d5819118e6032746efd26ebed6cef (diff) | |
download | NotEnoughUpdates-14ebdfce401ff955d6d00bf00684ac1058d26259.tar.gz NotEnoughUpdates-14ebdfce401ff955d6d00bf00684ac1058d26259.tar.bz2 NotEnoughUpdates-14ebdfce401ff955d6d00bf00684ac1058d26259.zip |
Merge pull request #624
* fixed experiments saying it's available when the wrong time is reached
* NPC Buy limit timer part 1
* Cookie buff now gains more accurate info
* scrapped accurate god potion
* small tweaks
* fix stupid mistakes I made
* fixed commissions never being recognized as completed
* Quest timer now shows how many quests are uncompleted
* added cookie menu as place to test for cookie buff
* accept review changes, add .intern to container name
* proper formatting hopefully
* restrict checking quest progress to crimson isle
* fix election candidates counting as CI quests
* paul's name twice whoops, formatting fixes
* Merge pull request #2 from Plantterror/master
* Fixed an NPE
5 files changed, 220 insertions, 122 deletions
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 e9c34e03..e2a483f7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -589,6 +589,8 @@ public class NEUConfig extends Config { @Expose public long questBoardCompleted = 0L; @Expose + public long dailyShopLimitCompleted = 0L; + @Expose public HashMap<Integer, JsonObject> savedEquipment = new HashMap<>(); @Expose public int magicalPower = 0; 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 5634a4b7..97b11d27 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 @@ -86,10 +86,11 @@ public class MiscOverlays { "\u00a73Gemstone Powder: \u00a7e3h38m", "\u00a73Heavy Pearls: \u00a7e3h38m", "\u00a73Crimson Isle Quests: \u00a7e3h38m", + "\u00a73NPC Buy Daily Limit: \u00a7e3h38m", } ) @ConfigAccordionId(id = 0) - public List<Integer> todoText2 = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); + public List<Integer> todoText2 = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)); @ConfigOption( name = "Show Only If Soon", @@ -232,6 +233,18 @@ public class MiscOverlays { ) public int questBoardDisplay = 0; + @Expose + @ConfigOption( + name = "NPC Buy Daily Limit Display", + desc = "Change the way the NPC shop limit 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 shopLimitDisplay = 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 a8b7112f..99e8b1e4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java @@ -63,7 +63,8 @@ public class OverlayManager { "\u00a73Experiments: \u00a7e3h38m", "\u00a73Mithril Powder: \u00a7e3h38m", "\u00a73Gemstone Powder: \u00a7e3h38m", - "\u00a73Crimson Isle Quests: \u00a7e3h38m" + "\u00a73Crimson Isle Quests: \u00a7e3h38m", + "\u00a73NPC Buy Daily Limit: \u00a7e3h38m" ); textOverlays.add( timersOverlay = new TimersOverlay(NotEnoughUpdates.INSTANCE.config.miscOverlays.todoPosition, () -> { 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 90aa2984..f741f032 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java @@ -42,6 +42,7 @@ import org.lwjgl.util.vector.Vector2f; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.function.Supplier; @@ -51,9 +52,6 @@ import java.util.regex.Pattern; import static net.minecraft.util.EnumChatFormatting.DARK_AQUA; public class TimersOverlay extends TextTabOverlay { - private static final Pattern PATTERN_ACTIVE_EFFECTS = Pattern.compile( - "\u00a7r\u00a7r\u00a77You have a \u00a7r\u00a7cGod Potion \u00a7r\u00a77active! \u00a7r\u00a7d([1-5][0-9]|[0-9])[\\s|^\\S]?(Seconds|Second|Minutes|Minute|Hours|Hour|Day|Days|h|m|s) ?([1-5][0-9]|[0-9])?(m|s)?\u00a7r"); - public TimersOverlay( Position position, Supplier<List<String>> dummyStrings, @@ -62,6 +60,8 @@ public class TimersOverlay extends TextTabOverlay { super(position, dummyStrings, styleSupplier); } + private static final Pattern PATTERN_ACTIVE_EFFECTS = Pattern.compile( + "\u00a7r\u00a7r\u00a77You have a \u00a7r\u00a7cGod Potion \u00a7r\u00a77active! \u00a7r\u00a7d([1-5][0-9]|[0-9])[\\s|^\\S]?(Seconds|Second|Minutes|Minute|Hours|Hour|Day|Days|h|m|s) ?([1-5][0-9]|[0-9])?([ms])?\u00a7r"); private static final Pattern CAKE_PATTERN = Pattern.compile( "\u00a7r\u00a7d\u00a7lYum! \u00a7r\u00a7eYou gain .+ \u00a7r\u00a7efor \u00a7r\u00a7a48 \u00a7r\u00a7ehours!\u00a7r"); private static final Pattern PUZZLER_PATTERN = @@ -74,6 +74,8 @@ public class TimersOverlay extends TextTabOverlay { "\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"); + private static final Pattern DAILY_SHOP_LIMIT = Pattern.compile( + "\u00a7r\u00a7cYou may only buy up to (640|6400) of this item each day!\u00a7r"); @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true) public void onChatMessageReceived(ClientChatReceivedEvent event) { @@ -112,6 +114,11 @@ public class TimersOverlay extends TextTabOverlay { Matcher dailyMithrilPowder = DAILY_MITHRIL_POWDER.matcher(event.message.getFormattedText()); if (dailyMithrilPowder.matches()) { hidden.dailyMithrilPowerCompleted = currentTime; + return; + } + Matcher dailyShopLimit = DAILY_SHOP_LIMIT.matcher(event.message.getFormattedText()); + if (dailyShopLimit.matches()) { + hidden.dailyShopLimitCompleted = currentTime; } } } @@ -130,6 +137,7 @@ public class TimersOverlay extends TextTabOverlay { private static final ItemStack EXPERIMENTS_ICON = new ItemStack(Items.enchanted_book); private static final ItemStack COOKIE_ICON = new ItemStack(Items.cookie); private static final ItemStack QUEST_ICON = new ItemStack(Items.sign); + private static final ItemStack SHOP_ICON = new ItemStack(Blocks.hopper); @Override protected void renderLine(String line, Vector2f position, boolean dummy) { @@ -215,6 +223,9 @@ public class TimersOverlay extends TextTabOverlay { case "Crimson Isle Quests": icon = QUEST_ICON; break; + case "NPC Buy Daily Limit": + icon = SHOP_ICON; + break; } if (icon != null) { @@ -251,55 +262,141 @@ public class TimersOverlay extends TextTabOverlay { ContainerChest container = (ContainerChest) chest.inventorySlots; IInventory lower = container.getLowerChestInventory(); String containerName = lower.getDisplayName().getUnformattedText(); - - if (containerName.equals("Commissions") && lower.getSizeInventory() >= 18) { - if (hidden.commissionsCompleted == 0) { - hidden.commissionsCompleted = currentTime; - } - for (int i = 9; i < 18; i++) { - ItemStack stack = lower.getStackInSlot(i); - if (stack != null && stack.hasTagCompound()) { - String[] lore = NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(stack.getTagCompound()); - for (String line : lore) { - if (line.contains("(Daily")) { - hidden.commissionsCompleted = 0; - break; + ItemStack stack = lower.getStackInSlot(0); + switch (containerName.intern()) { + case "Commissions": + if (lower.getSizeInventory() < 18) { + break; + } + if (hidden.commissionsCompleted == 0) { + hidden.commissionsCompleted = currentTime + TimeEnums.DAY.time; + } + for (int i = 9; i < 18; i++) { + stack = lower.getStackInSlot(i); + if (stack != null && stack.hasTagCompound()) { + String[] lore = NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(stack.getTagCompound()); + for (String line : lore) { + if (line.contains("(Daily")) { + hidden.commissionsCompleted = 0; + break; + } } } } - } - } else if (containerName.equals("Experimentation Table") && lower.getSizeInventory() >= 36) { - ItemStack stack = lower.getStackInSlot(31); - if (stack != null) { - if (stack.getItem() == Items.blaze_powder) { - if (hidden.experimentsCompleted == 0) { + break; + case "Experimentation Table": + if (lower.getSizeInventory() < 36) { + break; + } + stack = lower.getStackInSlot(31); + if (stack != null) { + if (stack.getItem() == Items.blaze_powder) { + if (hidden.experimentsCompleted == 0) { + hidden.experimentsCompleted = currentTime; + return; + } + } + } + ItemStack stackSuperPairs = lower.getStackInSlot(22); + if (stackSuperPairs != null && stackSuperPairs.getItem() == Items.skull && + stackSuperPairs.getTagCompound() != null) { + String[] lore = NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(stackSuperPairs.getTagCompound()); + String text = lore[lore.length - 1]; + String cleanText = Utils.cleanColour(text); + if (cleanText.equals("Experiments on cooldown!")) { hidden.experimentsCompleted = currentTime; return; } } - } - ItemStack stackSuperPairs = lower.getStackInSlot(22); - if (stackSuperPairs != null && stackSuperPairs.getItem() == Items.skull && - stackSuperPairs.getTagCompound() != null) { - String[] lore = NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(stackSuperPairs.getTagCompound()); - String text = lore[lore.length - 1]; - String cleanText = Utils.cleanColour(text); - if (cleanText.equals("Experiments on cooldown!")) { + hidden.experimentsCompleted = 0; + break; + case "Superpairs Rewards": + if (lower.getSizeInventory() < 27) { + break; + } + stack = lower.getStackInSlot(13); + if (stack != null && Utils.cleanColour(stack.getDisplayName()).equals("Superpairs")) { hidden.experimentsCompleted = currentTime; - return; } - } - hidden.experimentsCompleted = 0; - return; - } else if (containerName.equals("Superpairs Rewards") && lower.getSizeInventory() >= 27) { - ItemStack stack = lower.getStackInSlot(13); - if (stack != null && Utils.cleanColour(stack.getDisplayName()).equals("Superpairs")) { - hidden.experimentsCompleted = currentTime; - } + case "SkyBlock Menu": + if (lower.getSizeInventory() < 54) { + break; + } + stack = lower.getStackInSlot(51); + case "Booster Cookie": + if (lower.getSizeInventory() < 54) { + break; + } + if (stack != lower.getStackInSlot(51)) {//if we didn't go into this case from the skyblock menu + stack = lower.getStackInSlot(13); + } + + if (stack != null && Utils.cleanColour(stack.getDisplayName()).equals("Booster Cookie") && + stack.getTagCompound() != null) { + String[] lore = NotEnoughUpdates.INSTANCE.manager.getLoreFromNBT(stack.getTagCompound()); + for (String line : lore) { + if (line.contains("Duration: ")) { + String clean = line.replaceAll("(\u00a7.)", ""); + clean = clean.replaceAll("(\\d)([smhdy])", "$1 $2"); + String[] cleanSplit = clean.split(" "); + String[] removeDuration = Arrays.copyOfRange(cleanSplit, 1, cleanSplit.length); + hidden.cookieBuffRemaining = currentTime; + for (int i = 0; i + 1 < removeDuration.length; i++) { + if (i % 2 == 1) continue; + + String number = removeDuration[i]; + String unit = removeDuration[i + 1]; + try { + long val = Integer.parseInt(number); + switch (unit) { + case "Years": + case "Year": + hidden.cookieBuffRemaining += val * 365 * 24 * 60 * 60 * 1000; + break; + case "Months": + case "Month": + hidden.cookieBuffRemaining += val * 30 * 24 * 60 * 60 * 1000; + break; + case "Days": + case "Day": + case "d": + hidden.cookieBuffRemaining += val * 24 * 60 * 60 * 1000; + break; + case "Hours": + case "Hour": + case "h": + hidden.cookieBuffRemaining += val * 60 * 60 * 1000; + break; + case "Minutes": + case "Minute": + case "m": + hidden.cookieBuffRemaining += val * 60 * 1000; + break; + case "Seconds": + case "Second": + case "s": + hidden.cookieBuffRemaining += val * 1000; + break; + } + } catch (NumberFormatException e) { + e.printStackTrace(); + hidden.cookieBuffRemaining = 0; + if (!hasErrorMessage) { + Utils.addChatMessage( + EnumChatFormatting.YELLOW + "[NEU] Unable to work out your cookie buff timer"); + hasErrorMessage = true; + } + break; + } + } + break; + } + } + } + break; } } - boolean foundCookieBuffText = false; boolean foundGodPotText = false; boolean foundEffectsText = false; if (SBInfo.getInstance().getLocation() != null && !SBInfo.getInstance().getLocation().equals("dungeon") && @@ -354,63 +451,6 @@ public class TimersOverlay extends TextTabOverlay { hidden.godPotionDuration = godPotDuration; - } else if (line.contains("\u00a7d\u00a7lCookie Buff")) { - foundCookieBuffText = true; - } else if (foundCookieBuffText) { - String clean = line.replaceAll("(\u00a7.)", ""); - clean = clean.replaceAll("(\\d)([smhdy])", "$1 $2"); - String[] cleanSplit = clean.split(" "); - hidden.cookieBuffRemaining = 0; - if (line.contains("Not")) break; - - for (int i = 0; i + 1 < cleanSplit.length; i++) { - if (i % 2 == 1) continue; - - String number = cleanSplit[i]; - String unit = cleanSplit[i + 1]; - try { - long val = Integer.parseInt(number); - switch (unit) { - case "Years": - case "Year": - hidden.cookieBuffRemaining += val * 365 * 24 * 60 * 60 * 1000; - break; - case "Months": - case "Month": - hidden.cookieBuffRemaining += val * 30 * 24 * 60 * 60 * 1000; - break; - case "Days": - case "Day": - hidden.cookieBuffRemaining += val * 24 * 60 * 60 * 1000; - break; - case "Hours": - case "Hour": - case "h": - hidden.cookieBuffRemaining += val * 60 * 60 * 1000; - break; - case "Minutes": - case "Minute": - case "m": - hidden.cookieBuffRemaining += val * 60 * 1000; - break; - case "Seconds": - case "Second": - case "s": - hidden.cookieBuffRemaining += val * 1000; - break; - } - } catch (NumberFormatException e) { - e.printStackTrace(); - hidden.cookieBuffRemaining = 0; - if (!hasErrorMessage) { - Utils.addChatMessage(EnumChatFormatting.YELLOW + "[NEU] Unable to work out your cookie buff timer"); - hasErrorMessage = true; - } - break; - } - } - - break; } } } @@ -484,7 +524,7 @@ public class TimersOverlay extends TextTabOverlay { 1, DARK_AQUA + "Cookie Buff: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + - Utils.prettyTime(hidden.cookieBuffRemaining) + Utils.prettyTime(hidden.cookieBuffRemaining - currentTime) ); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.cookieBuffDisplay >= DISPLAYTYPE.SOON.ordinal() && hidden.cookieBuffRemaining < TimeEnums.HALFDAY.time) { @@ -492,7 +532,7 @@ public class TimersOverlay extends TextTabOverlay { 1, DARK_AQUA + "Cookie Buff: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + - Utils.prettyTime(hidden.cookieBuffRemaining) + Utils.prettyTime(hidden.cookieBuffRemaining - currentTime) ); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.cookieBuffDisplay >= DISPLAYTYPE.KINDASOON.ordinal() && hidden.cookieBuffRemaining < TimeEnums.DAY.time) { @@ -500,14 +540,14 @@ public class TimersOverlay extends TextTabOverlay { 1, DARK_AQUA + "Cookie Buff: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + - Utils.prettyTime(hidden.cookieBuffRemaining) + Utils.prettyTime(hidden.cookieBuffRemaining - currentTime) ); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.cookieBuffDisplay >= DISPLAYTYPE.ALWAYS.ordinal()) { map.put( 1, DARK_AQUA + "Cookie Buff: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + - Utils.prettyTime(hidden.cookieBuffRemaining) + Utils.prettyTime(hidden.cookieBuffRemaining - currentTime) ); } @@ -595,11 +635,11 @@ public class TimersOverlay extends TextTabOverlay { ); } - long midnightReset = (currentTime - 18000000) / 86400000 * 86400000 + 18000000; // 12am est + long midnightReset = (currentTime - 18000000) / TimeEnums.DAY.time * TimeEnums.DAY.time + 18000000; // 12am est long pearlsReset = midnightReset - 18000000; //8pm est - long catacombsReset = currentTime / 86400000 * 86400000; // 7pm est - long timeDiffMidnightNow = midnightReset + 86400000 - currentTime; - long catacombsDiffNow = catacombsReset + 86400000 - currentTime; + long catacombsReset = currentTime / TimeEnums.DAY.time * TimeEnums.DAY.time; // 7pm est + long timeDiffMidnightNow = midnightReset + TimeEnums.DAY.time - currentTime; + long catacombsDiffNow = catacombsReset + TimeEnums.DAY.time - currentTime; long fetchurComplete = hidden.fetchurCompleted; //Fetchur Display @@ -647,7 +687,7 @@ public class TimersOverlay extends TextTabOverlay { map.put( 5, DARK_AQUA + "Commissions: " + - EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready!" + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready! " ); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.commissionDisplay >= DISPLAYTYPE.VERYSOON.ordinal() && (hidden.commissionsCompleted < (midnightReset - TimeEnums.HALFANHOUR.time))) { @@ -683,49 +723,47 @@ public class TimersOverlay extends TextTabOverlay { } //Experiment Display - if (hidden.experimentsCompleted < midnightReset) { + if (hidden.experimentsCompleted < catacombsReset) { 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))) { + (hidden.experimentsCompleted < (catacombsReset - TimeEnums.HALFANHOUR.time))) { map.put( 6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + - Utils.prettyTime(catacombsReset + 86400000 - currentTime) + Utils.prettyTime(catacombsDiffNow) ); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.SOON.ordinal() && - (hidden.experimentsCompleted < (midnightReset - TimeEnums.HOUR.time))) { + (hidden.experimentsCompleted < (catacombsReset - TimeEnums.HOUR.time))) { map.put( 6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + - Utils.prettyTime(catacombsReset + 86400000 - currentTime) + Utils.prettyTime(catacombsDiffNow) ); } else if ( NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.KINDASOON.ordinal() && - (hidden.experimentsCompleted < (midnightReset - (TimeEnums.HOUR.time * 3)))) { + (hidden.experimentsCompleted < (catacombsReset - (TimeEnums.HOUR.time * 3)))) { map.put( 6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + - Utils.prettyTime(catacombsReset + 86400000 - currentTime) + Utils.prettyTime(catacombsDiffNow) ); } 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(catacombsReset + 86400000 - currentTime) + Utils.prettyTime(catacombsDiffNow) ); } // Daily Mithril Powder display - long mithrilPowderCompleted = hidden.dailyMithrilPowerCompleted + 1000 * 60 * 60 * 24 - currentTime; - if (hidden.dailyMithrilPowerCompleted < catacombsReset) { map.put( 7, @@ -853,12 +891,13 @@ public class TimersOverlay extends TextTabOverlay { Utils.prettyTime(pearlsReset + 86400000 - currentTime) ); } - + //Daily Crimson Isle Quests if (hidden.questBoardCompleted < midnightReset) { map.put( 10, DARK_AQUA + "Crimson Isle Quests: " + - EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready!" + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + + (5 - SBInfo.getInstance().completedQuests.size()) + " left!" ); } else if ( NotEnoughUpdates.INSTANCE.config.miscOverlays.questBoardDisplay >= DISPLAYTYPE.VERYSOON.ordinal() && @@ -895,6 +934,48 @@ public class TimersOverlay extends TextTabOverlay { ); } + //Daily Shop Limit + if (hidden.dailyShopLimitCompleted < catacombsReset) { + map.put( + 11, + DARK_AQUA + "NPC Buy Daily Limit: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready!" + ); + } else if ( + NotEnoughUpdates.INSTANCE.config.miscOverlays.shopLimitDisplay >= DISPLAYTYPE.VERYSOON.ordinal() && + (hidden.dailyShopLimitCompleted < (catacombsReset - TimeEnums.HALFANHOUR.time))) { + map.put( + 11, + DARK_AQUA + "NPC Buy Daily Limit: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + + Utils.prettyTime(catacombsDiffNow) + ); + } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.shopLimitDisplay >= DISPLAYTYPE.SOON.ordinal() && + (hidden.dailyShopLimitCompleted < (catacombsReset - TimeEnums.HOUR.time))) { + map.put( + 11, + DARK_AQUA + "NPC Buy Daily Limit: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + + Utils.prettyTime(catacombsDiffNow) + ); + } else if ( + NotEnoughUpdates.INSTANCE.config.miscOverlays.shopLimitDisplay >= DISPLAYTYPE.KINDASOON.ordinal() && + (hidden.dailyShopLimitCompleted < (catacombsReset - (TimeEnums.HOUR.time * 3)))) { + map.put( + 11, + DARK_AQUA + "NPC Buy Daily Limit: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + + Utils.prettyTime(catacombsDiffNow) + ); + } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.shopLimitDisplay >= DISPLAYTYPE.ALWAYS.ordinal()) { + map.put( + 11, + DARK_AQUA + "NPC Buy Daily Limit: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + + Utils.prettyTime(catacombsDiffNow) + ); + } + overlayStrings = new ArrayList<>(); for (int index : NotEnoughUpdates.INSTANCE.config.miscOverlays.todoText2) { if (map.containsKey(index)) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index a89b281d..9d2d1056 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -308,7 +308,8 @@ public class SBInfo { private static final String profilePrefix = "\u00a7r\u00a7e\u00a7lProfile: \u00a7r\u00a7a"; private static final String skillsPrefix = "\u00a7r\u00a7e\u00a7lSkills: \u00a7r\u00a7a"; - private static final String completedFactionQuests = "\u00a7r \u00a7r\u00a7a"; + private static final String completedFactionQuests = + "\u00a7r \u00a7r\u00a7a(?!(Paul|Finnegan|Aatrox|Cole|Diana|Diaz|Foxy|Marina)).*"; public ArrayList<String> completedQuests = new ArrayList<>(); private static final Pattern SKILL_LEVEL_PATTERN = Pattern.compile("([^0-9:]+) (\\d{1,2})"); @@ -353,7 +354,7 @@ public class SBInfo { } catch (Exception ignored) { } } - } else if (name.startsWith(completedFactionQuests)) { + } else if (name.matches(completedFactionQuests) && "crimson_isle".equals(mode)) { if (completedQuests.isEmpty()) { completedQuests.add(name); } else if (!completedQuests.contains(name)) { |