From 1b3670de60500c491e5c61b0d304bcde7e30080f Mon Sep 17 00:00:00 2001 From: Wyvest <45589059+Wyvest@users.noreply.github.com> Date: Sat, 14 Jan 2023 12:13:13 -0500 Subject: various new features - right click to copy chat message - tooltip text render type - delete button for individual chat lines - copying chat messages now always shows a notification output --- .../cc/woverflow/chatting/hook/ChatLineHook.java | 2 + .../cc/woverflow/chatting/hook/GuiNewChatHook.java | 4 +- .../cc/woverflow/chatting/mixin/ChatLineMixin.java | 9 ++ .../cc/woverflow/chatting/mixin/GuiChatMixin.java | 26 ++-- .../chatting/mixin/GuiNewChatAccessor.java | 3 + .../woverflow/chatting/mixin/GuiNewChatMixin.java | 87 +++++++----- .../cc/woverflow/chatting/mixin/GuiUtilsMixin.java | 14 ++ .../cc/woverflow/chatting/config/ChattingConfig.kt | 149 +++++++++------------ 8 files changed, 166 insertions(+), 128 deletions(-) (limited to 'src') diff --git a/src/main/java/cc/woverflow/chatting/hook/ChatLineHook.java b/src/main/java/cc/woverflow/chatting/hook/ChatLineHook.java index fb10225..9460e0c 100644 --- a/src/main/java/cc/woverflow/chatting/hook/ChatLineHook.java +++ b/src/main/java/cc/woverflow/chatting/hook/ChatLineHook.java @@ -12,4 +12,6 @@ public interface ChatLineHook { NetworkPlayerInfo getPlayerInfo(); void updatePlayerInfo(); + + long getUniqueId(); } diff --git a/src/main/java/cc/woverflow/chatting/hook/GuiNewChatHook.java b/src/main/java/cc/woverflow/chatting/hook/GuiNewChatHook.java index 51b19d4..d2ca6c1 100644 --- a/src/main/java/cc/woverflow/chatting/hook/GuiNewChatHook.java +++ b/src/main/java/cc/woverflow/chatting/hook/GuiNewChatHook.java @@ -7,7 +7,9 @@ import java.awt.datatransfer.Transferable; public interface GuiNewChatHook { int getRight(); - boolean shouldCopy(); + boolean isHovering(); + + ChatLine getHoveredLine(int mouseY); Transferable getChattingChatComponent(int mouseY); diff --git a/src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java b/src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java index ab052ae..beef37b 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java +++ b/src/main/java/cc/woverflow/chatting/mixin/ChatLineMixin.java @@ -29,9 +29,13 @@ public class ChatLineMixin implements ChatLineHook { private NetworkPlayerInfo playerInfo; private NetworkPlayerInfo detectedPlayerInfo; private static NetworkPlayerInfo lastPlayerInfo; + private static long lastUniqueId = 0; + private long uniqueId = 0; @Inject(method = "", at = @At("RETURN")) private void onInit(int i, IChatComponent iChatComponent, int j, CallbackInfo ci) { + lastUniqueId++; + uniqueId = lastUniqueId; chatLines.add(new WeakReference<>((ChatLine) (Object) this)); NetHandlerPlayClient netHandler = Minecraft.getMinecraft().getNetHandler(); if (netHandler == null) return; @@ -102,4 +106,9 @@ public class ChatLineMixin implements ChatLineHook { playerInfo = detectedPlayerInfo; } } + + @Override + public long getUniqueId() { + return uniqueId; + } } diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java index 1774f82..a633a3d 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java +++ b/src/main/java/cc/woverflow/chatting/mixin/GuiChatMixin.java @@ -8,10 +8,12 @@ import cc.woverflow.chatting.config.ChattingConfig; import cc.woverflow.chatting.gui.components.ClearButton; import cc.woverflow.chatting.gui.components.ScreenshotButton; import cc.woverflow.chatting.gui.components.SearchButton; +import cc.woverflow.chatting.hook.ChatLineHook; import cc.woverflow.chatting.hook.GuiNewChatHook; import cc.woverflow.chatting.utils.ModCompatHooks; import com.google.common.collect.Lists; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ChatLine; import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; @@ -85,7 +87,7 @@ public abstract class GuiChatMixin extends GuiScreen { GuiNewChatHook hook = ((GuiNewChatHook) Minecraft.getMinecraft().ingameGUI.getChatGUI()); float f = mc.ingameGUI.getChatGUI().getChatScale(); int x = MathHelper.floor_float((float) mouseX / f); - if (hook.shouldCopy() && (hook.getRight() + ModCompatHooks.getXOffset() + 3) <= x && (hook.getRight() + ModCompatHooks.getXOffset()) + 13 > x) { + if (hook.isHovering() && (hook.getRight() + ModCompatHooks.getXOffset() + 3) <= x && (hook.getRight() + ModCompatHooks.getXOffset()) + 13 > x) { GuiUtils.drawHoveringText(COPY_TOOLTIP, mouseX, mouseY, width, height, -1, fontRendererObj); GlStateManager.disableLighting(); } @@ -101,15 +103,23 @@ public abstract class GuiChatMixin extends GuiScreen { GuiNewChatHook hook = ((GuiNewChatHook) Minecraft.getMinecraft().ingameGUI.getChatGUI()); float f = mc.ingameGUI.getChatGUI().getChatScale(); int x = MathHelper.floor_float((float) mouseX / f); - if (hook.shouldCopy() && (hook.getRight() + ModCompatHooks.getXOffset() + 3) <= x && (hook.getRight() + ModCompatHooks.getXOffset()) + 13 > x) { - Transferable message = hook.getChattingChatComponent(Mouse.getY()); - if (message == null) return; - try { - Toolkit.getDefaultToolkit().getSystemClipboard().setContents(message, null); - } catch (Exception e) { - e.printStackTrace(); + if (hook.isHovering()) { + if (((hook.getRight() + ModCompatHooks.getXOffset() + 3) <= x && (hook.getRight() + ModCompatHooks.getXOffset()) + 13 > x) || (mouseButton == 1 && ChattingConfig.INSTANCE.getRightClickCopy())) { + Transferable message = hook.getChattingChatComponent(Mouse.getY()); + if (message == null) return; + try { + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(message, null); + } catch (Exception e) { + e.printStackTrace(); + } + } else if ((hook.getRight() + ModCompatHooks.getXOffset() + 13) <= x && (hook.getRight() + ModCompatHooks.getXOffset()) + 23 > x) { + ChatLine chatLine = hook.getHoveredLine(Mouse.getY()); + if (chatLine == null) return; + ((GuiNewChatAccessor) Minecraft.getMinecraft().ingameGUI.getChatGUI()).getDrawnChatLines().removeIf(line -> ((ChatLineHook) line).getUniqueId() == ((ChatLineHook) chatLine).getUniqueId()); + ((GuiNewChatAccessor) Minecraft.getMinecraft().ingameGUI.getChatGUI()).getChatLines().removeIf(line -> ((ChatLineHook) line).getUniqueId() == ((ChatLineHook) chatLine).getUniqueId()); } } + } @ModifyArg(method = "keyTyped", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiChat;sendChatMessage(Ljava/lang/String;)V"), index = 0) diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatAccessor.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatAccessor.java index 8b81a50..d4fd524 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatAccessor.java +++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatAccessor.java @@ -12,6 +12,9 @@ public interface GuiNewChatAccessor { @Accessor List getDrawnChatLines(); + @Accessor + List getChatLines(); + @Accessor int getScrollPos(); } diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java index e0a76d5..17106bc 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java +++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java @@ -1,20 +1,18 @@ package cc.woverflow.chatting.mixin; import cc.polyfrost.oneconfig.config.core.OneColor; -import cc.polyfrost.oneconfig.utils.color.ColorUtils; +import cc.polyfrost.oneconfig.libs.universal.UMouse; +import cc.polyfrost.oneconfig.utils.Notifications; import cc.woverflow.chatting.Chatting; import cc.woverflow.chatting.chat.ChatSearchingManager; import cc.woverflow.chatting.chat.ChatTabs; import cc.woverflow.chatting.config.ChattingConfig; import cc.woverflow.chatting.gui.components.CleanButton; -import cc.woverflow.chatting.hook.ChatLineHook; import cc.woverflow.chatting.hook.GuiNewChatHook; import cc.woverflow.chatting.utils.ModCompatHooks; import cc.woverflow.chatting.utils.RenderUtils; -import cc.polyfrost.oneconfig.libs.universal.UMouse; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.*; -import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; @@ -42,7 +40,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { @Unique private int chatting$right = 0; @Unique - private boolean chatting$shouldCopy; + private boolean chatting$isHovering; @Unique private boolean chatting$chatCheck; @Unique @@ -79,6 +77,8 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { @Unique private static final ResourceLocation COPY = new ResourceLocation("chatting:copy.png"); + @Unique + private static final ResourceLocation DELETE = new ResourceLocation("chatting:delete.png"); @Inject(method = "printChatMessageWithOptionalDeletion", at = @At("HEAD"), cancellable = true) private void handlePrintChatMessage(IChatComponent chatComponent, int chatLineId, CallbackInfo ci) { @@ -107,6 +107,14 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { */ + @Unique + private ChatLine chatting$drawingLine = null; + + @Inject(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/ChatLine;getChatComponent()Lnet/minecraft/util/IChatComponent;"), locals = LocalCapture.CAPTURE_FAILSOFT) + private void captureChatLine(int updateCounter, CallbackInfo ci, int i, boolean bl, int j, int k, float f, float g, int l, int m, ChatLine chatLine, int n, double d, int o, int p, int q) { + chatting$drawingLine = chatLine; + } + @Inject(method = "drawChat", at = @At("HEAD")) private void checkScreenshotKeybind(int j2, CallbackInfo ci) { if (Chatting.INSTANCE.getKeybind().isPressed()) { @@ -138,21 +146,13 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { int right = args.get(2); int bottom = args.get(3); if (isInBounds(left, top, right, bottom, getChatScale())) { - chatting$shouldCopy = true; + chatting$isHovering = true; lineInBounds = true; args.set(4, changeChatBackgroundColor(ChattingConfig.INSTANCE.getHoveredChatBackgroundColor(), args.get(4))); } } } - @Unique - private ChatLine chatting$drawingLine = null; - - @Inject(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/ChatLine;getChatComponent()Lnet/minecraft/util/IChatComponent;"), locals = LocalCapture.CAPTURE_FAILSOFT) - private void captureChatLine(int updateCounter, CallbackInfo ci, int i, boolean bl, int j, int k, float f, float g, int l, int m, ChatLine chatLine, int n, double d, int o, int p, int q) { - chatting$drawingLine = chatLine; - } - @ModifyArgs(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawStringWithShadow(Ljava/lang/String;FFI)I")) private void drawChatBox(Args args) { if (mc.currentScreen instanceof GuiChat) { @@ -161,8 +161,8 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { int top = (int) ((float) args.get(2) - 1); int right = MathHelper.ceiling_float_int((float)getChatWidth() / f) + 4; int bottom = (int) ((float) args.get(2) + 8); - if ((chatting$shouldCopy && lineInBounds) || isInBounds(left, top, right, bottom, f)) { - chatting$shouldCopy = true; + if ((chatting$isHovering && lineInBounds) || isInBounds(left, top, right, bottom, f)) { + chatting$isHovering = true; drawCopyChatBox(right, top); } } @@ -174,7 +174,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { int mouseY = MathHelper.floor_double(UMouse.getScaledY()) - 27 + ModCompatHooks.getYOffset() - ModCompatHooks.getChatPosition(); mouseX = MathHelper.floor_float((float) mouseX / chatScale); mouseY = -(MathHelper.floor_float((float) mouseY / chatScale)); //WHY DO I NEED TO DO THIS - return mouseX >= (left + ModCompatHooks.getXOffset()) && mouseY < bottom && mouseX < (right + 11 + ModCompatHooks.getXOffset()) && mouseY >= top; + return mouseX >= (left + ModCompatHooks.getXOffset()) && mouseY < bottom && mouseX < (right + 23 + ModCompatHooks.getXOffset()) && mouseY >= top; } private int changeChatBackgroundColor(OneColor color, int alphaColor) { @@ -227,8 +227,8 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { @Inject(method = "drawChat", at = @At("RETURN")) private void checkStuff(int j2, CallbackInfo ci) { - if (!chatting$chatCheck && chatting$shouldCopy) { - chatting$shouldCopy = false; + if (!chatting$chatCheck && chatting$isHovering) { + chatting$isHovering = false; } } @@ -244,8 +244,8 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { } @Override - public boolean shouldCopy() { - return chatting$shouldCopy; + public boolean isHovering() { + return chatting$isHovering; } private void handleChatTabMessage(IChatComponent chatComponent, int chatLineId, int updateCounter, boolean displayOnly, CallbackInfo ci) { @@ -285,12 +285,21 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { drawRect(right + 1, top, right + 10, top + 9, (((right + ModCompatHooks.getXOffset() + 3) <= (UMouse.getScaledX() / mc.ingameGUI.getChatGUI().getChatScale()) && (right + ModCompatHooks.getXOffset()) + 13 > (UMouse.getScaledX() / mc.ingameGUI.getChatGUI().getChatScale())) ? CleanButton.Companion.getHoveredColor() : CleanButton.Companion.getColor())); GlStateManager.disableAlpha(); GlStateManager.disableRescaleNormal(); + mc.getTextureManager().bindTexture(DELETE); + GlStateManager.enableRescaleNormal(); + GlStateManager.enableAlpha(); + GlStateManager.alphaFunc(516, 0.1f); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 771); + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); + Gui.drawModalRectWithCustomSizedTexture(right + 11, top, 0f, 0f, 9, 9, 9, 9); + drawRect(right + 11, top, right + 20, top + 9, (((right + ModCompatHooks.getXOffset() + 13) <= (UMouse.getScaledX() / mc.ingameGUI.getChatGUI().getChatScale()) && (right + ModCompatHooks.getXOffset()) + 23 > (UMouse.getScaledX() / mc.ingameGUI.getChatGUI().getChatScale())) ? CleanButton.Companion.getHoveredColor() : CleanButton.Companion.getColor())); GlStateManager.disableLighting(); GlStateManager.popMatrix(); } @Override - public Transferable getChattingChatComponent(int mouseY) { + public ChatLine getHoveredLine(int mouseY) { if (this.getChatOpen()) { ScaledResolution scaledresolution = new ScaledResolution(this.mc); int i = scaledresolution.getScaleFactor(); @@ -305,18 +314,7 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { int i1 = k / this.mc.fontRendererObj.FONT_HEIGHT + this.scrollPos; if (i1 >= 0 && i1 < this.drawnChatLines.size()) { - ChatLine subLine = this.drawnChatLines.get(i1); - ChatLine fullLine = this.getFullMessage(subLine); - if (GuiScreen.isShiftKeyDown()) { - if (fullLine != null) { - BufferedImage image = Chatting.INSTANCE.screenshotLine(fullLine); - if (image != null) RenderUtils.copyToClipboard(image); - } - return null; - } - ChatLine line = GuiScreen.isCtrlKeyDown() ? subLine : fullLine; - String message = line == null ? "Could not find chat message." : line.getChatComponent().getFormattedText(); - return new StringSelection(GuiScreen.isAltKeyDown() ? message : EnumChatFormatting.getTextWithoutFormattingCodes(message)); + return this.drawnChatLines.get(i1); } } @@ -325,6 +323,27 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook { return null; } + @Override + public Transferable getChattingChatComponent(int mouseY) { + ChatLine subLine = getHoveredLine(mouseY); + if (subLine != null) { + ChatLine fullLine = this.getFullMessage(subLine); + if (GuiScreen.isShiftKeyDown()) { + if (fullLine != null) { + BufferedImage image = Chatting.INSTANCE.screenshotLine(fullLine); + if (image != null) RenderUtils.copyToClipboard(image); + } + return null; + } + ChatLine line = GuiScreen.isCtrlKeyDown() ? subLine : fullLine; + String message = line == null ? "Could not find chat message." : line.getChatComponent().getFormattedText(); + String actualMessage = GuiScreen.isAltKeyDown() ? message : EnumChatFormatting.getTextWithoutFormattingCodes(message); + Notifications.INSTANCE.send("Chatting", line == null ? "Could not find chat message." : "Copied following text: " + actualMessage); + return new StringSelection(actualMessage); + } + return null; + } + @Override public String getPrevText() { return chatting$previousText; diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java index 6489f67..d939d6b 100644 --- a/src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java +++ b/src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java @@ -1,6 +1,8 @@ package cc.woverflow.chatting.mixin; +import cc.polyfrost.oneconfig.renderer.TextRenderer; import cc.woverflow.chatting.config.ChattingConfig; +import net.minecraft.client.gui.FontRenderer; import net.minecraftforge.fml.client.config.GuiUtils; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -19,4 +21,16 @@ public class GuiUtilsMixin { drawGradientRect(zLevel, left, top, right, bottom, startColor, endColor); } } + + @Redirect(method = "drawHoveringText", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawStringWithShadow(Ljava/lang/String;FFI)I")) + private static int redirectText(FontRenderer instance, String text, float x, float y, int color) { + switch (ChattingConfig.INSTANCE.getTooltipTextRenderType()) { + case 0: + return instance.drawString(text, x, y, color, false); + case 2: + return TextRenderer.drawBorderedText(text, x, y, color, 255); + default: + return instance.drawStringWithShadow(text, x, y, color); + } + } } diff --git a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt index a7f6ffe..55195ce 100644 --- a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt +++ b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt @@ -16,61 +16,51 @@ import cc.woverflow.chatting.gui.components.TabButton import cc.woverflow.chatting.hook.ChatLineHook import java.io.File -object ChattingConfig : - Config( - Mod(Chatting.NAME, ModType.UTIL_QOL, VigilanceMigrator(File(Chatting.modDir, Chatting.ID + ".toml").toPath().toString())), - "chatting.json" - ) { +object ChattingConfig : Config( + Mod( + Chatting.NAME, + ModType.UTIL_QOL, + VigilanceMigrator(File(Chatting.modDir, Chatting.ID + ".toml").toPath().toString()) + ), "chatting.json" +) { @Dropdown( - name = "Text Render Type", - category = "General", - options = ["No Shadow", "Shadow", "Full Shadow"] + name = "Text Render Type", category = "General", options = ["No Shadow", "Shadow", "Full Shadow"] ) var textRenderType = 1 @Switch( - name = "Remove Tooltip Background", - category = "General" - ) - var removeTooltipBackground = false - - @Switch( - name = "Remove Scroll Bar", - category = "General" + name = "Remove Scroll Bar", category = "General" ) var removeScrollBar = false @Color( - name = "Chat Background Color", - category = "General", - allowAlpha = false + name = "Chat Background Color", category = "General", allowAlpha = false ) var chatBackgroundColor = OneColor(0, 0, 0, 128) @Color( - name = "Copy Chat Message Background Color", - category = "General", - allowAlpha = false + name = "Copy Chat Message Background Color", category = "General", allowAlpha = false ) var hoveredChatBackgroundColor = OneColor(80, 80, 80, 128) @Switch( - name = "Compact Input Box", - category = "General" + name = "Right Click to Copy Chat Message", category = "General" + ) + var rightClickCopy = false + + @Switch( + name = "Compact Input Box", category = "General" ) var compactInputBox = false @Switch( - name = "Inform Outdated Mods", - category = "General" + name = "Inform Outdated Mods", category = "General" ) var informForAlternatives = true @Switch( - name = "Show Chat Heads", - description = "Show the chat heads of players in chat", - category = "Chat Heads" + name = "Show Chat Heads", description = "Show the chat heads of players in chat", category = "Chat Heads" ) var showChatHeads = true @@ -108,72 +98,55 @@ object ChattingConfig : */ @Info( - text = "If Chatting detects a public chat message that seems like spam, and the probability is higher than this, it will hide it.\n" + - "Made for Hypixel Skyblock. Set to 100% to disable. 95% is a reasonable threshold to use it at.\n" + - "Note that this is not and never will be 100% accurate; however, it's pretty much guaranteed to block most spam.", - size = 2, category = "Player Chats", + text = "If Chatting detects a public chat message that seems like spam, and the probability is higher than this, it will hide it.\n" + "Made for Hypixel Skyblock. Set to 100% to disable. 95% is a reasonable threshold to use it at.\n" + "Note that this is not and never will be 100% accurate; however, it's pretty much guaranteed to block most spam.", + size = 2, + category = "Player Chats", type = InfoType.INFO ) var ignored = false @Slider( - min = 80F, - max = 100F, - name = "Spam Blocker Threshold", - category = "Player Chats" + min = 80F, max = 100F, name = "Spam Blocker Threshold", category = "Player Chats" ) var spamThreshold = 100 @Switch( - name = "Custom SkyBlock Chat Formatting (remove ranks)", - category = "Player Chats" + name = "Custom SkyBlock Chat Formatting (remove ranks)", category = "Player Chats" ) var customChatFormatting = false @Switch( - name = "Completely Hide Spam", - category = "Player Chats" + name = "Completely Hide Spam", category = "Player Chats" ) var hideSpam = false @Switch( - name = "Custom Chat Height", - category = "Chat Window" + name = "Custom Chat Height", category = "Chat Window" ) var customChatHeight = true @Slider( - min = 180F, - max = 2160F, - name = "Focused Height (px)", - category = "Chat Window" + min = 180F, max = 2160F, name = "Focused Height (px)", category = "Chat Window" ) var focusedHeight = 180 @Slider( - min = 180F, - max = 2160F, - name = "Unfocused Height (px)", - category = "Chat Window" + min = 180F, max = 2160F, name = "Unfocused Height (px)", category = "Chat Window" ) var unfocusedHeight = 180 @Dropdown( - name = "Screenshot Mode", - category = "Screenshotting", - options = ["Save To System", "Add To Clipboard", "Both"] + name = "Screenshot Mode", category = "Screenshotting", options = ["Save To System", "Add To Clipboard", "Both"] ) var copyMode = 0 @Checkbox( - name = "Chat Searching", - category = "Searching" + name = "Chat Searching", category = "Searching" ) var chatSearch = true @Switch( - name = "Chat Tabs", - category = "Tabs" + name = "Chat Tabs", category = "Tabs" ) var chatTabs = true get() { @@ -186,14 +159,12 @@ object ChattingConfig : } @Checkbox( - name = "Enable Tabs Only on Hypixel", - category = "Tabs" + name = "Enable Tabs Only on Hypixel", category = "Tabs" ) var hypixelOnlyChatTabs = true @Switch( - name = "Chat Shortcuts", - category = "Shortcuts" + name = "Chat Shortcuts", category = "Shortcuts" ) var chatShortcuts = false get() { @@ -206,11 +177,20 @@ object ChattingConfig : } @Checkbox( - name = "Enable Shortcuts Only on Hypixel", - category = "Shortcuts" + name = "Enable Shortcuts Only on Hypixel", category = "Shortcuts" ) var hypixelOnlyChatShortcuts = true + @Switch( + name = "Remove Tooltip Background", category = "Tooltips" + ) + var removeTooltipBackground = false + + @Dropdown( + name = "Tooltip Text Render Type", category = "Tooltips", options = ["No Shadow", "Shadow", "Full Shadow"] + ) + var tooltipTextRenderType = 1 + init { initialize() addDependency("offsetNonPlayerMessages", "showChatHeads") @@ -221,27 +201,26 @@ object ChattingConfig : addListener("chatTabs") { ChatTabs.initialize() if (!chatTabs) { - val dummy = - ChatTab( - true, - "ALL", - unformatted = false, - lowercase = false, - startsWith = null, - contains = null, - endsWith = null, - equals = null, - uncompiledRegex = null, - ignoreStartsWith = null, - ignoreContains = null, - ignoreEndsWith = null, - ignoreEquals = null, - uncompiledIgnoreRegex = null, - color = TabButton.color, - hoveredColor = TabButton.hoveredColor, - selectedColor = TabButton.selectedColor, - prefix = "" - ) + val dummy = ChatTab( + true, + "ALL", + unformatted = false, + lowercase = false, + startsWith = null, + contains = null, + endsWith = null, + equals = null, + uncompiledRegex = null, + ignoreStartsWith = null, + ignoreContains = null, + ignoreEndsWith = null, + ignoreEquals = null, + uncompiledIgnoreRegex = null, + color = TabButton.color, + hoveredColor = TabButton.hoveredColor, + selectedColor = TabButton.selectedColor, + prefix = "" + ) dummy.initialize() ChatTabs.currentTab = dummy } else { -- cgit