|
2 | 2 |
|
3 | 3 | import cc.polyfrost.oneconfig.platform.Platform; |
4 | 4 | import cc.polyfrost.oneconfig.renderer.TextRenderer; |
| 5 | +import com.github.chromaticforge.chat.ChatMod; |
5 | 6 | import com.github.chromaticforge.chat.config.ChatConfig; |
6 | 7 | import net.minecraft.client.gui.FontRenderer; |
7 | 8 | import net.minecraft.client.gui.Gui; |
|
14 | 15 | public class GuiNewChatMixin { |
15 | 16 | @Redirect(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawStringWithShadow(Ljava/lang/String;FFI)I")) |
16 | 17 | private int chat$textShadow(FontRenderer instance, String text, float x, float y, int color) { |
17 | | - switch (ChatConfig.textShadow) { |
18 | | - case 0: |
19 | | - return (int) Platform.getGLPlatform().drawText(text, x, y, color, false); |
20 | | - case 1: |
21 | | - return (int) Platform.getGLPlatform().drawText(text, x, y, color, true); |
22 | | - case 2: |
23 | | - return TextRenderer.drawBorderedText(text, x, y, color, (color >> 24) & 0xFF); |
24 | | - default: |
25 | | - return instance.drawString(text, x, y, color, true); |
| 18 | + if (ChatMod.config.enabled) { |
| 19 | + switch (ChatConfig.textShadow) { |
| 20 | + case 0: |
| 21 | + return (int) Platform.getGLPlatform().drawText(text, x, y, color, false); |
| 22 | + case 1: |
| 23 | + return (int) Platform.getGLPlatform().drawText(text, x, y, color, true); |
| 24 | + case 2: |
| 25 | + return TextRenderer.drawBorderedText(text, x, y, color, (color >> 24) & 0xFF); |
| 26 | + } |
26 | 27 | } |
| 28 | + |
| 29 | + return instance.drawString(text, x, y, color, true); |
27 | 30 | } |
28 | 31 |
|
29 | 32 | @Redirect(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;drawRect(IIIII)V")) |
30 | 33 | private void chat$backgroundColor(int left, int top, int right, int bottom, int oldcolor) { |
31 | | - int color = ChatConfig.background ? ChatConfig.backgroundColor.getRGB() : 0x00000000; |
| 34 | + int color = ChatMod.config.enabled ? ChatConfig.background ? ChatConfig.backgroundColor.getRGB() : 0x00000000 : oldcolor; |
32 | 35 | Gui.drawRect(left, top, right, bottom, color); |
33 | 36 | } |
34 | 37 | } |
0 commit comments