From 754e41275d0d67cf5043c2fafbbb4006153fcd74 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:43:00 +0100 Subject: Using visitor amount from repo to calculate the green thumb bonus in /ff. --- src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt | 2 ++ .../skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt index 01a6d3827..75fd7e9d2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -51,6 +51,7 @@ object GardenAPI { private var inBarn = false val onBarnPlot get() = inBarn && inGarden() val storage get() = ProfileStorageData.profileSpecific?.garden + var totalAmountVisitorsExisting = 0 var gardenExp: Long? get() = storage?.experience set(value) { @@ -239,6 +240,7 @@ object GardenAPI { fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Garden") gardenExperience = data.garden_exp + totalAmountVisitorsExisting = data.visitors.size } private var gardenExperience = listOf() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt index 4e06ee1cb..44beaca34 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide.pages +import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.currentArmor import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.currentEquipment @@ -204,10 +205,11 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { if (currentEquipment == 0) 60 else 15, FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + val maxGreenThumbFortune = GardenAPI.totalAmountVisitorsExisting.toDouble() / 4 line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's enchantments\n§2Select a piece for more info" else "§7§2Total enchantment fortune from your\n${equipmentItem.getItem().displayName}" GuiRenderUtils.drawFarmingBar("§2$word Enchantment", line, equipmentFF[FFTypes.GREEN_THUMB] ?: 0, - if (currentEquipment == 0) 78 else 19.5, + if (currentEquipment == 0) maxGreenThumbFortune * 4 else maxGreenThumbFortune, FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) } -} \ No newline at end of file +} -- cgit