aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ChatUtils.kt4
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()
})
}