aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-22 11:43:00 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-22 11:43:00 +0100
commit754e41275d0d67cf5043c2fafbbb4006153fcd74 (patch)
treed6927443cf1f17d8ba98d8db5cc0c6a36452f4c5
parentab13293cdad056ccc4552ec339cf2b9d86a0cbd6 (diff)
downloadskyhanni-754e41275d0d67cf5043c2fafbbb4006153fcd74.tar.gz
skyhanni-754e41275d0d67cf5043c2fafbbb4006153fcd74.tar.bz2
skyhanni-754e41275d0d67cf5043c2fafbbb4006153fcd74.zip
Using visitor amount from repo to calculate the green thumb bonus in /ff.
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt6
2 files changed, 6 insertions, 2 deletions
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<GardenJson>("Garden")
gardenExperience = data.garden_exp
+ totalAmountVisitorsExisting = data.visitors.size
}
private var gardenExperience = listOf<Int>()
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
+}