aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/event
diff options
context:
space:
mode:
authorObsidian <108832807+Obsidianninja11@users.noreply.github.com>2024-06-30 04:44:09 -0500
committerGitHub <noreply@github.com>2024-06-30 11:44:09 +0200
commitdd24ac5cbd234b656ac69804fa34059d08767fda (patch)
tree7c79cb7c71785cacec6607c1a44c8a5a88b10dfc /src/main/java/at/hannibal2/skyhanni/features/event
parent20f2a1c9ecb79f39f4c95eaf30a55f1279988e35 (diff)
downloadskyhanni-dd24ac5cbd234b656ac69804fa34059d08767fda.tar.gz
skyhanni-dd24ac5cbd234b656ac69804fa34059d08767fda.tar.bz2
skyhanni-dd24ac5cbd234b656ac69804fa34059d08767fda.zip
Improvement: Make unclaimed eggs gui clickable (#1934)
Co-authored-by: Cal <cwolfson58@gmail.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/event')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt
index f340ff0d8..13afcac42 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt
@@ -16,7 +16,7 @@ import at.hannibal2.skyhanni.utils.HypixelCommands
import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
-import at.hannibal2.skyhanni.utils.RenderUtils.renderStrings
+import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables
import at.hannibal2.skyhanni.utils.SimpleTimeMark
import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.asTimeMark
import at.hannibal2.skyhanni.utils.SimpleTimeMark.Companion.fromNow
@@ -25,6 +25,7 @@ import at.hannibal2.skyhanni.utils.SkyBlockTime
import at.hannibal2.skyhanni.utils.SoundUtils
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import at.hannibal2.skyhanni.utils.TimeUtils.format
+import at.hannibal2.skyhanni.utils.renderables.Renderable
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.util.regex.Matcher
import kotlin.time.Duration.Companion.seconds
@@ -195,14 +196,13 @@ object HoppityEggsManager {
// TODO move logic into second passed event and cache
@SubscribeEvent
- fun onRenderOverlay(event: GuiRenderEvent.GuiOverlayRenderEvent) {
+ fun onRenderOverlay(event: GuiRenderEvent) {
if (!isActive()) return
if (!config.showClaimedEggs) return
if (isBusy()) return
- val displayList = HoppityEggType.entries
- .map { "§7 - ${it.formattedName} ${it.timeUntil().format()}" }
- .toMutableList()
+ val displayList =
+ HoppityEggType.entries.map { "§7 - ${it.formattedName} ${it.timeUntil().format()}" }.toMutableList()
displayList.add(0, "§bUnclaimed Eggs:")
if (config.showCollectedLocationCount && LorenzUtils.inSkyBlock) {
@@ -215,7 +215,12 @@ object HoppityEggsManager {
}
if (displayList.size == 1) return
- config.position.renderStrings(displayList, posLabel = "Hoppity Eggs")
+ val clickableDisplayList = listOf(Renderable.clickAndHover(
+ Renderable.verticalContainer(displayList.map(Renderable::string)),
+ tips = listOf("§eClick to ${"/warp ${config.warpDestination}".trim()}!"),
+ onClick = { HypixelCommands.warp(config.warpDestination) }
+ ))
+ config.position.renderRenderables(clickableDisplayList, posLabel = "Hoppity Eggs")
}
private fun formatEggsCollected(collectedEggs: Int): String =
@@ -257,7 +262,7 @@ object HoppityEggsManager {
ChatUtils.clickableChat(
message,
onClick = { HypixelCommands.warp(config.warpDestination) },
- "§eClick to /warp ${config.warpDestination}!"
+ "§eClick to ${"/warp ${config.warpDestination}".trim()}!"
)
} else {
ChatUtils.clickableChat(