diff --git a/src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/gui/MixinChatScreen.java b/src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/gui/MixinChatScreen.java index 0caed3f83e1..60f55d8f5e1 100644 --- a/src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/gui/MixinChatScreen.java +++ b/src/main/java/net/ccbluex/liquidbounce/injection/mixins/minecraft/gui/MixinChatScreen.java @@ -21,8 +21,10 @@ import net.ccbluex.liquidbounce.event.EventManager; import net.ccbluex.liquidbounce.event.events.ChatSendEvent; +import net.ccbluex.liquidbounce.event.events.NotificationEvent; import net.ccbluex.liquidbounce.features.module.modules.misc.betterchat.ModuleBetterChat; import net.ccbluex.liquidbounce.interfaces.ChatHudAddition; +import net.ccbluex.liquidbounce.utils.client.ClientUtilsKt; import net.minecraft.client.gui.hud.ChatHud; import net.minecraft.client.gui.hud.ChatHudLine; import net.minecraft.client.gui.screen.ChatScreen; @@ -69,7 +71,7 @@ private void handleChatMessage(String chatText, boolean addToHistory, CallbackIn @Inject(method = "mouseClicked", at = @At("HEAD")) private void hookMouseClicked(double mouseX, double mouseY, int button, CallbackInfoReturnable cir) { - if (!(ModuleBetterChat.INSTANCE.getRunning() && ModuleBetterChat.INSTANCE.getCopy())) { + if (!(ModuleBetterChat.INSTANCE.getRunning() && ModuleBetterChat.Copy.INSTANCE.getRunning())) { return; } @@ -114,6 +116,14 @@ private void copyMessage(List messageParts, int button) { if (isPressed(GLFW.GLFW_KEY_LEFT_SHIFT, GLFW.GLFW_KEY_RIGHT_SHIFT) && button == GLFW.GLFW_MOUSE_BUTTON_1) { client.keyboard.setClipboard(builder.toString()); + + if (ModuleBetterChat.Copy.INSTANCE.getNotification()) { + ClientUtilsKt.notification( + "ChatCopy", + "The line is copied", + NotificationEvent.Severity.SUCCESS + ); + } } else if (button == GLFW.GLFW_MOUSE_BUTTON_2) { if (client.currentScreen instanceof ChatScreen chat) { ((MixinChatScreenAccessor) chat).getChatField().setText(builder.toString()); diff --git a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/misc/betterchat/ModuleBetterChat.kt b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/misc/betterchat/ModuleBetterChat.kt index 1eadedb11f9..7165a767298 100644 --- a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/misc/betterchat/ModuleBetterChat.kt +++ b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/misc/betterchat/ModuleBetterChat.kt @@ -66,10 +66,16 @@ object ModuleBetterChat : ClientModule("BetterChat", Category.MISC, aliases = ar private val forceUnicodeChat by boolean("ForceUnicodeChat", false) init { - tree(AntiSpam) + treeAll( + AntiSpam, + Copy + ) } - val copy by boolean("Copy", true) + + object Copy : ToggleableConfigurable(this, "Copy", true) { + val notification by boolean("NotificationAfterCopy", true) + } var antiChatClearPaused = false