chat colors: add color option for player's own name
This commit is contained in:
@@ -131,13 +131,16 @@ public class ChatMessageManager
|
|||||||
case MODCHAT:
|
case MODCHAT:
|
||||||
{
|
{
|
||||||
String sanitizedUsername = Text.removeTags(chatMessage.getName());
|
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();
|
usernameColor = isChatboxTransparent ? chatColorConfig.transparentPublicFriendUsernames() : chatColorConfig.opaquePublicFriendUsernames();
|
||||||
}
|
}
|
||||||
if (usernameColor == null)
|
else
|
||||||
{
|
{
|
||||||
usernameColor = isChatboxTransparent ? chatColorConfig.transparentUsername() : chatColorConfig.opaqueUsername();
|
usernameColor = isChatboxTransparent ? chatColorConfig.transparentUsername() : chatColorConfig.opaqueUsername();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -313,6 +313,15 @@ public interface ChatColorConfig extends Config
|
|||||||
)
|
)
|
||||||
Color opaquePublicFriendUsernames();
|
Color opaquePublicFriendUsernames();
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 28,
|
||||||
|
keyName = "opaquePlayerUsername",
|
||||||
|
name = "Your username",
|
||||||
|
description = "Color of your username",
|
||||||
|
section = opaqueSection
|
||||||
|
)
|
||||||
|
Color opaquePlayerUsername();
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 51,
|
position = 51,
|
||||||
keyName = "transparentPublicChat",
|
keyName = "transparentPublicChat",
|
||||||
@@ -579,4 +588,13 @@ public interface ChatColorConfig extends Config
|
|||||||
section = transparentSection
|
section = transparentSection
|
||||||
)
|
)
|
||||||
Color transparentPublicFriendUsernames();
|
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