diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2023-01-14 12:13:13 -0500 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2023-01-14 12:13:13 -0500 |
commit | 1b3670de60500c491e5c61b0d304bcde7e30080f (patch) | |
tree | 9657ad419ac41545ea73e11cfea63ff90463f114 /src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java | |
parent | f80dad6f297a60f23ca3066742c2df78e3b6fc83 (diff) | |
download | Chatting-1b3670de60500c491e5c61b0d304bcde7e30080f.tar.gz Chatting-1b3670de60500c491e5c61b0d304bcde7e30080f.tar.bz2 Chatting-1b3670de60500c491e5c61b0d304bcde7e30080f.zip |
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
Diffstat (limited to 'src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java')
-rw-r--r-- | src/main/java/cc/woverflow/chatting/mixin/GuiUtilsMixin.java | 14 |
1 files changed, 14 insertions, 0 deletions
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); + } + } } |