aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-01 09:27:16 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-01 09:27:16 +0100
commit0fcdb608d5e696a0d55598d8579916ad9decfbff (patch)
treed05a79fa835b2f122c25972c605e1dc92772f3cb
parent131a6ed123e0ec1c82f65534b3670493947e7cdf (diff)
downloadskyhanni-0fcdb608d5e696a0d55598d8579916ad9decfbff.tar.gz
skyhanni-0fcdb608d5e696a0d55598d8579916ad9decfbff.tar.bz2
skyhanni-0fcdb608d5e696a0d55598d8579916ad9decfbff.zip
Disabled the Daily Quest part of the Reputation Helper during the great spook.
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt12
2 files changed, 20 insertions, 2 deletions
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<Quest>()
private val sacksCache = mutableMapOf<String, Long>()
-
+ var greatSpook = false
@SubscribeEvent
fun onInventoryOpen(event: InventoryFullyOpenedEvent) {
@@ -219,6 +219,12 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) {
}
fun render(display: MutableList<List<Any>>) {
+ 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)