diff options
author | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-01-02 15:20:32 +0700 |
---|---|---|
committer | Wyvest <45589059+Wyvest@users.noreply.github.com> | 2022-01-02 15:20:32 +0700 |
commit | e02ba1f11a421618aaf357dd166aae005301e7ab (patch) | |
tree | c73c9bb9d201be0048971e295376b0472e68adb3 /src | |
parent | cc4a11c7943d9036dc71679eaa531832cd2a2f0c (diff) | |
download | Chatting-e02ba1f11a421618aaf357dd166aae005301e7ab.tar.gz Chatting-e02ba1f11a421618aaf357dd166aae005301e7ab.tar.bz2 Chatting-e02ba1f11a421618aaf357dd166aae005301e7ab.zip |
remove tooltip background feature
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/cc/woverflow/chattils/mixin/GuiUtilsMixin.java | 22 | ||||
-rw-r--r-- | src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt | 8 | ||||
-rw-r--r-- | src/main/resources/mixins.chattils.json | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/cc/woverflow/chattils/mixin/GuiUtilsMixin.java b/src/main/java/cc/woverflow/chattils/mixin/GuiUtilsMixin.java new file mode 100644 index 0000000..df8216b --- /dev/null +++ b/src/main/java/cc/woverflow/chattils/mixin/GuiUtilsMixin.java @@ -0,0 +1,22 @@ +package cc.woverflow.chattils.mixin; + +import cc.woverflow.chattils.config.ChattilsConfig; +import net.minecraftforge.fml.client.config.GuiUtils; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(value = GuiUtils.class, remap = false) +public class GuiUtilsMixin { + @Shadow + public static void drawGradientRect(int zLevel, int left, int top, int right, int bottom, int startColor, int endColor) { + } + + @Redirect(method = "drawHoveringText", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/client/config/GuiUtils;drawGradientRect(IIIIIII)V")) + private static void redirectBackground(int zLevel, int left, int top, int right, int bottom, int startColor, int endColor) { + if (!ChattilsConfig.INSTANCE.getRemoveTooltipBackground()) { + drawGradientRect(zLevel, left, top, right, bottom, startColor, endColor); + } + } +} diff --git a/src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt b/src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt index 77b9654..d662755 100644 --- a/src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt +++ b/src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt @@ -28,6 +28,14 @@ object ChattilsConfig : Vigilant(File(Chattils.modDir, "${Chattils.ID}.toml"), C @Property( type = PropertyType.SWITCH, + name = "Remove Tooltip Background", + description = "Remove the tooltip background.", + category = "General" + ) + var removeTooltipBackground = false + + @Property( + type = PropertyType.SWITCH, name = "Custom Chat Height", description = "Allows you to change the height of chat to heights greater than before.", category = "Chat Window" diff --git a/src/main/resources/mixins.chattils.json b/src/main/resources/mixins.chattils.json index 356276a..eea156a 100644 --- a/src/main/resources/mixins.chattils.json +++ b/src/main/resources/mixins.chattils.json @@ -10,6 +10,7 @@ "GuiNewChatAccessor", "GuiNewChatMapMixin", "GuiNewChatMixin", + "GuiUtilsMixin", "WyvtilsListenerMixin" ], "verbose": true |