aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc/woverflow
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2023-01-14 14:51:55 -0500
committerWyvest <45589059+Wyvest@users.noreply.github.com>2023-01-14 14:56:31 -0500
commitee8f9de5a156f356e53eb70476f05cd2bf07ae89 (patch)
tree12a5ebded183994cff7f2926fa54a8a785bb145f /src/main/kotlin/cc/woverflow
parente52b994b8a7c32badab7017dc0040d6bfb1cbedb (diff)
downloadChatting-ee8f9de5a156f356e53eb70476f05cd2bf07ae89.tar.gz
Chatting-ee8f9de5a156f356e53eb70476f05cd2bf07ae89.tar.bz2
Chatting-ee8f9de5a156f356e53eb70476f05cd2bf07ae89.zip
split GuiNewChatMixin into different mixins
Diffstat (limited to 'src/main/kotlin/cc/woverflow')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/Chatting.kt4
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt4
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<String, ChatLine>()
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 = ""
}