aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-03-12 14:53:23 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-03-12 14:53:23 +0700
commitdd0d2d6d5c0191861cab0611d9fc28d7f4edb088 (patch)
tree96d8b3e88821e42b9b0357ddda1c5170992a57e5 /src/main/java/cc
parenteef8bab78435d86107d95951cc1da04317520d33 (diff)
downloadChatting-dd0d2d6d5c0191861cab0611d9fc28d7f4edb088.tar.gz
Chatting-dd0d2d6d5c0191861cab0611d9fc28d7f4edb088.tar.bz2
Chatting-dd0d2d6d5c0191861cab0611d9fc28d7f4edb088.zip
chat tabs documentation
Diffstat (limited to 'src/main/java/cc')
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java11
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/RedactionNameHighlightMixin.java22
-rw-r--r--src/main/java/cc/woverflow/chatting/mixin/WyvtilsListenerMixin.java21
3 files changed, 3 insertions, 51 deletions
diff --git a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java
index 9c292c6..d6a0b15 100644
--- a/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java
+++ b/src/main/java/cc/woverflow/chatting/mixin/GuiNewChatMixin.java
@@ -106,8 +106,11 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
if (mouseX >= (left + ModCompatHooks.getXOffset()) && mouseY < bottom && mouseX < (right + 11 + ModCompatHooks.getXOffset()) && mouseY >= top) {
chatting$shouldCopy = true;
drawCopyChatBox(right, top);
+ args.set(4, ChattingConfig.INSTANCE.getHoveredChatBackgroundColor().getRGB());
+ return;
}
}
+ args.set(4, ChattingConfig.INSTANCE.getChatBackgroundColor().getRGB());
}
@Redirect(method = "drawChat", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/GuiNewChat;drawnChatLines:Ljava/util/List;", opcode = Opcodes.GETFIELD))
@@ -125,14 +128,6 @@ public abstract class GuiNewChatMixin extends Gui implements GuiNewChatHook {
return ModCompatHooks.redirectDrawString(text, x, y, color);
}
- @ModifyArg(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;drawRect(IIIII)V", ordinal = 0), index = 4)
- private int changeChatBackgroundColor(int color) {
- return (((color >> 24) & 0xFF) << 24) |
- ((ChattingConfig.INSTANCE.getChatBackgroundColor().getRed() & 0xFF) << 16) |
- ((ChattingConfig.INSTANCE.getChatBackgroundColor().getGreen() & 0xFF) << 8) |
- ((ChattingConfig.INSTANCE.getChatBackgroundColor().getBlue() & 0xFF));
- }
-
@Redirect(method = "drawChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiNewChat;drawRect(IIIII)V", ordinal = 1))
private void redirectScrollBar(int left, int top, int right, int bottom, int color) {
if (!ChattingConfig.INSTANCE.getRemoveScrollBar()) {
diff --git a/src/main/java/cc/woverflow/chatting/mixin/RedactionNameHighlightMixin.java b/src/main/java/cc/woverflow/chatting/mixin/RedactionNameHighlightMixin.java
deleted file mode 100644
index eab1bfe..0000000
--- a/src/main/java/cc/woverflow/chatting/mixin/RedactionNameHighlightMixin.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package cc.woverflow.chatting.mixin;
-
-import cc.woverflow.chatting.utils.RenderUtils;
-import org.spongepowered.asm.mixin.Dynamic;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Pseudo;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-@Pseudo
-@Mixin(targets = "net.wyvest.redaction.features.NameHighlight")
-public class RedactionNameHighlightMixin {
-
- @Dynamic("REDACTION")
- @Inject(method = "highlightName", at = @At("HEAD"), cancellable = true)
- private static void onNameHighlight(String text, CallbackInfoReturnable<String> cir) {
- if (RenderUtils.getBypassNameHighlight()) {
- cir.setReturnValue(text);
- }
- }
-}
diff --git a/src/main/java/cc/woverflow/chatting/mixin/WyvtilsListenerMixin.java b/src/main/java/cc/woverflow/chatting/mixin/WyvtilsListenerMixin.java
deleted file mode 100644
index 4c7448e..0000000
--- a/src/main/java/cc/woverflow/chatting/mixin/WyvtilsListenerMixin.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package cc.woverflow.chatting.mixin;
-
-import cc.woverflow.chatting.utils.RenderUtils;
-import org.spongepowered.asm.mixin.Dynamic;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Pseudo;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Coerce;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-
-@Pseudo
-@Mixin(targets = "net.wyvest.wyvtils.core.listener.Listener")
-public class WyvtilsListenerMixin {
-
- @Dynamic("Wyvtils")
- @Inject(method = "onStringRendered", at = @At("HEAD"), cancellable = true, remap = false)
- private void cancelStringRender(@Coerce Object a, CallbackInfo ci) {
- if (RenderUtils.getBypassNameHighlight()) ci.cancel();
- }
-}