From c4c0b5e80d506ef1f7811603dd1611da5a4b84bb Mon Sep 17 00:00:00 2001 From: David Cole <40234707+DavidArthurCole@users.noreply.github.com> Date: Sun, 21 Jul 2024 06:37:23 -0400 Subject: Improvement: Add Toggle for Unclaimed Egg Warp (#2211) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../event/hoppity/HoppityEggDisplayManager.kt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/event') diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt index 06948f27a..f09aa4eac 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt @@ -72,14 +72,14 @@ object HoppityEggDisplayManager { private fun updateDisplay(): List { if (!HoppityEggsManager.isActive()) return emptyList() - if (!HoppityEggsManager.config.showClaimedEggs) return emptyList() - if (ReminderUtils.isBusy() && !HoppityEggsManager.config.showWhileBusy) return emptyList() + if (!config.showClaimedEggs) return emptyList() + if (ReminderUtils.isBusy() && !config.showWhileBusy) return emptyList() val displayList = HoppityEggType.entries.map { "§7 - ${it.formattedName} ${it.timeUntil().format()}" }.toMutableList() displayList.add(0, "§bUnclaimed Eggs:") - if (HoppityEggsManager.config.showCollectedLocationCount && LorenzUtils.inSkyBlock) { + if (config.showCollectedLocationCount && LorenzUtils.inSkyBlock) { val totalEggs = HoppityEggLocations.islandLocations.size if (totalEggs > 0) { val collectedEggs = HoppityEggLocations.islandCollectedLocations.size @@ -89,12 +89,13 @@ object HoppityEggDisplayManager { } if (displayList.size == 1) return emptyList() + val container = Renderable.verticalContainer(displayList.map(Renderable::string)) return listOf( - Renderable.clickAndHover( - Renderable.verticalContainer(displayList.map(Renderable::string)), - tips = listOf("§eClick to ${"/warp ${HoppityEggsManager.config.warpDestination}".trim()}!"), - onClick = { HypixelCommands.warp(HoppityEggsManager.config.warpDestination) }, - ), + if (config.warpUnclaimedEggs) Renderable.clickAndHover( + container, + tips = listOf("§eClick to ${"/warp ${config.warpDestination}".trim()}!"), + onClick = { HypixelCommands.warp(config.warpDestination) }, + ) else container ) } @@ -102,7 +103,7 @@ object HoppityEggDisplayManager { @SubscribeEvent fun onRenderOverlay(event: GuiRenderEvent) { if (!HoppityEggsManager.isActive()) return - HoppityEggsManager.config.position.renderRenderables(display, posLabel = "Hoppity Eggs") + config.position.renderRenderables(display, posLabel = "Hoppity Eggs") } private fun formatEggsCollected(collectedEggs: Int): String = -- cgit