From 23a09500c31057d76a6b6d09be2bf33c0f13cee6 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:53:36 +1000 Subject: Add average milestone and upgrade tooltips to garden pv page (#1337) --- .../miscfeatures/profileviewer/GardenPage.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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() { -- cgit