From 1bec2385162025fcf314c807378eec45bb8009a9 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:25:04 +0100 Subject: [PATCH] Revert "fix not accepted" This reverts commit ad00133d8d9092b2af348385efeb6438ecc4bf61. --- .../nether/reputationhelper/dailyquest/DailyQuestHelper.kt | 1 + .../nether/reputationhelper/dailyquest/QuestLoader.kt | 7 ++++++- .../nether/reputationhelper/dailyquest/quest/QuestState.kt | 3 ++- .../reputationhelper/dailyquest/quest/UnknownQuest.kt | 2 +- 4 files changed, 10 insertions(+), 3 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 b732a555c8e6..5ca8dfa18743 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 @@ -231,6 +231,7 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { private fun Quest.needsTownBoardLocation(): Boolean = state.let { state -> state == QuestState.READY_TO_COLLECT || + state == QuestState.NOT_ACCEPTED || (this is RescueMissionQuest && state == QuestState.ACCEPTED) } 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 3721573caeb1..0b351f888f5f 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 @@ -79,7 +79,7 @@ class QuestLoader(private val dailyQuestHelper: DailyQuestHelper) { return } - val state = if (green) QuestState.READY_TO_COLLECT else QuestState.ACCEPTED + val state = if (green) QuestState.READY_TO_COLLECT else QuestState.NOT_ACCEPTED dailyQuestHelper.update() addQuest(addQuest(name, state, needAmount)) } @@ -152,6 +152,11 @@ class QuestLoader(private val dailyQuestHelper: DailyQuestHelper) { dailyQuestHelper.update() } + val accepted = !stack.getLore().any { dailyQuestHelper.clickToStartPattern.matches(it) } + if (accepted && quest.state == QuestState.NOT_ACCEPTED) { + quest.state = QuestState.ACCEPTED + dailyQuestHelper.update() + } if (name == "Miniboss") { fixMinibossAmount(quest, stack) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestState.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestState.kt index 7b1f29a6f573..f98514a6644e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestState.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestState.kt @@ -1,7 +1,8 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest enum class QuestState(val displayName: String, val color: String) { - ACCEPTED("Active", "§b"), + NOT_ACCEPTED("Not Accepted", "§c"), + ACCEPTED("Accepted", "§b"), READY_TO_COLLECT("Ready to collect", "§a"), COLLECTED("Collected", "§7"), } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/UnknownQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/UnknownQuest.kt index 9ed713fe24b5..ae7338684b97 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/UnknownQuest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/UnknownQuest.kt @@ -3,4 +3,4 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest import at.hannibal2.skyhanni.utils.NEUInternalName class UnknownQuest(unknownName: String) : - Quest(NEUInternalName.MISSING_ITEM, null, QuestCategory.UNKNOWN, unknownName, QuestState.ACCEPTED) + Quest(NEUInternalName.MISSING_ITEM, null, QuestCategory.UNKNOWN, unknownName, QuestState.NOT_ACCEPTED)