diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/FarmingFortuneConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/FarmingFortuneConfig.java index a1cb92be0269..1a31b2a11ba6 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/FarmingFortuneConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/FarmingFortuneConfig.java @@ -19,6 +19,16 @@ public class FarmingFortuneConfig { @FeatureToggle public boolean display = false; + @Expose + @ConfigOption(name = "Compact Format", desc = "Compact the farming fortune display.") + @ConfigEditorBoolean + public boolean compactFormat = false; + + @Expose + @ConfigOption(name = "Hide Missing Fortune Warnings", desc = "Hide missing fortune warnings from the display.") + @ConfigEditorBoolean + public boolean hideMissingFortuneWarnings = false; + @ConfigOption(name = "Farming Fortune Guide", desc = "Open a guide that breaks down your Farming Fortune.\n§eCommand: /ff") @ConfigEditorButton(buttonText = "Open") public Runnable open = FFGuideGUI::onCommand; diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt index 0dc6ce28cf15..68eccc6cf405 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -163,6 +163,7 @@ object FarmingFortuneDisplay { var recentlySwitchedTool = lastToolSwitch.passedSince() < 1.5.seconds val wrongTabCrop = GardenAPI.cropInHand != null && GardenAPI.cropInHand != currentCrop + val ffReduction = getPestFFReduction() val farmingFortune = if (wrongTabCrop) { (displayCrop.getLatestTrueFarmingFortune() ?: -1.0).also { @@ -170,30 +171,43 @@ object FarmingFortuneDisplay { } } else getCurrentFarmingFortune() - list.add( - Renderable.string( - "§6Farming Fortune§7: §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)) - val ffReduction = getPestFFReduction() if (ffReduction > 0) { - add(Renderable.string("§cPests are reducing your fortune by §e$ffReduction%§c!")) + add( + Renderable.string( + if (config.compactFormat) "§cPests: §7-§e$ffReduction%" + else "§cPests are reducing your fortune by §e$ffReduction%§c!" + ) + ) } - if (wrongTabCrop) { - var text = "§cBreak §e${GardenAPI.cropInHand?.cropName}§c to see" - if (farmingFortune != -1.0) text += " latest" - text += " fortune!" - + if (wrongTabCrop && !config.hideMissingFortuneWarnings) { + 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)) } } private fun drawMissingFortuneDisplay(cropFortune: Boolean) = buildList { + if (config.hideMissingFortuneWarnings) return@buildList + if (config.compactFormat) { + add(Renderable.string("§cInaccurate!")) + return@buildList + } if (cropFortune) { add( Renderable.clickAndHover(