aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-03-19 11:51:30 +0100
committerGitHub <noreply@github.com>2024-03-19 11:51:30 +0100
commit486761ae31c9d81910b4944aaa47418a009d04b1 (patch)
treef54b41d143af7cc4194c21d90e38445e425f7b59 /src/main/java/at/hannibal2/skyhanni
parent26a014864e5806b3155c24547c3dce32de4bd66a (diff)
downloadskyhanni-486761ae31c9d81910b4944aaa47418a009d04b1.tar.gz
skyhanni-486761ae31c9d81910b4944aaa47418a009d04b1.tar.bz2
skyhanni-486761ae31c9d81910b4944aaa47418a009d04b1.zip
Fix: Crash in /ff (#1217)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt12
1 files changed, 8 insertions, 4 deletions
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 fb52aa54c..ed3023eae 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
@@ -26,14 +26,14 @@ class OverviewPage : FFGuideGUI.FFGuidePage() {
FFGuideGUI.guiLeft + 15, FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay
)
- var line = if (FFStats.baseFF[FFTypes.ANITA]!! < 0.0) "§cAnita buff not saved\n§eVisit Anita to set it!"
+ var line = if (FFTypes.ANITA.notSaved()) "§cAnita buff not saved\n§eVisit Anita to set it!"
else "§7§2Fortune for levelling your Anita extra crops\n§2You get 4☘ per buff level"
GuiRenderUtils.drawFarmingBar(
"§2Anita Buff", line, FFStats.baseFF[FFTypes.ANITA] ?: 0.0, 60, FFGuideGUI.guiLeft + 15,
FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay
)
- line = if (FFStats.baseFF[FFTypes.FARMING_LVL]!! < 0.0) "§cFarming level not saved\n§eOpen /skills to set it!"
+ line = if (FFTypes.FARMING_LVL.notSaved()) "§cFarming level not saved\n§eOpen /skills to set it!"
else "§7§2Fortune for levelling your farming skill\n§2You get 4☘ per farming level"
GuiRenderUtils.drawFarmingBar(
"§2Farming Level", line, FFStats.baseFF[FFTypes.FARMING_LVL] ?: 0.0, 240, FFGuideGUI.guiLeft + 15,
@@ -41,7 +41,7 @@ class OverviewPage : FFGuideGUI.FFGuidePage() {
)
line =
- if (FFStats.baseFF[FFTypes.COMMUNITY_SHOP]!! < 0.0) "§cCommunity upgrade level not saved\n§eVisit Elizabeth to set it!"
+ if (FFTypes.COMMUNITY_SHOP.notSaved()) "§cCommunity upgrade level not saved\n§eVisit Elizabeth to set it!"
else "§7§2Fortune for community shop upgrades\n§2You get 4☘ per upgrade tier"
GuiRenderUtils.drawFarmingBar(
"§2Community upgrades", line, FFStats.baseFF[FFTypes.COMMUNITY_SHOP] ?: 0.0,
@@ -49,7 +49,7 @@ class OverviewPage : FFGuideGUI.FFGuidePage() {
)
line =
- if (FFStats.baseFF[FFTypes.PLOTS]!! < 0.0) "§cUnlocked plot count not saved\n§eOpen /desk and view your plots to set it!"
+ if (FFTypes.PLOTS.notSaved()) "§cUnlocked plot count not saved\n§eOpen /desk and view your plots to set it!"
else "§7§2Fortune for unlocking garden plots\n§2You get 3☘ per plot unlocked"
GuiRenderUtils.drawFarmingBar(
"§2Garden Plots", line, FFStats.baseFF[FFTypes.PLOTS] ?: 0.0, 72, FFGuideGUI.guiLeft + 15,
@@ -263,4 +263,8 @@ class OverviewPage : FFGuideGUI.FFGuidePage() {
FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay
)
}
+
+ private fun FFTypes.notSaved(): Boolean = FFStats.baseFF[this]?.let {
+ it < 0.0
+ } ?: true
}