From 0fcdb608d5e696a0d55598d8579916ad9decfbff Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:27:16 +0100 Subject: Disabled the Daily Quest part of the Reputation Helper during the great spook. --- .../nether/reputationhelper/dailyquest/DailyQuestHelper.kt | 10 ++++++++-- .../nether/reputationhelper/dailyquest/QuestLoader.kt | 12 ++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt index 37b26dce3..2090d77e4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt @@ -48,7 +48,7 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { private val questLoader = QuestLoader(this) val quests = mutableListOf() private val sacksCache = mutableMapOf() - + var greatSpook = false @SubscribeEvent fun onInventoryOpen(event: InventoryFullyOpenedEvent) { @@ -219,6 +219,12 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { } fun render(display: MutableList>) { + if (greatSpook) { + display.addAsSingletonList("") + display.addAsSingletonList("§7Daily Quests (§cdisabled§7)") + display.addAsSingletonList(" §5§lThe Great Spook §7happened :O") + return + } val done = quests.count { it.state == QuestState.COLLECTED } display.addAsSingletonList("") display.addAsSingletonList("§7Daily Quests (§e$done§8/§e5 collected§7)") @@ -341,4 +347,4 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { } private fun isEnabled() = IslandType.CRIMSON_ISLE.isInIsland() && reputationHelper.config.enabled -} \ No newline at end of file +} diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt index 6900e8c2e..037faa503 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt @@ -30,6 +30,7 @@ class QuestLoader(private val dailyQuestHelper: DailyQuestHelper) { fun loadFromTabList() { var i = -1 + dailyQuestHelper.greatSpook = false for (line in TabListData.getTabList()) { if (line.contains("Faction Quests:")) { i = 0 @@ -39,6 +40,7 @@ class QuestLoader(private val dailyQuestHelper: DailyQuestHelper) { i++ readQuest(line) + if (dailyQuestHelper.greatSpook) return if (i == 5) { break } @@ -46,6 +48,11 @@ class QuestLoader(private val dailyQuestHelper: DailyQuestHelper) { } private fun readQuest(line: String) { + if (line.contains("The Great Spook")) { + dailyQuestHelper.greatSpook = true + dailyQuestHelper.update() + return + } var text = line.substring(3) val green = text.startsWith("§a") text = text.substring(2) @@ -149,9 +156,14 @@ class QuestLoader(private val dailyQuestHelper: DailyQuestHelper) { } fun loadConfig(storage: Storage.ProfileSpecific.CrimsonIsleStorage) { + if (dailyQuestHelper.greatSpook) return for (text in storage.quests.toList()) { val split = text.split(":") val name = split[0] + if (name.contains("The Great Spook")) { + dailyQuestHelper.greatSpook = true + return + } val state = QuestState.valueOf(split[1]) val needAmount = split[2].toInt() val quest = addQuest(name, state, needAmount) -- cgit