diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-19 15:55:02 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-19 15:55:02 +0100 |
commit | 51912a4500ab8fd3c36776bb503631db143a57f7 (patch) | |
tree | 5fb4216533e345e5d932ff62560a7985243fb2f4 /src/main/java/at/hannibal2/skyhanni/features/garden | |
parent | 1aa908bfe97a057b3fba26e3052ef96cc451253c (diff) | |
download | skyhanni-51912a4500ab8fd3c36776bb503631db143a57f7.tar.gz skyhanni-51912a4500ab8fd3c36776bb503631db143a57f7.tar.bz2 skyhanni-51912a4500ab8fd3c36776bb503631db143a57f7.zip |
Added nextJacobContestOtherGuis support to always show jacob farming contest
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/garden')
3 files changed, 16 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt index 8af8bf742..a0a58ffb2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt @@ -77,7 +77,7 @@ class CropMoneyDisplay { } else { for ((internalName, moneyPerHour) in map.sortedDesc()) { number++ - val cropName = cropNames[internalName] + val cropName = cropNames[internalName]!! val isCurrent = cropName == GardenAPI.cropInHand if (number > config.moneyPerHourShowOnlyBest && !isCurrent) continue @@ -93,7 +93,8 @@ class CropMoneyDisplay { val format = LorenzUtils.formatInteger(moneyPerHour.toLong()) val itemName = NEUItems.getItemStack(internalName).name?.removeColor() ?: continue val color = if (isCurrent) "§e" else "§7" - list.add("$color$itemName§7: §6$format") + val contestFormat = if (GardenNextJacobContest.isNextCrop(cropName)) "§n" else "" + list.add("$color$contestFormat$itemName§7: §6$format") newDisplay.add(list) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt index bea64af34..6bbe18953 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt @@ -42,12 +42,13 @@ class GardenBestCropTime { for (cropName in sorted.keys) { val millis = timeTillNextCrop[cropName]!! val duration = TimeUtils.formatDuration(millis) - val isCurrent = cropName == currentCrop - val color = if (isCurrent) "§e" else "" number++ if (number > config.cropMilestoneShowOnlyBest && !isCurrent) continue - val cropNameDisplay = "§7$number# $color$cropName" + + val color = if (isCurrent) "§e" else "" + val contestFormat = if (GardenNextJacobContest.isNextCrop(cropName)) "§n" else "" + val cropNameDisplay = "§7$number# $color$contestFormat$cropName§r" if (gardenExp) { val crops = GardenCropMilestones.cropCounter[cropName]!! val currentTier = GardenCropMilestones.getTierForCrops(crops) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt index ec50cc911..39d6927bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -17,7 +17,6 @@ import java.time.Instant import java.util.regex.Pattern class GardenNextJacobContest { - private val config get() = SkyHanniMod.feature.garden private val display = mutableListOf<Any>() private var tick = 0 private var contests = mutableMapOf<Long, FarmingContest>() @@ -121,6 +120,7 @@ class GardenNextJacobContest { class FarmingContest(val endTime: Long, val crops: List<String>) private fun update() { + nextContestCrops.clear() val newDisplay = drawDisplay() display.clear() display.addAll(newDisplay) @@ -172,6 +172,7 @@ class GardenNextJacobContest { for (crop in nextContest.crops) { list.add(" ") GardenAPI.addGardenCropToList(crop, list) + nextContestCrops.add(crop) } val format = TimeUtils.formatDuration(duration) list.add("§7(§b$format§7)") @@ -196,4 +197,11 @@ class GardenNextJacobContest { private fun isEnabled() = LorenzUtils.inSkyBlock && config.nextJacobContestDisplay && (GardenAPI.inGarden() || config.nextJacobContestEverywhere) + + companion object { + private val config get() = SkyHanniMod.feature.garden + private val nextContestCrops = mutableListOf<String>() + + fun isNextCrop(cropName: String) = nextContestCrops.contains(cropName) && config.nextJacobContestOtherGuis + } }
\ No newline at end of file |