From 388a656c95c745c8cced86931e9ab30e10e3bb9e Mon Sep 17 00:00:00 2001 From: Obsidian <108832807+Obsidianninja11@users.noreply.github.com> Date: Wed, 15 May 2024 23:55:23 -0800 Subject: Improvement: Better Hoppity Egg Warning (#1802) --- src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt index 728fa667b..1448cd250 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt @@ -126,6 +126,7 @@ object ChatUtils { * Sends a message to the user that they can click and run an action * @param message The message to be sent * @param onClick The runnable to be executed when the message is clicked + * @param hover The string to be shown when the message is hovered * @param expireAt When the click action should expire, default never * @param prefix Whether to prefix the message with the chat prefix, default true * @param prefixColor Color that the prefix should be, default yellow (§e) @@ -135,6 +136,7 @@ object ChatUtils { fun clickableChat( message: String, onClick: () -> Any, + hover: String = "§eClick here!", expireAt: SimpleTimeMark = SimpleTimeMark.farFuture(), prefix: Boolean = true, prefixColor: String = "§e", @@ -143,7 +145,7 @@ object ChatUtils { val msgPrefix = if (prefix) prefixColor + CHAT_PREFIX else "" chat(Text.text(msgPrefix + message) { this.onClick(expireAt, oneTimeClick, onClick) - this.hover = "§eClick here!".asComponent() + this.hover = hover.asComponent() }) } -- cgit