forked from SteamWar/SteamWar
Rework chat icon and name colors
- Mark the receiver's default channel with a green icon - Show the TeamChat icon in yellow, all other channel icons in gray - Use the rank prefix and rank color for sender names in TeamChat and ServerTeamChat, like in the global chat
This commit is contained in:
@@ -573,11 +573,11 @@ CHAT_BC_USAGE = §8/§7bc §8[§emessage§8]
|
||||
CHAT_NO_RECEIVER = §cNobody receives your message
|
||||
CHAT_EMPTY = §cDon\'t write meaningless empty messages.
|
||||
|
||||
CHAT_SERVERTEAM_SENDER = §e{0}
|
||||
CHAT_SERVERTEAM_SENDER = {4}{5}{6}{0}
|
||||
CHAT_SERVERTEAM = §8» §f{2}
|
||||
CHAT_GLOBAL_SENDER = {4}{5}{6}{0}
|
||||
CHAT_GLOBAL = §8» {7}{2}
|
||||
CHAT_TEAM_SENDER = §e{0}
|
||||
CHAT_TEAM_SENDER = {4}{5}{6}{0}
|
||||
CHAT_TEAM = §8» §f{2}
|
||||
CHAT_MSG_SENDER = §e{0}
|
||||
CHAT_MSG_SEPARATOR = §8»
|
||||
|
||||
@@ -538,11 +538,11 @@ CHAT_BC_USAGE = §8/§7bc §8[§eNachricht§8]
|
||||
CHAT_NO_RECEIVER = §cNiemand empfängt deine Nachricht
|
||||
CHAT_EMPTY = §cSchreibe keine inhaltslosen Nachrichten.
|
||||
|
||||
CHAT_SERVERTEAM_SENDER = §e{0}
|
||||
CHAT_SERVERTEAM_SENDER = {4}{5}{6}{0}
|
||||
CHAT_SERVERTEAM = §8» §f{2}
|
||||
CHAT_GLOBAL_SENDER = {4}{5}{6}{0}
|
||||
CHAT_GLOBAL = §8» {7}{2}
|
||||
CHAT_TEAM_SENDER = §e{0}
|
||||
CHAT_TEAM_SENDER = {4}{5}{6}{0}
|
||||
CHAT_TEAM = §8» §f{2}
|
||||
CHAT_MSG_SENDER = §e{0}
|
||||
CHAT_MSG_SEPARATOR = §8»
|
||||
|
||||
@@ -65,6 +65,13 @@ public abstract class ChatChannel {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the color of the channel icon if it is not the default channel of the receiver
|
||||
*/
|
||||
protected String iconColor() {
|
||||
return "§7";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the text put into the chat input when clicking the channel icon to write a single message, null if there is none
|
||||
*/
|
||||
@@ -131,7 +138,8 @@ public abstract class ChatChannel {
|
||||
|
||||
Component msg = ChatFormat.withMentionHovers(receiver, format(receiver, sender, coloredMessage));
|
||||
if (icon(receiver) != null) {
|
||||
Component icon = iconComponent(receiver, ChatManager.getDefault(receiver) == this ? "§e" : "§7");
|
||||
// The default channel of the receiver is marked by a green icon
|
||||
Component icon = iconComponent(receiver, ChatManager.getDefault(receiver) == this ? "§a" : iconColor());
|
||||
msg = Component.text().append(icon).append(Component.text(" ")).append(msg).build();
|
||||
}
|
||||
receiver.sendMessage(msg);
|
||||
|
||||
@@ -49,6 +49,11 @@ public class TeamChannel extends ChatChannel {
|
||||
return new Message("CHAT_CHANNEL_TEAM");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String iconColor() {
|
||||
return "§e";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Message icon(Chatter receiver) {
|
||||
return new Message("CHAT_ICON_TEAM");
|
||||
|
||||
Reference in New Issue
Block a user