aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorDavid Cole <40234707+DavidArthurCole@users.noreply.github.com>2024-07-21 06:37:23 -0400
committerGitHub <noreply@github.com>2024-07-21 12:37:23 +0200
commitc4c0b5e80d506ef1f7811603dd1611da5a4b84bb (patch)
treec4455d49a21383869d6c29757d5e9dc68e2256a0 /src/main/java/at
parent30ad6049a0f84e2e7be6fe9c4e6ade9dcf159bf7 (diff)
downloadskyhanni-c4c0b5e80d506ef1f7811603dd1611da5a4b84bb.tar.gz
skyhanni-c4c0b5e80d506ef1f7811603dd1611da5a4b84bb.tar.bz2
skyhanni-c4c0b5e80d506ef1f7811603dd1611da5a4b84bb.zip
Improvement: Add Toggle for Unclaimed Egg Warp (#2211)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt19
2 files changed, 11 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java
index de86e01c4..52aaa8aed 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/event/HoppityEggsConfig.java
@@ -83,7 +83,7 @@ public class HoppityEggsConfig {
public boolean warnUnclaimedEggs = false;
@Expose
- @ConfigOption(name = "Click to Warp", desc = "Make the eggs ready chat message clickable to warp you to an island.")
+ @ConfigOption(name = "Click to Warp", desc = "Make the eggs ready chat message & unclaimed timer display clickable to warp you to an island.")
@ConfigEditorBoolean
public boolean warpUnclaimedEggs = false;
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<Renderable> {
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 =