aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-08-03 21:31:57 +0200
committernea <nea@nea.moe>2023-08-03 21:55:21 +0200
commit67a47c003c76cebc7d57e789c114b62313a543fe (patch)
tree366b036244bfd8dd325d97f65e265fdc30508325 /src/main/java/at/hannibal2/skyhanni/features
parent5198a5eca8257ee05e4846dc7ef46c983f7752d0 (diff)
downloadskyhanni-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.kt10
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
}