chat colors: add color option for player's own name
This commit is contained in:
@@ -131,13 +131,16 @@ public class ChatMessageManager
|
||||
case MODCHAT:
|
||||
{
|
||||
String sanitizedUsername = Text.removeTags(chatMessage.getName());
|
||||
boolean isFriend = client.isFriended(sanitizedUsername, true) && !client.getLocalPlayer().getName().equals(sanitizedUsername);
|
||||
|
||||
if (isFriend)
|
||||
if (client.getLocalPlayer().getName().equals(sanitizedUsername))
|
||||
{
|
||||
usernameColor = isChatboxTransparent ? chatColorConfig.transparentPlayerUsername() : chatColorConfig.opaquePlayerUsername();
|
||||
}
|
||||
else if (client.isFriended(sanitizedUsername, true))
|
||||
{
|
||||
usernameColor = isChatboxTransparent ? chatColorConfig.transparentPublicFriendUsernames() : chatColorConfig.opaquePublicFriendUsernames();
|
||||
}
|
||||
if (usernameColor == null)
|
||||
else
|
||||
{
|
||||
usernameColor = isChatboxTransparent ? chatColorConfig.transparentUsername() : chatColorConfig.opaqueUsername();
|
||||
}
|
||||
|
||||
@@ -313,6 +313,15 @@ public interface ChatColorConfig extends Config
|
||||
)
|
||||
Color opaquePublicFriendUsernames();
|
||||
|
||||
@ConfigItem(
|
||||
position = 28,
|
||||
keyName = "opaquePlayerUsername",
|
||||
name = "Your username",
|
||||
description = "Color of your username",
|
||||
section = opaqueSection
|
||||
)
|
||||
Color opaquePlayerUsername();
|
||||
|
||||
@ConfigItem(
|
||||
position = 51,
|
||||
keyName = "transparentPublicChat",
|
||||
@@ -579,4 +588,13 @@ public interface ChatColorConfig extends Config
|
||||
section = transparentSection
|
||||
)
|
||||
Color transparentPublicFriendUsernames();
|
||||
|
||||
@ConfigItem(
|
||||
position = 78,
|
||||
keyName = "transparentPlayerUsername",
|
||||
name = "Your username (transparent)",
|
||||
description = "Color of your username (transparent)",
|
||||
section = transparentSection
|
||||
)
|
||||
Color transparentPlayerUsername();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user