From 0a5c62857747c80ce039fcef182c7098a4a0503a Mon Sep 17 00:00:00 2001 From: Vixid <52578495+Vixid1@users.noreply.github.com> Date: Fri, 21 Oct 2022 07:19:22 +0100 Subject: Faction Town Board Quests added to Todo Overlay (#370) 370/merge --- .../notenoughupdates/options/NEUConfig.java | 2 + .../options/seperateSections/MiscOverlays.java | 15 ++++++- .../notenoughupdates/overlays/OverlayManager.java | 3 +- .../notenoughupdates/overlays/TimersOverlay.java | 49 ++++++++++++++++++++++ .../moulberry/notenoughupdates/util/SBInfo.java | 8 ++++ 5 files changed, 75 insertions(+), 2 deletions(-) (limited to 'src/main/java') 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 4d04bfbc..a1561658 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -573,6 +573,8 @@ public class NEUConfig extends Config { @Expose public long dailyHeavyPearlCompleted = 0L; @Expose + public long questBoardCompleted = 0L; + @Expose public HashMap 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 18b89733..e3edfcd4 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 @@ -77,10 +77,11 @@ public class MiscOverlays { "\u00a73Mithril Powder: \u00a7e3h38m", "\u00a73Gemstone Powder: \u00a7e3h38m", "\u00a73Heavy Pearls: \u00a7e3h38m", + "\u00a73Crimson Isle Quests: \u00a7e3h38m", } ) @ConfigAccordionId(id = 0) - public List todoText2 = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); + public List todoText2 = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); @ConfigOption( name = "Show Only If Soon", @@ -211,6 +212,18 @@ public class MiscOverlays { public int dailyHeavyPearlDisplay = 0; + @Expose + @ConfigOption( + name = "Crimson Isle Quests Display", + desc = "Change the way the crimson isle quests display\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 questBoardDisplay = 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 d580b556..84684558 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java @@ -60,7 +60,8 @@ public class OverlayManager { "\u00a73Commissions: \u00a7e3h38m", "\u00a73Experiments: \u00a7e3h38m", "\u00a73Mithril Powder: \u00a7e3h38m", - "\u00a73Gemstone Powder: \u00a7e3h38m" + "\u00a73Gemstone Powder: \u00a7e3h38m", + "\u00a73Crimson Isle Quests: \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 4d82ebaf..730cb17f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java @@ -130,6 +130,7 @@ public class TimersOverlay extends TextTabOverlay { private static final ItemStack COMMISSIONS_ICON = new ItemStack(Items.iron_pickaxe); 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); @Override protected void renderLine(String line, Vector2f position, boolean dummy) { @@ -212,6 +213,9 @@ public class TimersOverlay extends TextTabOverlay { .getItemInformation() .get("HEAVY_PEARL")); break; + case "Crimson Isle Quests": + icon = QUEST_ICON; + break; } if (icon != null) { @@ -388,6 +392,10 @@ public class TimersOverlay extends TextTabOverlay { hidden.godPotionDuration = 0; } + if (SBInfo.getInstance().completedQuests != null && SBInfo.getInstance().completedQuests.size() == 5) { + hidden.questBoardCompleted = currentTime; + } + if (!NotEnoughUpdates.INSTANCE.config.miscOverlays.todoOverlay2) { overlayStrings = null; return; @@ -819,6 +827,47 @@ public class TimersOverlay extends TextTabOverlay { ); } + if (hidden.questBoardCompleted < midnightReset) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready!" + ); + } else if ( + NotEnoughUpdates.INSTANCE.config.miscOverlays.questBoardDisplay >= DISPLAYTYPE.VERYSOON.ordinal() && + (hidden.questBoardCompleted < (midnightReset - TimeEnums.HALFANHOUR.time))) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + + Utils.prettyTime(timeDiffMidnightNow) + ); + } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.questBoardDisplay >= DISPLAYTYPE.SOON.ordinal() && + (hidden.questBoardCompleted < (midnightReset - TimeEnums.HOUR.time))) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + + Utils.prettyTime(timeDiffMidnightNow) + ); + } else if ( + NotEnoughUpdates.INSTANCE.config.miscOverlays.questBoardDisplay >= DISPLAYTYPE.KINDASOON.ordinal() && + (hidden.questBoardCompleted < (midnightReset - (TimeEnums.HOUR.time * 3)))) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + + Utils.prettyTime(timeDiffMidnightNow) + ); + } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.questBoardDisplay >= DISPLAYTYPE.ALWAYS.ordinal()) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + 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)) { 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 f3a09fcc..d78a6988 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -284,6 +284,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"; + public ArrayList completedQuests = new ArrayList<>(); private static final Pattern SKILL_LEVEL_PATTERN = Pattern.compile("([^0-9:]+) (\\d{1,2})"); @@ -320,6 +322,12 @@ public class SBInfo { } catch (Exception ignored) { } } + } else if (name.startsWith(completedFactionQuests)) { + if (completedQuests.isEmpty()) { + completedQuests.add(name); + } else if (!completedQuests.contains(name)) { + completedQuests.add(name); + } } } } catch (Exception e) { -- cgit