diff options
author | nea <nea@nea.moe> | 2023-08-03 21:31:57 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-08-03 21:55:21 +0200 |
commit | 67a47c003c76cebc7d57e789c114b62313a543fe (patch) | |
tree | 366b036244bfd8dd325d97f65e265fdc30508325 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 5198a5eca8257ee05e4846dc7ef46c983f7752d0 (diff) | |
download | skyhanni-67a47c003c76cebc7d57e789c114b62313a543fe.tar.gz skyhanni-67a47c003c76cebc7d57e789c114b62313a543fe.tar.bz2 skyhanni-67a47c003c76cebc7d57e789c114b62313a543fe.zip |
Add structured chat component support to chat filter
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilterGui.kt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilterGui.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilterGui.kt index f9566cdf1..8f346ddea 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilterGui.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilterGui.kt @@ -11,6 +11,7 @@ import net.minecraft.client.gui.GuiUtilRenderComponents import net.minecraft.client.gui.ScaledResolution import net.minecraft.client.renderer.GlStateManager import net.minecraft.util.IChatComponent +import org.lwjgl.input.Keyboard import org.lwjgl.input.Mouse class ChatFilterGui(private val history: List<ChatManager.MessageFilteringResult>) : GuiScreen() { @@ -63,8 +64,13 @@ class ChatFilterGui(private val history: List<ChatManager.MessageFilteringResult ) } if (mouseX in 0..w && mouseY in 0..(size * 10) && (isMouseButtonDown && !wasMouseButtonDown)) { - OSUtils.copyToClipboard(msg.message.formattedText) - LorenzUtils.chat("Copied to clipboard") + if (LorenzUtils.isShiftKeyDown()) { + OSUtils.copyToClipboard(IChatComponent.Serializer.componentToJson(msg.message)) + LorenzUtils.chat("Copied structured chat line to clipboard") + } else { + OSUtils.copyToClipboard(msg.message.formattedText) + LorenzUtils.chat("Copied chat line to clipboard") + } } mouseY -= size * 10 } |