diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-04 18:59:20 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-04 18:59:20 +0200 |
commit | b1be5758a2543df639c427038b61a86ea0e0cae6 (patch) | |
tree | 775d18f1c3c9a2f0c01e7dfee610673b67b0a966 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 953682bd6b0c43b6caa9327b97eedaa1c31dcc82 (diff) | |
download | skyhanni-b1be5758a2543df639c427038b61a86ea0e0cae6.tar.gz skyhanni-b1be5758a2543df639c427038b61a86ea0e0cae6.tar.bz2 skyhanni-b1be5758a2543df639c427038b61a86ea0e0cae6.zip |
Added Best Crop Time Compact Display - Make the best crop time more compact by removing the crop name and exp and making the time format shorter
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt | 15 |
1 files changed, 11 insertions, 4 deletions
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 139573899..003bcde11 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenBestCropTime.kt @@ -34,7 +34,11 @@ class GardenBestCropTime { } val title = if (gardenExp) "§2Garden Experience" else "§bSkyBlock Level" - newList.addAsSingletonList("§eBest Crop Time §7($title§7)") + if (config.cropMilestoneBestCompact) { + newList.addAsSingletonList("§eBest Crop Time") + } else { + newList.addAsSingletonList("§eBest Crop Time §7($title§7)") + } if (sorted.isEmpty()) { newList.addAsSingletonList("§cFarm crops to add them to this list!") @@ -44,7 +48,8 @@ class GardenBestCropTime { var number = 0 for (crop in sorted.keys) { val millis = timeTillNextCrop[crop]!! - val duration = TimeUtils.formatDuration(millis) + val maxUnits = if (config.cropMilestoneBestCompact) 2 else -1 + val duration = TimeUtils.formatDuration(millis, maxUnits = maxUnits) val isCurrent = crop == currentCrop number++ if (number > config.cropMilestoneShowOnlyBest && !isCurrent) continue @@ -56,10 +61,12 @@ class GardenBestCropTime { val color = if (isCurrent) "§e" else "§7" val contestFormat = if (GardenNextJacobContest.isNextCrop(crop)) "§n" else "" val nextTier = GardenCropMilestones.getTierForCrops(crop.getCounter()) + 1 - val cropNameDisplay = "$color$contestFormat${crop.cropName} $nextTier§r" + + val cropName = if (!config.cropMilestoneBestCompact) crop.cropName +" " else "" + val cropNameDisplay = "$color$contestFormat$cropName$nextTier§r" list.add("$cropNameDisplay §b$duration") - if (gardenExp) { + if (gardenExp && !config.cropMilestoneBestCompact) { val gardenExpForTier = getGardenExpForTier(nextTier) list.add(" §7(§2$gardenExpForTier §7Exp)") } |