diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-27 14:09:47 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-02-27 14:09:47 +0100 |
commit | 208b61e81dfcd878b69619d8d1d3fac4d651f3d0 (patch) | |
tree | 40538afea2b7de9bc29b575aef6b541ec90f4066 /src/main/java/at/hannibal2/skyhanni/features/nether | |
parent | 07cc58d5f753e353586b223b88011632de5d526f (diff) | |
download | skyhanni-208b61e81dfcd878b69619d8d1d3fac4d651f3d0.tar.gz skyhanni-208b61e81dfcd878b69619d8d1d3fac4d651f3d0.tar.bz2 skyhanni-208b61e81dfcd878b69619d8d1d3fac4d651f3d0.zip |
Reworked nether reputation helper design.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
6 files changed, 33 insertions, 20 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt index 5db95b526..c50cec5dd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -44,6 +44,7 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { kuudraBossHelper.load() questHelper.load() + update() } @SubscribeEvent @@ -97,11 +98,11 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { } fun update() { - dirty = true - questHelper.saveConfig() miniBossHelper.saveConfig() kuudraBossHelper.saveConfig() + + dirty = true } fun reset() { diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt index f93a57551..ce30ed3db 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailykuudra/DailyKuudraBossHelper.kt @@ -68,7 +68,7 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH fun render(display: MutableList<List<Any>>) { val done = kuudraTiers.count { it.doneToday } display.add(Collections.singletonList("")) - display.add(Collections.singletonList("Daily Kuudra ($done/2 killed)")) + display.add(Collections.singletonList("§7Daily Kuudra (§e$done§8/§e3 killed§7)")) if (done != 2) { for (tier in kuudraTiers) { val result = if (tier.doneToday) "§7Done" else "§bTodo" @@ -129,7 +129,6 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH private fun updateAllKuudraDone() { allKuudraDone = !kuudraTiers.any { !it.doneToday } - println("allKuudraDone: $allKuudraDone") } private fun getByDisplayName(name: String) = kuudraTiers.firstOrNull { it.name == name } 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 b2d4a367f..47f79d786 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 @@ -26,7 +26,7 @@ import java.util.* class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { - private val townBoardMage = LorenzVec(-138, 92, -754) + private val townBoardMage = LorenzVec(-138, 92, -755) private val townBoardBarbarian = LorenzVec(-572, 100, -687) private var tick = 0 @@ -224,19 +224,18 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { fun render(display: MutableList<List<Any>>) { val done = quests.count { it.state == QuestState.COLLECTED } display.add(Collections.singletonList("")) - display.add(Collections.singletonList("Daily Quests ($done/5 collected)")) + display.add(Collections.singletonList("§7Daily Quests (§e$done§8/§e5 collected§7)")) if (done != 5) { quests.mapTo(display) { renderQuest(it) } } } private fun renderQuest(quest: Quest): List<Any> { - val type = quest.category.displayName + val category = quest.category val state = quest.state.displayName val stateColor = quest.state.color - val displayName = quest.displayName - val multipleText = if (quest is ProgressQuest && quest.state != QuestState.COLLECTED) { + val progressText = if (quest is ProgressQuest && quest.state != QuestState.COLLECTED) { val haveAmount = quest.haveAmount val needAmount = quest.needAmount " §e$haveAmount§8/§e$needAmount" @@ -266,17 +265,31 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { } val result = mutableListOf<Any>() - val item = quest.displayItem - if (item == null) { - result.add(" $stateText$type: §f$displayName$multipleText$sacksText") + val internalItemName = quest.displayItem + + val displayName = if (category == QuestCategory.FETCH || category == QuestCategory.FISHING) { + if (internalItemName != null) { + val name = NEUItems.getItemStack(internalItemName).name + if (category == QuestCategory.FISHING) { + name!!.split(" ").dropLast(1).joinToString(" ") + } else name + + } else { + quest.displayName + } + } else quest.displayName + + val categoryName = category.displayName + if (internalItemName == null) { + result.add(" $stateText$categoryName: §f$displayName$progressText$sacksText") } else { - result.add(" $stateText$type: ") + result.add(" $stateText$categoryName: ") try { - result.add(NEUItems.getItemStack(item)) + result.add(NEUItems.getItemStack(internalItemName)) } catch (e: RuntimeException) { e.printStackTrace() } - result.add("§f$displayName$multipleText$sacksText") + result.add("§f$displayName$progressText$sacksText") } return result } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/DojoQuest.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/DojoQuest.kt index 2328e963f..afd7d33d4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/DojoQuest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/DojoQuest.kt @@ -16,5 +16,5 @@ class DojoQuest( QuestCategory.DOJO, "$dojoName Rank $dojoRankGoal", state, - "$dojoName (" + LorenzUtils.getPointsForDojoRank(dojoRankGoal) + " points)" + "$dojoName §7(§e" + LorenzUtils.getPointsForDojoRank(dojoRankGoal) + " points§7)" ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestCategory.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestCategory.kt index 6cef4782a..f9987fe1c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestCategory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/quest/QuestCategory.kt @@ -8,5 +8,5 @@ enum class QuestCategory(val displayName: String) { DOJO("Dojo Task"), KUUDRA("Kuudra Kill"), - UNKNOWN("§cUnknown"), + UNKNOWN("§4Unknown"), }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt index f52d038ab..0eaa0be66 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt @@ -76,10 +76,10 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel fun render(display: MutableList<List<Any>>) { val done = miniBosses.count { it.doneToday } display.add(Collections.singletonList("")) - display.add(Collections.singletonList("Daily Bosses ($done/5 killed)")) + display.add(Collections.singletonList("§7Daily Bosses (§e$done§8/§e5 killed§7)")) if (done != 5) { for (miniBoss in miniBosses) { - val result = if (miniBoss.doneToday) "§7Done" else "§bTodo" + val result = if (miniBoss.doneToday) "§aDone" else "§bTodo" val displayName = miniBoss.displayName val displayItem = miniBoss.displayItem if (displayItem == null) { @@ -88,7 +88,7 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel val lineList = mutableListOf<Any>() lineList.add(" ") lineList.add(NEUItems.getItemStack(displayItem)) - lineList.add("$displayName: $result") + lineList.add("§5$displayName§7: $result") display.add(lineList) } } |