From ee8f9de5a156f356e53eb70476f05cd2bf07ae89 Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sat, 14 Jan 2023 14:51:55 -0500 Subject: split GuiNewChatMixin into different mixins --- src/main/kotlin/cc/woverflow/chatting/Chatting.kt | 4 +--- src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt index 27f1a87..8d40aa2 100644 --- a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt +++ b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt @@ -12,7 +12,6 @@ import cc.woverflow.chatting.chat.ChatTabs import cc.woverflow.chatting.command.ChattingCommand import cc.woverflow.chatting.config.ChattingConfig import cc.woverflow.chatting.hook.ChatLineHook -import cc.woverflow.chatting.hook.GuiNewChatHook import cc.woverflow.chatting.mixin.GuiNewChatAccessor import cc.woverflow.chatting.utils.ModCompatHooks import cc.woverflow.chatting.utils.copyToClipboard @@ -32,7 +31,6 @@ import net.minecraftforge.fml.common.Mod import net.minecraftforge.fml.common.event.FMLInitializationEvent import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent import net.minecraftforge.fml.common.event.FMLPostInitializationEvent -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent import org.lwjgl.input.Keyboard @@ -193,7 +191,7 @@ object Chatting { val chat = hud.chatGUI val chatLines = HashMap() ChatSearchingManager.filterMessages( - (chat as GuiNewChatHook).prevText, + ChatSearchingManager.lastSearch, (chat as GuiNewChatAccessor).drawnChatLines )?.let { drawnLines -> val chatHeight = diff --git a/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt index 2194bbb..54e9041 100644 --- a/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt +++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt @@ -2,7 +2,7 @@ package cc.woverflow.chatting.gui.components import cc.polyfrost.oneconfig.libs.universal.UResolution import cc.woverflow.chatting.Chatting -import cc.woverflow.chatting.hook.GuiNewChatHook +import cc.woverflow.chatting.chat.ChatSearchingManager import net.minecraft.client.Minecraft import net.minecraft.client.gui.Gui import net.minecraft.client.gui.GuiTextField @@ -23,7 +23,7 @@ class SearchButton : chatBox = !chatBox inputField.setEnabled(chatBox) inputField.isFocused = chatBox - (Minecraft.getMinecraft().ingameGUI.chatGUI as GuiNewChatHook).prevText = "" + ChatSearchingManager.lastSearch = "" inputField.text = "" } -- cgit