diff options
author | Obsidian <108832807+Obsidianninja11@users.noreply.github.com> | 2024-05-15 23:55:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 09:55:23 +0200 |
commit | 388a656c95c745c8cced86931e9ab30e10e3bb9e (patch) | |
tree | 9dab00b107dbbcf7f52f02e6ffac393cb60b209e /src/main/java/at/hannibal2/skyhanni/utils | |
parent | 5d4c57e8afa664d25be6fdaaf1e82a6e7b195ecd (diff) | |
download | skyhanni-388a656c95c745c8cced86931e9ab30e10e3bb9e.tar.gz skyhanni-388a656c95c745c8cced86931e9ab30e10e3bb9e.tar.bz2 skyhanni-388a656c95c745c8cced86931e9ab30e10e3bb9e.zip |
Improvement: Better Hoppity Egg Warning (#1802)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt | 4 |
1 files changed, 3 insertions, 1 deletions
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() }) } |