From b21ff415a88df8db45bc7b963707914c8f96b6c5 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Thu, 15 Oct 2026 20:06:49 +0200 Subject: [PATCH] Show channel tags as plain gray prefix Messages from a channel that is not the receiver's default are now prefixed with the plain channel name in dark gray instead of brackets. Direct messages get no tag, as their format already shows sender and receiver. --- .../src/de/steamwar/messages/BungeeCore.properties | 2 +- .../src/de/steamwar/messages/BungeeCore_de.properties | 2 +- .../de/steamwar/velocitycore/chat/ChatChannel.java | 11 +++++++++-- .../de/steamwar/velocitycore/chat/DirectChannel.java | 5 +++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties index bff90140c..b617fd32f 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore.properties @@ -583,7 +583,7 @@ CHAT_FIGHT_PARTICIPANT = {0} {1}§8» §7{2} CHAT_FIGHT_SPECTATOR = §7{0}§8» §7{1} CHAT_FIGHT_REFEREE = §e{0}§8» §e{1} CHAT_FIGHT_TEAM = {0} {1}§8» §f{2} -CHAT_TAGGED = §8[{0}§8] §r{1} +CHAT_TAGGED = §8{0} §r{1} CHAT_CHANNEL_GLOBAL = §eGlobal CHAT_CHANNEL_ARENA = §e{0} CHAT_CHANNEL_FIGHT_TEAM = §e{0} {1} diff --git a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties index 3f34d8889..e253ce72f 100644 --- a/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties +++ b/VelocityCore/src/de/steamwar/messages/BungeeCore_de.properties @@ -548,7 +548,7 @@ CHAT_FIGHT_PARTICIPANT = {0} {1}§8» §7{2} CHAT_FIGHT_SPECTATOR = §7{0}§8» §7{1} CHAT_FIGHT_REFEREE = §e{0}§8» §e{1} CHAT_FIGHT_TEAM = {0} {1}§8» §f{2} -CHAT_TAGGED = §8[{0}§8] §r{1} +CHAT_TAGGED = §8{0} §r{1} CHAT_CHANNEL_GLOBAL = §eGlobal CHAT_CHANNEL_ARENA = §e{0} CHAT_CHANNEL_FIGHT_TEAM = §e{0} {1} diff --git a/VelocityCore/src/de/steamwar/velocitycore/chat/ChatChannel.java b/VelocityCore/src/de/steamwar/velocitycore/chat/ChatChannel.java index 8c3be5f98..8d25acb19 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/chat/ChatChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/chat/ChatChannel.java @@ -47,6 +47,13 @@ public abstract class ChatChannel { */ public abstract Message tag(Chatter receiver); + /** + * @return false if the message format already shows the channel, so no tag is put in front + */ + protected boolean tagged() { + return true; + } + public abstract Stream readers(); /** @@ -90,8 +97,8 @@ public abstract class ChatChannel { if (!receiver.chatShown()) continue; Message msg = format(receiver, sender, coloredMessage); - if (ChatManager.getDefault(receiver) != this) { - msg = new Message("CHAT_TAGGED", tag(receiver), msg); + if (tagged() && ChatManager.getDefault(receiver) != this) { + msg = new Message("CHAT_TAGGED", receiver.parseToPlain(tag(receiver)), msg); } receiver.send(false, null, null, msg); diff --git a/VelocityCore/src/de/steamwar/velocitycore/chat/DirectChannel.java b/VelocityCore/src/de/steamwar/velocitycore/chat/DirectChannel.java index b369bafda..0871357b5 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/chat/DirectChannel.java +++ b/VelocityCore/src/de/steamwar/velocitycore/chat/DirectChannel.java @@ -59,6 +59,11 @@ public class DirectChannel extends ChatChannel { return new Message("CHAT_CHANNEL_MSG", SteamwarUser.get(partner(receiver.user().getUUID()))); } + @Override + protected boolean tagged() { + return false; + } + @Override public Stream readers() { return Stream.of(first, second)