diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2023-01-20 10:39:21 -0500 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2023-01-20 10:39:21 -0500 |
commit | bef30e98cf9f3697ac6fefbd82f4cb160edaad46 (patch) | |
tree | 06cb2f11f0feb4f5d729a29812cdbde391d5c72a | |
parent | 5822703b7d770ec67a4c4ca00192006b8f0cb9b9 (diff) | |
download | Chatting-bef30e98cf9f3697ac6fefbd82f4cb160edaad46.tar.gz Chatting-bef30e98cf9f3697ac6fefbd82f4cb160edaad46.tar.bz2 Chatting-bef30e98cf9f3697ac6fefbd82f4cb160edaad46.zip |
betterchat compat
6 files changed, 27 insertions, 1 deletions
diff --git a/build.gradle b/build.gradle index 95b25d7..5f09f93 100644 --- a/build.gradle +++ b/build.gradle @@ -59,7 +59,7 @@ dependencies { mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") compileOnly ('org.spongepowered:mixin:0.7.11-SNAPSHOT') - compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.1.0-alpha+') + compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.2.0-alpha+') include('cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-alpha+') modRuntimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.0") } diff --git a/src/dummy/java/com/llamalad7/betterchat/ChatSettings.java b/src/dummy/java/com/llamalad7/betterchat/ChatSettings.java index 3059eb7..d6f73b1 100644 --- a/src/dummy/java/com/llamalad7/betterchat/ChatSettings.java +++ b/src/dummy/java/com/llamalad7/betterchat/ChatSettings.java @@ -3,4 +3,5 @@ package com.llamalad7.betterchat; public class ChatSettings { public int xOffset; public int yOffset; + public boolean smooth; } diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_SmoothMessages.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_SmoothMessages.java index ee94a35..0ef7736 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_SmoothMessages.java +++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin_SmoothMessages.java @@ -5,6 +5,7 @@ import cc.woverflow.chatting.chat.ChatSearchingManager; import cc.woverflow.chatting.chat.ChatTabs; import cc.woverflow.chatting.config.ChattingConfig; import cc.woverflow.chatting.utils.EaseOutQuart; +import cc.woverflow.chatting.utils.ModCompatHooks; import net.minecraft.client.gui.GuiNewChat; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.EnumChatFormatting; @@ -84,6 +85,9 @@ public abstract class GuiNewChatMixin_SmoothMessages { if (!EnumChatFormatting.getTextWithoutFormattingCodes(chatComponent.getUnformattedText()).toLowerCase(Locale.ENGLISH).contains(ChatSearchingManager.INSTANCE.getLastSearch().toLowerCase(Locale.ENGLISH))) { return; } + if (ModCompatHooks.getBetterChatSmoothMessages()) { + return; + } if (ChatTabs.INSTANCE.getHasCancelledAnimation()) { ChatTabs.INSTANCE.setHasCancelledAnimation(false); return; diff --git a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt index 85204d8..2faa234 100644 --- a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt +++ b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt @@ -113,6 +113,13 @@ object Chatting { } } } + if (isBetterChat) { + Notifications.INSTANCE.send( + NAME, + "BetterChat can be removed as it is replaced by Chatting. Click here to open your mods folder to delete the BetterChat file.", Runnable { + UDesktop.open(File("./mods")) + }) + } } } diff --git a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt index 9fa67ed..6e6e0ff 100644 --- a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt +++ b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt @@ -14,6 +14,7 @@ import cc.woverflow.chatting.chat.ChatTab import cc.woverflow.chatting.chat.ChatTabs import cc.woverflow.chatting.gui.components.TabButton import cc.woverflow.chatting.hook.ChatLineHook +import cc.woverflow.chatting.utils.ModCompatHooks import java.io.File object ChattingConfig : Config( @@ -222,6 +223,15 @@ object ChattingConfig : Config( initialize() addDependency("offsetNonPlayerMessages", "showChatHeads") addDependency("hideChatHeadOnConsecutiveMessages", "showChatHeads") + addDependency("hypixelOnlyChatTabs", "chatTabs") + addDependency("hypixelOnlyChatShortcuts", "chatShortcuts") + addDependency("focusedHeight", "customChatHeight") + addDependency("unfocusedHeight", "customChatHeight") + addDependency("scrollingSpeed", "smoothScrolling") + addDependency("messageSpeed", "smoothChat") + addDependency("smoothChat", "BetterChat Smooth Chat") { + return@addDependency !ModCompatHooks.betterChatSmoothMessages + } addListener("hideChatHeadOnConsecutiveMessages") { ChatLineHook.chatLines.map { it.get() as ChatLineHook? }.forEach { it?.updatePlayerInfo() } } diff --git a/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt b/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt index b18bdaa..3c60c72 100644 --- a/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt +++ b/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt @@ -33,6 +33,10 @@ object ModCompatHooks { get() = if (isPatcher && PatcherConfig.chatPosition) 12 else 0 @JvmStatic + val betterChatSmoothMessages + get() = if (isBetterChat) BetterChat.getSettings().smooth else false + + @JvmStatic val extendedChatLength get() = if (isPatcher) 32667 else 0 |