Skip to content

Commit

Permalink
improved readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Chissl committed Dec 24, 2024
1 parent f9df650 commit bd97b49
Showing 1 changed file with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ object FarmingFortuneDisplay {
}
} else getCurrentFarmingFortune()

list.add(
Renderable.string(
(if (config.compactFormat) "§6FF§7: " else "§6Farming Fortune§7: ") + (if (ffReduction > 0) "§c" else "§e") +
if (!recentlySwitchedTool && farmingFortune != -1.0) {
farmingFortune.roundTo(0).addSeparators()
} else "§7" + (displayCrop.getLatestTrueFarmingFortune()?.addSeparators() ?: "?"),
),
)
val farmingFortuneText = if (config.compactFormat) "§6FF§7: " else "§6Farming Fortune§7: "
val fortuneColorCode = if (ffReduction > 0) "§c" else "§e"
val fortuneAmount = if (!recentlySwitchedTool && farmingFortune != -1.0) {
farmingFortune.roundTo(0).addSeparators()
} else "§7" + (displayCrop.getLatestTrueFarmingFortune()?.addSeparators() ?: "?")

list.add(Renderable.string(farmingFortuneText + fortuneColorCode + fortuneAmount))

add(Renderable.horizontalContainer(list))

if (ffReduction > 0) {
Expand All @@ -191,13 +191,12 @@ object FarmingFortuneDisplay {
}

if (wrongTabCrop && !config.hideMissingFortuneWarnings) {
var text = ""
if (config.compactFormat) {
text = "§cInaccurate!"
} else {
text = "§cBreak §e${GardenAPI.cropInHand?.cropName}§c to see"
if (farmingFortune != -1.0) text += " latest"
text += " fortune!"
val latest = if (farmingFortune != -1.0) " latest" else ""
val text = when {
config.compactFormat -> "§cInaccurate!"
else -> {
"§cBreak §e${GardenAPI.cropInHand?.cropName}§c to see" + latest + " fortune!"
}
}
add(Renderable.string(text))
}
Expand Down

0 comments on commit bd97b49

Please sign in to comment.