aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2024-08-29 00:53:36 +1000
committerGitHub <noreply@github.com>2024-08-28 16:53:36 +0200
commit23a09500c31057d76a6b6d09be2bf33c0f13cee6 (patch)
treeb2dfd5f77fd253deed4bf24391d1736fe90d7780
parent9cedfec16e4a80819f19755cef15a7d8a646e877 (diff)
downloadnotenoughupdates-23a09500c31057d76a6b6d09be2bf33c0f13cee6.tar.gz
notenoughupdates-23a09500c31057d76a6b6d09be2bf33c0f13cee6.tar.bz2
notenoughupdates-23a09500c31057d76a6b6d09be2bf33c0f13cee6.zip
Add average milestone and upgrade tooltips to garden pv page (#1337)
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/profileviewer/GardenPage.kt15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/profileviewer/GardenPage.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/profileviewer/GardenPage.kt
index 776a922e..cd23cfec 100644
--- a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/profileviewer/GardenPage.kt
+++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/profileviewer/GardenPage.kt
@@ -259,6 +259,7 @@ class GardenPage(pvInstance: GuiProfileViewer) : GuiProfileViewerPage(pvInstance
Utils.renderShadowedString("§eCrop Upgrades", xPos + 70, yPos + 5, 105)
+ var averageUpgrade = 0
for ((index, crop) in CropType.values().withIndex()) {
if (index == 5) {
yPos = startHeight
@@ -267,6 +268,7 @@ class GardenPage(pvInstance: GuiProfileViewer) : GuiProfileViewerPage(pvInstance
yPos += 14
val upgradeLevel = gardenData?.cropUpgradeLevels?.get(crop) ?: 0
+ averageUpgrade += upgradeLevel
val itemStack = manager.createItem(crop.itemId)
Utils.drawItemStack(itemStack, xPos + 2, yPos)
@@ -301,6 +303,11 @@ class GardenPage(pvInstance: GuiProfileViewer) : GuiProfileViewerPage(pvInstance
instance.tooltipToDisplay = tooltip
}
}
+ val x = guiLeft + 70 + 26 - 42
+ val y = startHeight + 5
+ if (mouseX in x..(x + 80) && mouseY in y..(y + 13)) {
+ instance.tooltipToDisplay = listOf("§eAverage Upgrade ${averageUpgrade/10}")
+ }
}
private fun renderCropMilestones() {
@@ -310,6 +317,7 @@ class GardenPage(pvInstance: GuiProfileViewer) : GuiProfileViewerPage(pvInstance
Utils.renderShadowedString("§eCrop Milestones", xPos + 70, yPos + 5, 105)
+ var averageMilestone = 0
for ((index, crop) in CropType.values().withIndex()) {
if (index == 5) {
yPos = startHeight
@@ -377,7 +385,14 @@ class GardenPage(pvInstance: GuiProfileViewer) : GuiProfileViewerPage(pvInstance
50,
tooltip
)
+ averageMilestone += collectionLevel
+ }
+ val x = guiLeft + 70 + 26 - 42
+ val y = startHeight + 5
+ if (mouseX in x..(x + 80) && mouseY in y..(y + 13)) {
+ instance.tooltipToDisplay = listOf("§eAverage Milestone ${averageMilestone/10}")
}
+
}
private fun renderVisitorStats() {